[PATCH v3 3/3] Staging: bcm: hostmibs: Added temporary variable to shorten lines

Joe Perches joe at perches.com
Thu Nov 3 17:34:54 UTC 2011


On Thu, 2011-11-03 at 12:25 -0300, Diego F. Marfil wrote:
> diff --git a/drivers/staging/bcm/hostmibs.c b/drivers/staging/bcm/hostmibs.c
[]
> +	S_MIBS_EXTSERVICEFLOW_PARAMETERS *t = &Adapter->PackInfo[uiSearchRuleIndex].stMibsExtServiceFlowTable;
> +
> +	t->wmanIfSfid = psfLocalSet->u32SFID;
> +	t->wmanIfCmnCpsMaxSustainedRate = psfLocalSet->u32MaxSustainedTrafficRate;
> +	t->wmanIfCmnCpsMaxTrafficBurst = psfLocalSet->u32MaxTrafficBurst;
> +	t->wmanIfCmnCpsMinReservedRate = psfLocalSet->u32MinReservedTrafficRate;
> +	t->wmanIfCmnCpsToleratedJitter = psfLocalSet->u32ToleratedJitter;
> +	t->wmanIfCmnCpsMaxLatency = psfLocalSet->u32MaximumLatency;
> +	t->wmanIfCmnCpsFixedVsVariableSduInd = psfLocalSet->u8FixedLengthVSVariableLengthSDUIndicator;
> +	t->wmanIfCmnCpsFixedVsVariableSduInd = ntohl(t->wmanIfCmnCpsFixedVsVariableSduInd);

I suggest you don't a set and then use ntohl but
instead only use ntohl

	t->wmanIfCmnCpsFixedVsVariableSduInd = ntohl((long)psfLocalSet->u8FixedLengthVSVariableLengthSDUIndicator);
[]
> +	t->wmanIfCmnCpsSfSchedulingType = psfLocalSet->u8ServiceFlowSchedulingType;
> +	t->wmanIfCmnCpsSfSchedulingType = ntohl(t->wmanIfCmnCpsSfSchedulingType);
here
> +	t->wmanIfCmnCpsArqEnable = psfLocalSet->u8ARQEnable;
> +	t->wmanIfCmnCpsArqEnable = ntohl(t->wmanIfCmnCpsArqEnable);
here
> +	t->wmanIfCmnCpsArqWindowSize = ntohs(psfLocalSet->u16ARQWindowSize);
> +	t->wmanIfCmnCpsArqWindowSize = ntohl(t->wmanIfCmnCpsArqWindowSize);

huh? There are a few of these that don't make much sense to me.
ntohs then ntohl?  why?

etc...




More information about the devel mailing list