diff options
author | Krzysztof Wilczynski <kw@linux.com> | 2019-09-13 22:24:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-31 16:34:48 +0100 |
commit | cfcf92d8571d5f447b66d85c0bf5c9ed76f2b880 (patch) | |
tree | fbf585315cf47ab74e009e69ed58a0555d65f0e6 | |
parent | 0f08ffb42e43d83d5979bceef721cdb7584b7775 (diff) | |
download | linux-stable-cfcf92d8571d5f447b66d85c0bf5c9ed76f2b880.tar.gz linux-stable-cfcf92d8571d5f447b66d85c0bf5c9ed76f2b880.tar.bz2 linux-stable-cfcf92d8571d5f447b66d85c0bf5c9ed76f2b880.zip |
iio: light: bh1750: Resolve compiler warning and make code more readable
[ Upstream commit f552fde983d378e7339f9ea74a25f918563bf0d3 ]
Separate the declaration of struct bh1750_chip_info from definition
of bh1750_chip_info_tbl[] in a single statement as it makes the code
hard to read, and with the extra newline it makes it look as if the
bh1750_chip_info_tbl[] had no explicit type.
This change also resolves the following compiler warning about the
unusual position of the static keyword that can be seen when building
with warnings enabled (W=1):
drivers/iio/light/bh1750.c:64:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
Related to commit 3a11fbb037a1 ("iio: light: add support for ROHM
BH1710/BH1715/BH1721/BH1750/BH1751 ambient light sensors").
Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/iio/light/bh1750.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c index a814828e69f5..5f5d54ce882b 100644 --- a/drivers/iio/light/bh1750.c +++ b/drivers/iio/light/bh1750.c @@ -62,9 +62,9 @@ struct bh1750_chip_info { u16 int_time_low_mask; u16 int_time_high_mask; -} +}; -static const bh1750_chip_info_tbl[] = { +static const struct bh1750_chip_info bh1750_chip_info_tbl[] = { [BH1710] = { 140, 1022, 300, 400, 250000000, 2, 0x001F, 0x03E0 }, [BH1721] = { 140, 1020, 300, 400, 250000000, 2, 0x0010, 0x03E0 }, [BH1750] = { 31, 254, 69, 1740, 57500000, 1, 0x001F, 0x00E0 }, |