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

Dan Carpenter dan.carpenter at oracle.com
Fri Mar 28 12:34:18 UTC 2014


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



More information about the devel mailing list