archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Wilczynski <>
To: Jonathan Cameron <>
Cc: Hartmut Knaack <>,
	Lars-Peter Clausen <>,
	Peter Meerwald-Stadler <>,,
Subject: Re: [PATCH] iio: light: bh1750: Move static keyword to the front of declaration
Date: Sun, 8 Sep 2019 15:52:09 +0200	[thread overview]
Message-ID: <20190908135208.GA29162@rocinante> (raw)
In-Reply-To: <20190908114944.18bb78e3@archlinux>

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:

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


  reply	other threads:[~2019-09-08 13:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 11:31 [PATCH] iio: light: bh1750: Move static keyword to the front of declaration Krzysztof Wilczynski
2019-09-03 17:35 ` Tomasz Duszynski
2019-09-08 10:49 ` Jonathan Cameron
2019-09-08 13:52   ` Krzysztof Wilczynski [this message]
2019-09-10 13:35     ` Jonathan Cameron
2019-09-10 20:25       ` Krzysztof Wilczynski

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190908135208.GA29162@rocinante \ \ \ \ \ \ \ \

* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).