* Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write [not found] ` <38c818599e1de5530ba0fe86d262d26d737ee7a2.1438626500.git.hramrach@gmail.com> @ 2015-08-03 21:46 ` Marek Vasut 2015-08-04 6:42 ` Michal Suchanek 0 siblings, 1 reply; 5+ messages in thread From: Marek Vasut @ 2015-08-03 21:46 UTC (permalink / raw) To: Michal Suchanek Cc: David Woodhouse, Brian Norris, Han Xu, Rafał Miłecki, Huang Shijie, Ben Hutchings, Gabor Juhos, Bean Huo 霍斌斌, linux-mtd, linux-kernel, Hou Zhiqiang, shijie.huang 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 ? :) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write 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 0 siblings, 1 reply; 5+ messages in thread From: Michal Suchanek @ 2015-08-04 6:42 UTC (permalink / raw) To: Marek Vasut Cc: David Woodhouse, Brian Norris, Han Xu, Rafał Miłecki, Huang Shijie, Ben Hutchings, Gabor Juhos, Bean Huo 霍斌斌, MTD Maling List, Linux Kernel Mailing List, Hou Zhiqiang, Huang Shijie 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. The data type in the fsl-quadspi and m25p80 drivers is matched in the following two patches. Thanks Michal ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write 2015-08-04 6:42 ` Michal Suchanek @ 2015-08-04 16:42 ` Marek Vasut 2015-08-05 8:27 ` Michal Suchanek 0 siblings, 1 reply; 5+ messages in thread From: Marek Vasut @ 2015-08-04 16:42 UTC (permalink / raw) To: Michal Suchanek Cc: David Woodhouse, Brian Norris, Han Xu, Rafał Miłecki, Huang Shijie, Ben Hutchings, Gabor Juhos, Bean Huo 霍斌斌, MTD Maling List, Linux Kernel Mailing List, Hou Zhiqiang, Huang Shijie 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write 2015-08-04 16:42 ` Marek Vasut @ 2015-08-05 8:27 ` Michal Suchanek 2015-08-05 9:11 ` Marek Vasut 0 siblings, 1 reply; 5+ messages in thread From: Michal Suchanek @ 2015-08-05 8:27 UTC (permalink / raw) To: Marek Vasut Cc: David Woodhouse, Brian Norris, Han Xu, Rafał Miłecki, Huang Shijie, Ben Hutchings, Gabor Juhos, Bean Huo 霍斌斌, MTD Maling List, Linux Kernel Mailing List, Hou Zhiqiang, Huang Shijie On 4 August 2015 at 18:42, Marek Vasut <marex@denx.de> wrote: > 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 ? :-) No, it's larger or equal. > 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. If this is the only concern with these patches it is easily amended ;-) Thanks Michal ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write 2015-08-05 8:27 ` Michal Suchanek @ 2015-08-05 9:11 ` Marek Vasut 0 siblings, 0 replies; 5+ messages in thread From: Marek Vasut @ 2015-08-05 9:11 UTC (permalink / raw) To: Michal Suchanek Cc: David Woodhouse, Brian Norris, Han Xu, Rafał Miłecki, Huang Shijie, Ben Hutchings, Gabor Juhos, Bean Huo 霍斌斌, MTD Maling List, Linux Kernel Mailing List, Hou Zhiqiang, Huang Shijie On Wednesday, August 05, 2015 at 10:27:05 AM, Michal Suchanek wrote: > On 4 August 2015 at 18:42, Marek Vasut <marex@denx.de> wrote: > > 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 ? :-) > > No, it's larger or equal. Not per any standard to my knowledge, but yeah. I don't think it's a good idea to do this change alone. > > 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. > > If this is the only concern with these patches it is easily amended ;-) It'd be nice if the others reviewed it as well, additional feedback would be nice. Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-05 9:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
2015-08-05 8:27 ` Michal Suchanek
2015-08-05 9:11 ` Marek Vasut
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox