Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754707AbbETTxd (ORCPT ); Wed, 20 May 2015 15:53:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40530 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbbETTxb (ORCPT ); Wed, 20 May 2015 15:53:31 -0400 Date: Wed, 20 May 2015 12:53:29 -0700 From: Andrew Morton To: Arnd Bergmann Cc: Dave Gordon , "Martin K. Petersen" , Akinobu Mita , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jbottomley@odin.com Subject: Re: [PATCH] scsi: debug: fix type mismatch warning for sg_pcopy_from_buffer Message-Id: <20150520125329.d63f66765a552efa69a45038@linux-foundation.org> In-Reply-To: <6309932.EjHf7uUo1X@wuerfel> References: <6309932.EjHf7uUo1X@wuerfel> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1404 Lines: 32 On Tue, 19 May 2015 23:22:39 +0200 Arnd Bergmann 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 > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/