From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751823AbbD3XJb (ORCPT ); Thu, 30 Apr 2015 19:09:31 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:49097 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbbD3XJ2 (ORCPT ); Thu, 30 Apr 2015 19:09:28 -0400 X-Auth-Info: L286prcfAC4TxlmUmdP2SrZ8xQv8xhsTEC2KgMT1dYA= From: Marek Vasut To: Michal Suchanek Subject: Re: [PATCH 1/3] MTD: m25p80: fix write return value. Date: Fri, 1 May 2015 01:09:22 +0200 User-Agent: KMail/1.13.7 (Linux/3.13-trunk-amd64; KDE/4.13.1; x86_64; ; ) Cc: David Woodhouse , Brian Norris , zajec5@gmail.com, Alison Chaiken , Ben Hutchings , Geert Uytterhoeven , "Bean Huo \(beanhuo\)" , "grmoore@altera.com" , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org References: <02f7510acb9b6dbb3a5a6cd5bb287762eb4d22c1.1430430153.git.hramrach@gmail.com> In-Reply-To: <02f7510acb9b6dbb3a5a6cd5bb287762eb4d22c1.1430430153.git.hramrach@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201505010109.22577.marex@denx.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, April 30, 2015 at 03:33:47 PM, Michal Suchanek wrote: > 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. > > v2: clearer commit message This V2 goes past the diffstat, so that when the patch is applied, it doesn't end up in the log. > Signed-off-by: Michal Suchanek > Acked-by: Marek Vasut > --- > drivers/mtd/devices/m25p80.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Aka. V changes go here. I don't think there's a need to repost tho :) > 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