Re: [PATCH 1/6] Staging: unisys: channels: Cleanup sparse warnings

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

 



On Thu, Mar 13, 2014 at 03:39:18PM -0500, Ken Cox wrote:
> Clean up multiple sparse warnings mostly due to different address spaces
> when accessing I/O memory.

The missing calls to readl() are bug fixes, not cleanups.  (Cleanups
mean it doesn't change how the code works).

> -visor_signal_insert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
> +visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, U32 Queue, void *pSignal)
>  {
> -	void *psignal;
> -	unsigned int head, tail;
> -	pSIGNAL_QUEUE_HEADER pqhdr =
> -	    (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
> -				    pChannel->oChannelSpace) + Queue;
> +	void __iomem *psignal;
> +	unsigned int head, tail, nof;
> +

Don't put a blank line in the middle of a declaration block.

> +	SIGNAL_QUEUE_HEADER __iomem *pqhdr =
> +	    (SIGNAL_QUEUE_HEADER __iomem *)
> +		((char __iomem *) pChannel + readq(&pChannel->oChannelSpace))
> +		+ Queue;

Really this assignement is too complicated for the declaration block but
that was in the original code and not something introduced by this
patch.

For future reference, this patch should have been broken up into
separate patches:
[1/3] add readl/writel for iomem access
	(don't mix bugfixes and unrelated cleanups).
[2/3] delete uncalled functions
[3/3] other sparse warnings

regards,
dan carpenter

_______________________________________________
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