[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190908135208.GA29162@rocinante>
Date: Sun, 8 Sep 2019 15:52:09 +0200
From: Krzysztof Wilczynski <kw@...ux.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: light: bh1750: Move static keyword to the front of
declaration
Hello Jonathan,
Thank you for feedback.
[...]
> > drivers/iio/light/bh1750.c:64:1: warning:
> > ‘static’ is not at beginning of declaration [-Wold-style-declaration]
[...]
> This one has me confused. The warning seems to be false as static
> is at the beginning of the declaration....
>
> Sure we "could" combine the declaration with the definition as you have
> done here, but that has nothing much to do with the warning.
[...]
I only moved the "static const" at the front, I haven't changed the
code as it's already has been a declaration and definition. There is
no semicolon there and the original author put a newline to separate
things which makes it look as if these were separate.
Simple example based on the existing code:
https://godbolt.org/z/hV4HP7
I hope this helps to illustrate the change in the patch. I apologise
if my approach was incorrect.
As part of the patch I removed the newline in an aim to make it less
confusing to anyone who will read the code in the future. Especially,
since it makes it a bit awkward to read and when using things like
grep.
Krzysztof
Powered by blists - more mailing lists