From patchwork Thu Mar 20 11:54:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 3865951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E9A6E9F370 for ; Thu, 20 Mar 2014 13:29:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2399D20219 for ; Thu, 20 Mar 2014 13:29:39 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34A9220213 for ; Thu, 20 Mar 2014 13:29:38 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQbbs-00017o-1F; Thu, 20 Mar 2014 11:58:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQbbp-00062X-Io; Thu, 20 Mar 2014 11:58:05 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQbYi-0005nl-GE; Thu, 20 Mar 2014 11:54:55 +0000 Received: by mail-pa0-f48.google.com with SMTP id hz1so836685pad.35 for ; Thu, 20 Mar 2014 04:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=JNDHL4LVqSUqP3il5aZIbQ6h1e+CAnEpcGy/tlxSFsM=; b=f+FzHzyvzDVj56aNM+9A6dBudOXaBFMcfEY6EPdDwJoX5Nv7EfOcTopmFF5ArQMFKs +XKJ9iyu6z8cDGoJ1BRVDrVrdhdrlK/g2j+htaL500ZSHanboyA2Jejr2wJeXFgzBE1i HvtRmdOUHexk0qzN2s3qhaNqtRNfNadWQShMMvdFA9H5n+mn0YjSV4CIAdbjen4np6Zc XzNu5IBj8l2EuwQPf6ZIothTrkeQZLczBawV7T2p2+wy9MfIUzwpMgRhQNcQqNiv+EPu pbDozlpIQFrnAEoQmINeAhRYcxGsfA/yfV8ffj0pQaZCcbXz7livL+opw3aJ3EmrGJMr 0I1g== X-Received: by 10.66.141.144 with SMTP id ro16mr24429450pab.131.1395316467188; Thu, 20 Mar 2014 04:54:27 -0700 (PDT) Received: from norris-Latitude-E6410 (cpe-98-154-223-43.socal.res.rr.com. [98.154.223.43]) by mx.google.com with ESMTPSA id i10sm9008995pat.36.2014.03.20.04.54.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 04:54:26 -0700 (PDT) Date: Thu, 20 Mar 2014 04:54:12 -0700 From: Brian Norris To: Joe Perches Subject: Re: [PATCH 1/5] mtd: st_spi_fsm: Remove useless consts from function arguments Message-ID: <20140320115412.GU31517@norris-Latitude-E6410> References: <1395313907-25318-1-git-send-email-lee.jones@linaro.org> <1395313907-25318-2-git-send-email-lee.jones@linaro.org> <1395314713.7776.17.camel@joe-AO722> <20140320114123.GE21349@lee--X1> <1395316090.7776.24.camel@joe-AO722> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1395316090.7776.24.camel@joe-AO722> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140320_075452_752524_768F9829 X-CRM114-Status: GOOD ( 16.24 ) X-Spam-Score: -2.0 (--) Cc: angus.clark@st.com, kernel@stlinux.com, Lee Jones , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Mar 20, 2014 at 04:48:10AM -0700, Joe Perches wrote: > On Thu, 2014-03-20 at 11:41 +0000, Lee Jones wrote: > > On Thu, 20 Mar 2014, Joe Perches wrote: > > > On Thu, 2014-03-20 at 11:11 +0000, Lee Jones wrote: > > > > Reported-by: Brian Norris > > > > Signed-off-by: Lee Jones > > > > > > Why are these useless? > > > > > > Even if the object code produced is the same, > > > these serve as information to the human reader > > > about how the arguments are used. > > > > https://lkml.org/lkml/2014/3/20/69 > > > > From that email: > > suggestion: > > const uint8_t *const buf => const uint8_t *buf > const uint32_t size => uint32_t size > const uint32_t offset => uint32_t offset > > What was done: > > -static int stfsm_write_fifo(struct stfsm *fsm, > - const uint32_t *buf, const uint32_t size) > +static int stfsm_write_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size) > > Note the removal of the const from uint32_t *buf Good catch. That wasn't my intention. > Why? I can let Lee speak for himself. But I'm thinking I'll squash this diff in, if no one minds: Signed-off-by: Brian Norris diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index bea1416aad07..1957d7c8e185 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -810,7 +810,8 @@ static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size) } } -static int stfsm_write_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size) +static int stfsm_write_fifo(struct stfsm *fsm, const uint32_t *buf, + uint32_t size) { uint32_t words = size >> 2; @@ -1806,7 +1807,7 @@ out1: return ret; } -static void stfsm_read_jedec(struct stfsm *fsm, uint8_t *const jedec) +static void stfsm_read_jedec(struct stfsm *fsm, uint8_t *jedec) { const struct stfsm_seq *seq = &stfsm_seq_read_jedec; uint32_t tmp[2];