[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150520125329.d63f66765a552efa69a45038@linux-foundation.org>
Date: Wed, 20 May 2015 12:53:29 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Dave Gordon <david.s.gordon@...el.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Akinobu Mita <akinobu.mita@...il.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
jbottomley@...n.com
Subject: Re: [PATCH] scsi: debug: fix type mismatch warning for
sg_pcopy_from_buffer
On Tue, 19 May 2015 23:22:39 +0200 Arnd Bergmann <arnd@...db.de> wrote:
> The recent change to mark the input argument of sg_pcopy_from_buffer
> had the unfortunate side-effect to cause a new warning in the
> scsi_debug code:
>
> drivers/scsi/scsi_debug.c: In function 'do_device_access':
> drivers/scsi/scsi_debug.c:2376:8: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
> func = sg_pcopy_from_buffer;
>
> This patch attempts to avoid that warning without adding
> evil type casts, but unfortunately makes the do_device_access
> function a lot uglier in the process.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Fixes: 5250326459 ("lib/scatterlist: mark input buffer parameters as 'const'")
> ---
>
> I can't decide if this is actually a good idea, or if we should rather drop
> the sg_pcopy_from_buffer() patch. Maybe someone else sees a better solution.
Could make do_device_access() call sg_copy_buffer() directly.
But yes, dropping the sg_pcopy_from/to_buffer changes is reasonable.
sg_copy_buffer() is bidirectional and that won't be changing, so
putting constified wrapeprs around it is kinda fake.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists