Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754824AbbHDQmL (ORCPT ); Tue, 4 Aug 2015 12:42:11 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:55349 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbbHDQmJ (ORCPT ); Tue, 4 Aug 2015 12:42:09 -0400 X-Auth-Info: DNpsfBRHljsWjDQtyJJDk81r+Sq1jAxao9TXPC4VLgc= From: Marek Vasut To: Michal Suchanek Subject: Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write Date: Tue, 4 Aug 2015 18:42:03 +0200 User-Agent: KMail/1.13.7 (Linux/3.14-2-amd64; KDE/4.13.1; x86_64; ; ) Cc: David Woodhouse , Brian Norris , Han Xu , =?utf-8?q?Rafa=C5=82_Mi=C5=82ecki?= , Huang Shijie , Ben Hutchings , Gabor Juhos , Bean Huo =?utf-8?q?=E9=9C=8D=E6=96=8C=E6=96=8C?= , MTD Maling List , Linux Kernel Mailing List , Hou Zhiqiang , Huang Shijie References: <201508032346.36032.marex@denx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201508041842.03871.marex@denx.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2450 Lines: 64 On Tuesday, August 04, 2015 at 08:42:51 AM, Michal Suchanek wrote: > On 3 August 2015 at 23:46, Marek Vasut wrote: > > On Monday, August 03, 2015 at 08:39:01 PM, Michal Suchanek wrote: > >> Change the return value of spi-nor device read and write methods to > >> allow returning amount of data transferred and errors as > >> read(2)/write(2) does. > >> > >> Signed-off-by: Michal Suchanek > >> --- > >> > >> include/linux/mtd/spi-nor.h | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h > >> index e540952..7d782cb 100644 > >> --- a/include/linux/mtd/spi-nor.h > >> +++ b/include/linux/mtd/spi-nor.h > >> @@ -185,9 +185,9 @@ struct spi_nor { > >> > >> int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len, > >> > >> int write_enable); > >> > >> - int (*read)(struct spi_nor *nor, loff_t from, > >> + ssize_t (*read)(struct spi_nor *nor, loff_t from, > >> > >> size_t len, size_t *retlen, u_char *read_buf); > >> > >> - void (*write)(struct spi_nor *nor, loff_t to, > >> + ssize_t (*write)(struct spi_nor *nor, loff_t to, > >> > >> size_t len, size_t *retlen, const u_char > >> *write_buf); > >> > >> int (*erase)(struct spi_nor *nor, loff_t offs); > > > > You realize that if someone does bisect and has only this patch applied, > > the compiler will complain loudly about mismatching data types, right ? > > :) > > Yes, the compiler prints a warning. However, only the return value > which is not used changes so it should not cause any real problem. Are you certain that ssize_t is equal to int , always , everywhere ? :-) Note that it is possible to do such conversion even without introducing compiler warnings along the way -- just do the data type conversion first and the other changes in subsequent patches. It will be clear that one patch does one thing then. > The > data type in the fsl-quadspi and m25p80 drivers is matched in the > following two patches. > > Thanks > > Michal Best regards, Marek Vasut -- 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/