public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Michal Suchanek <hramrach@gmail.com>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Han Xu" <han.xu@freescale.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Huang Shijie" <b32955@freescale.com>,
	"Ben Hutchings" <ben@decadent.org.uk>,
	"Gabor Juhos" <juhosg@openwrt.org>,
	"Bean Huo 霍斌斌" <beanhuo@micron.com>,
	"MTD Maling List" <linux-mtd@lists.infradead.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Hou Zhiqiang" <B48286@freescale.com>,
	"Huang Shijie" <shijie.huang@intel.com>
Subject: Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write
Date: Tue, 4 Aug 2015 18:42:03 +0200	[thread overview]
Message-ID: <201508041842.03871.marex@denx.de> (raw)
In-Reply-To: <CAOMqctQf0c4orOQTD1UJiyZdLadg73b98bpxN5a_RuXnEOFpfA@mail.gmail.com>

On Tuesday, August 04, 2015 at 08:42:51 AM, Michal Suchanek wrote:
> On 3 August 2015 at 23:46, Marek Vasut <marex@denx.de> 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 <hramrach@gmail.com>
> >> ---
> >> 
> >>  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

  reply	other threads:[~2015-08-04 16:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1438626500.git.hramrach@gmail.com>
     [not found] ` <38c818599e1de5530ba0fe86d262d26d737ee7a2.1438626500.git.hramrach@gmail.com>
2015-08-03 21:46   ` [PATCH v2 1/6] mtd: spi-nor: change return value of read/write Marek Vasut
2015-08-04  6:42     ` Michal Suchanek
2015-08-04 16:42       ` Marek Vasut [this message]
2015-08-05  8:27         ` Michal Suchanek
2015-08-05  9:11           ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201508041842.03871.marex@denx.de \
    --to=marex@denx.de \
    --cc=B48286@freescale.com \
    --cc=b32955@freescale.com \
    --cc=beanhuo@micron.com \
    --cc=ben@decadent.org.uk \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=han.xu@freescale.com \
    --cc=hramrach@gmail.com \
    --cc=juhosg@openwrt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=shijie.huang@intel.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox