Re: [PATCH 1/4] Staging: bcm: replaced member accessing with variable for readability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 23 Jun 2014 21:50:44 +0200 Matthias Beyer wrote:
> Signed-off-by: Matthias Beyer <mail@xxxxxxxxxxxxxxxx>
> ---
>  drivers/staging/bcm/hostmibs.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/bcm/hostmibs.c b/drivers/staging/bcm/hostmibs.c
> index 42d9004..af3493c 100644
> --- a/drivers/staging/bcm/hostmibs.c
> +++ b/drivers/staging/bcm/hostmibs.c
> @@ -17,6 +17,7 @@ INT ProcessGetHostMibs(struct bcm_mini_adapter *Adapter,
>  	struct bcm_phs_classifier_table *pstClassifierTable = NULL;
>  	struct bcm_phs_classifier_entry *pstClassifierRule = NULL;
>  	struct bcm_phs_extension *pDeviceExtension = &Adapter->stBCMPhsContext;
> +	struct bcm_mibs_host_info *host_info;
>  	UINT nClassifierIndex = 0;
>  	UINT nPhsTableIndex = 0;
>  	UINT nSfIndex = 0;
> @@ -83,18 +84,18 @@ INT ProcessGetHostMibs(struct bcm_mini_adapter *Adapter,
>  	}
>  
>  	/* Copy other Host Statistics parameters */
> -	pstHostMibs->stHostInfo.GoodTransmits = Adapter->dev->stats.tx_packets;
> -	pstHostMibs->stHostInfo.GoodReceives = Adapter->dev->stats.rx_packets;
> -	pstHostMibs->stHostInfo.CurrNumFreeDesc =
> -				atomic_read(&Adapter->CurrNumFreeTxDesc);
> -	pstHostMibs->stHostInfo.BEBucketSize = Adapter->BEBucketSize;
> -	pstHostMibs->stHostInfo.rtPSBucketSize = Adapter->rtPSBucketSize;
> -	pstHostMibs->stHostInfo.TimerActive = Adapter->TimerActive;
> -	pstHostMibs->stHostInfo.u32TotalDSD = Adapter->u32TotalDSD;
> -
> -	memcpy(pstHostMibs->stHostInfo.aTxPktSizeHist, Adapter->aTxPktSizeHist,
> +	host_info = &pstHostMibs->stHostInfo;
> +	host_info->GoodTransmits    = Adapter->dev->stats.tx_packets;
> +	host_info->GoodReceives	    = Adapter->dev->stats.rx_packets;
> +	host_info->CurrNumFreeDesc  = atomic_read(&Adapter->CurrNumFreeTxDesc);
> +	host_info->BEBucketSize	    = Adapter->BEBucketSize;
> +	host_info->rtPSBucketSize   = Adapter->rtPSBucketSize;
> +	host_info->TimerActive	    = Adapter->TimerActive;
> +	host_info->u32TotalDSD	    = Adapter->u32TotalDSD;
> +
> +	memcpy(host_info->aTxPktSizeHist, Adapter->aTxPktSizeHist,
>  	       sizeof(UINT32) * MIBS_MAX_HIST_ENTRIES);
> -	memcpy(pstHostMibs->stHostInfo.aRxPktSizeHist, Adapter->aRxPktSizeHist,
> +	memcpy(host_info->aRxPktSizeHist, Adapter->aRxPktSizeHist,
>  	       sizeof(UINT32) * MIBS_MAX_HIST_ENTRIES);
>  
>  	return STATUS_SUCCESS;

seems fine to me ... 

Reviewed-by: Jake Edge <jake@xxxxxxx>

jake

-- 
Jake Edge - LWN - jake@xxxxxxx - http://lwn.net
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux