[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140320165807.GV31517@norris-Latitude-E6410>
Date: Thu, 20 Mar 2014 09:58:07 -0700
From: Brian Norris <computersforpeace@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Lee Jones <lee.jones@...aro.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Linux Kernel <linux-kernel@...r.kernel.org>,
kernel@...inux.com,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
David Woodhouse <dwmw2@...radead.org>,
Angus CLARK <angus.clark@...com>
Subject: Re: [PATCH 1/5] mtd: st_spi_fsm: Remove useless consts from function
arguments
On Thu, Mar 20, 2014 at 05:44:45AM -0700, Joe Perches wrote:
> On Thu, 2014-03-20 at 05:41 -0700, Brian Norris wrote:
> > I also don't think that a function parameter is the right place to
> > mark const like this. Function arguments are always pass-by-value, so
> > this 'const' tells users (callers) nothing useful. It only provides
> > useless constraints on what the function can do with its copy of the
> > parameter.
>
> Again, that's not useless information.
For local, pass-by-value function arguments (i.e., constant data, or
constant pointers to data), I respectfully disagree. (For "pointers to
constant data", I completely agree that the 'const' info is useful.)
> And as you've seen, just making these changes
> can be error prone.
Thank you for catching our mistake now. But I don't think that is
relevant; just because you caught an error doesn't mean that the change
(primarily for consistency's sake) should be avoided entirely.
Unless you have a more convincing argument, this code will remain as-is.
Regards,
Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists