From: Marek Vasut <marex@denx.de>
To: Michal Suchanek <hramrach@gmail.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
devicetree@vger.kernel.org,
"grmoore@altera.com" <grmoore@altera.com>,
"Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Pawel Moll" <pawel.moll@arm.com>,
"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
"Ben Hutchings" <ben@decadent.org.uk>,
"Rafał Miłecki" <zajec5@gmail.com>,
linux-kernel@vger.kernel.org,
"Huang Shijie" <b32955@freescale.com>,
linux-sunxi@googlegroups.com, "Rob Herring" <robh+dt@kernel.org>,
linux-mtd@lists.infradead.org,
"Kumar Gala" <galak@codeaurora.org>,
"Brian Norris" <computersforpeace@gmail.com>,
"David Woodhouse" <dwmw2@infradead.org>,
"Alison Chaiken" <alison_chaiken@mentor.com>,
"Bean Huo 霍斌斌 (beanhuo)" <beanhuo@micron.com>
Subject: Re: [PATCH 1/3] MTD: m25p80: fix write return value.
Date: Thu, 30 Apr 2015 20:43:11 +0200 [thread overview]
Message-ID: <201504302043.11118.marex@denx.de> (raw)
In-Reply-To: <55132b4496e7fe73f949186c0f140f3e4fd4e2c7.1430403750.git.hramrach@gmail.com>
On Thursday, April 30, 2015 at 03:33:47 PM, Michal Suchanek wrote:
> The size of written data was added to user supplied value rather than
> written at the provided address.
You might want to work on the commit message a little, something like
the following, but feel free to reword as seen fit.
The 'retlen' points to a variable representing the number of data bytes
written/read (see include/linux/mtd/mtd.h) by the current invocation of
the function. This variable must be set, not incremented.
Otherwise, the patch is correct I believe:
Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
> ---
> drivers/mtd/devices/m25p80.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 7c8b169..0b2bc21 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -102,7 +102,7 @@ static void m25p80_write(struct spi_nor *nor, loff_t
> to, size_t len,
>
> spi_sync(spi, &m);
>
> - *retlen += m.actual_length - cmd_sz;
> + *retlen = m.actual_length - cmd_sz;
> }
>
> static inline unsigned int m25p80_rx_nbits(struct spi_nor *nor)
Best regards,
Marek Vasut
WARNING: multiple messages have this Message-ID (diff)
From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Pawel Moll" <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
"Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"Ian Campbell"
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
"Kumar Gala" <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"David Woodhouse" <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
"Brian Norris"
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Huang Shijie" <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
"Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Ben Hutchings" <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>,
"Alison Chaiken"
<alison_chaiken-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>,
"Mika Westerberg"
<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
"Bean Huo 霍斌斌 (beanhuo)"
<beanhuo-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>,
"grmoore-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org"
<grmoore-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/3] MTD: m25p80: fix write return value.
Date: Thu, 30 Apr 2015 20:43:11 +0200 [thread overview]
Message-ID: <201504302043.11118.marex@denx.de> (raw)
In-Reply-To: <55132b4496e7fe73f949186c0f140f3e4fd4e2c7.1430403750.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Thursday, April 30, 2015 at 03:33:47 PM, Michal Suchanek wrote:
> The size of written data was added to user supplied value rather than
> written at the provided address.
You might want to work on the commit message a little, something like
the following, but feel free to reword as seen fit.
The 'retlen' points to a variable representing the number of data bytes
written/read (see include/linux/mtd/mtd.h) by the current invocation of
the function. This variable must be set, not incremented.
Otherwise, the patch is correct I believe:
Acked-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> Signed-off-by: Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/mtd/devices/m25p80.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 7c8b169..0b2bc21 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -102,7 +102,7 @@ static void m25p80_write(struct spi_nor *nor, loff_t
> to, size_t len,
>
> spi_sync(spi, &m);
>
> - *retlen += m.actual_length - cmd_sz;
> + *retlen = m.actual_length - cmd_sz;
> }
>
> static inline unsigned int m25p80_rx_nbits(struct spi_nor *nor)
Best regards,
Marek Vasut
WARNING: multiple messages have this Message-ID (diff)
From: Marek Vasut <marex@denx.de>
To: Michal Suchanek <hramrach@gmail.com>
Cc: linux-sunxi@googlegroups.com, "Rob Herring" <robh+dt@kernel.org>,
"Pawel Moll" <pawel.moll@arm.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
"Kumar Gala" <galak@codeaurora.org>,
"David Woodhouse" <dwmw2@infradead.org>,
"Brian Norris" <computersforpeace@gmail.com>,
"Huang Shijie" <b32955@freescale.com>,
" Rafał Miłecki" <zajec5@gmail.com>,
"Ben Hutchings" <ben@decadent.org.uk>,
"Alison Chaiken" <alison_chaiken@mentor.com>,
"Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Bean Huo 霍斌斌 (beanhuo)" <beanhuo@micron.com>,
"grmoore@altera.com" <grmoore@altera.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/3] MTD: m25p80: fix write return value.
Date: Thu, 30 Apr 2015 20:43:11 +0200 [thread overview]
Message-ID: <201504302043.11118.marex@denx.de> (raw)
In-Reply-To: <55132b4496e7fe73f949186c0f140f3e4fd4e2c7.1430403750.git.hramrach@gmail.com>
On Thursday, April 30, 2015 at 03:33:47 PM, Michal Suchanek wrote:
> The size of written data was added to user supplied value rather than
> written at the provided address.
You might want to work on the commit message a little, something like
the following, but feel free to reword as seen fit.
The 'retlen' points to a variable representing the number of data bytes
written/read (see include/linux/mtd/mtd.h) by the current invocation of
the function. This variable must be set, not incremented.
Otherwise, the patch is correct I believe:
Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
> ---
> drivers/mtd/devices/m25p80.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 7c8b169..0b2bc21 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -102,7 +102,7 @@ static void m25p80_write(struct spi_nor *nor, loff_t
> to, size_t len,
>
> spi_sync(spi, &m);
>
> - *retlen += m.actual_length - cmd_sz;
> + *retlen = m.actual_length - cmd_sz;
> }
>
> static inline unsigned int m25p80_rx_nbits(struct spi_nor *nor)
Best regards,
Marek Vasut
next prev parent reply other threads:[~2015-04-30 20:58 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 14:22 [PATCH 0/3] Using SPI NOR flah on sunxi Michal Suchanek
2015-04-30 14:22 ` Michal Suchanek
2015-04-30 13:33 ` [PATCH 1/3] MTD: m25p80: fix write return value Michal Suchanek
2015-04-30 13:33 ` Michal Suchanek
2015-04-30 18:43 ` Marek Vasut [this message]
2015-04-30 18:43 ` Marek Vasut
2015-04-30 18:43 ` Marek Vasut
2015-04-30 21:37 ` Michal Suchanek
2015-04-30 21:37 ` Michal Suchanek
2015-04-30 21:37 ` Michal Suchanek
2015-04-30 13:38 ` [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write Michal Suchanek
2015-04-30 13:38 ` Michal Suchanek
2015-05-20 23:38 ` Brian Norris
2015-05-20 23:38 ` Brian Norris
2015-05-20 23:38 ` Brian Norris
2015-05-21 8:39 ` Michal Suchanek
2015-05-21 8:39 ` Michal Suchanek
2015-05-21 8:39 ` Michal Suchanek
2015-05-21 10:28 ` Mark Brown
2015-05-21 10:28 ` Mark Brown
2015-05-21 10:28 ` Mark Brown
2015-05-22 7:17 ` Brian Norris
2015-05-22 7:17 ` Brian Norris
2015-05-22 7:17 ` Brian Norris
2015-05-22 7:25 ` Brian Norris
2015-05-22 7:25 ` Brian Norris
2015-05-22 7:25 ` Brian Norris
2015-05-22 9:37 ` Mark Brown
2015-05-22 9:37 ` Mark Brown
2015-05-22 9:37 ` Mark Brown
2015-04-30 13:46 ` [PATCH 3/3] MTD: m25p80: Add option to limit SPI transfer size Michal Suchanek
2015-04-30 13:46 ` Michal Suchanek
2015-04-30 14:58 ` [linux-sunxi] " Julian Calaby
2015-04-30 14:58 ` Julian Calaby
2015-04-30 14:58 ` Julian Calaby
2015-05-20 23:27 ` [linux-sunxi] " Brian Norris
2015-05-20 23:27 ` Brian Norris
2015-05-20 23:27 ` Brian Norris
2015-04-30 16:30 ` [PATCH 0/3] Using SPI NOR flah on sunxi Thomas.Betker
[not found] ` <cover.1430403750.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-30 16:30 ` Thomas.Betker-Bf/A/FSCP0w3s4ca2cGeAgC/G2K4zDHf
2015-04-30 16:30 ` Thomas.Betker
2015-04-30 16:30 ` Thomas.Betker
2015-04-30 16:30 ` Thomas.Betker
2015-04-30 16:30 ` Thomas.Betker
2015-04-30 16:56 ` Michal Suchanek
2015-04-30 16:56 ` Michal Suchanek
2015-04-30 16:56 ` Michal Suchanek
2015-04-30 18:34 ` Marek Vasut
2015-04-30 18:34 ` Marek Vasut
2015-04-30 18:34 ` Marek Vasut
2015-05-20 23:54 ` Brian Norris
2015-05-20 23:54 ` Brian Norris
2015-05-20 23:54 ` Brian Norris
2015-05-20 23:54 ` Brian Norris
2015-05-01 12:27 ` Stefan Monnier
2015-05-04 10:32 ` [linux-sunxi] " Michal Suchanek
2015-05-04 10:32 ` Michal Suchanek
2015-05-04 10:32 ` Michal Suchanek
-- strict thread matches above, loose matches on Subject: below --
2015-04-30 21:42 [PATCH 0/3] Minor fix and new Chip IDs for spi-nor Michal Suchanek
2015-04-30 13:33 ` [PATCH 1/3] MTD: m25p80: fix write return value Michal Suchanek
2015-04-30 23:09 ` Marek Vasut
2015-04-30 23:09 ` Marek Vasut
2015-05-20 23:45 ` Brian Norris
2015-05-20 23:45 ` Brian Norris
2015-05-21 8:33 ` Michal Suchanek
2015-05-21 8:33 ` Michal Suchanek
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=201504302043.11118.marex@denx.de \
--to=marex@denx.de \
--cc=alison_chaiken@mentor.com \
--cc=b32955@freescale.com \
--cc=beanhuo@micron.com \
--cc=ben@decadent.org.uk \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=galak@codeaurora.org \
--cc=grmoore@altera.com \
--cc=hramrach@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mark.rutland@arm.com \
--cc=mika.westerberg@linux.intel.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.