leds: Move static keyword to the front of declarations
PATCH 1/1 leds: Move static keyword to the front of declarations
Move the static keyword to the front of declarations.
In drivers/leds/leds-lm3532.c for ramp_table, als_avrg_table and als_imp_table, and in drivers/leds/leds-lm3532.c for ramp_table.
This will resolve the following compiler warnings that can be seen when building with warnings enabled (W=1):
drivers/leds/leds-lm3532.c:209:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:266:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:281:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-ti-lmu-common.c:14:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
---
Related: https://lore.kernel.org/r/[email protected]
drivers/leds/leds-lm3532.c | 6 +++--- drivers/leds/leds-ti-lmu-common.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/leds/leds-lm3532.c +3 -3
@@ -208,7 +208,7 @@ static const struct regmap_config lm3532_regmap_config = { .cache_type = REGCACHE_FLAT, }; -const static int als_imp_table[LM3532_NUM_IMP_VALS ] = {37000 ,18500 ,12330 , +static const int als_imp_table[LM3532_NUM_IMP_VALS ] = {37000 ,18500 ,12330 ,92500 ,7400 ,6170 ,5290 ,4630 ,4110 ,3700 ,3360 ,3080 ,2850 ,2640 ,2440 ,
@@ -265,7 +265,7 @@ static int lm3532_get_index(const int table[], int size, int value)return -EINVAL ; } -const static int als_avrg_table[LM3532_NUM_AVG_VALS ] = {17920 ,35840 ,71680 , +static const int als_avrg_table[LM3532_NUM_AVG_VALS ] = {17920 ,35840 ,71680 ,1433360 ,286720 ,573440 ,1146880 ,2293760 };static int lm3532_get_als_avg_index (int avg_time)
@@ -280,7 +280,7 @@ static int lm3532_get_als_avg_index(int avg_time) avg_time); } -const static int ramp_table[LM3532_NUM_RAMP_VALS ] = {8 ,1024 ,2048 ,4096 ,8192 , +static const int ramp_table[LM3532_NUM_RAMP_VALS ] = {8 ,1024 ,2048 ,4096 ,8192 ,16384 ,32768 ,65536 };static int lm3532_get_ramp_index (int ramp_time) {
drivers/leds/leds-ti-lmu-common.c +1 -1
@@ -11,7 +11,7 @@#include <linux/leds-ti-lmu-common.h> -const static unsigned int ramp_table[16 ] = {2048 ,262000 ,524000 ,1049000 , +static const unsigned int ramp_table[16 ] = {2048 ,262000 ,524000 ,1049000 ,2090000 ,4194000 ,8389000 ,16780000 ,33550000 ,41940000 ,50330000 ,58720000 ,67110000 ,83880000 ,100660000 ,117440000 };
Signature · 1 line
2.22.1
Krzystof
Thanks for the patch
Quoted 21 lines · Krzysztof Wilczynski
Move the static keyword to the front of declarations.
In
drivers/leds/leds-lm3532.cforramp_table,als_avrg_tableandals_imp_table, and indrivers/leds/leds-lm3532.cforramp_table.This will resolve the following compiler warnings that can be seen when building with warnings enabled (W=1):
drivers/leds/leds-lm3532.c:209:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:266:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:281:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-ti-lmu-common.c:14:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
Quoted 6 lines
Signed-off-by Krzysztof Wilczynski <[email protected]>---
Related: https://lore.kernel.org/r/[email protected]drivers/leds/leds-lm3532.c | 6 +++--- drivers/leds/leds-ti-lmu-common.c | 2 +-
This file is missing in the subject.
Maybe break it out into a separate patch since they do not have dependencies on each other.
Dan
Hello Dan,
Thank you for feedback.
[...]
Quoted 3 lines
This file is missing in the subject.
Maybe break it out into a separate patch since they do not have dependencies on each other.
Will do. Sorry about that. I initially had these as separate patches, but after looking at who the maintainer is and thought that it perhaps makes sense to send as a single patch. Good point.
Krzysztof
PATCH v2 1/2 leds: lm3532: Move static keyword to the front of declarations
In reply to Krzysztof WilczynskiMove the static keyword to the front of declarations ramp_table, als_avrg_table and als_imp_table, and resolve the following compiler warnings that can be seen when building with warnings enabled (W=1):
drivers/leds/leds-lm3532.c:209:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:266:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:281:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
---
Related: https://lore.kernel.org/r/[email protected]
drivers/leds/leds-lm3532.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/leds/leds-lm3532.c +3 -3
@@ -208,7 +208,7 @@ static const struct regmap_config lm3532_regmap_config = { .cache_type = REGCACHE_FLAT, }; -const static int als_imp_table[LM3532_NUM_IMP_VALS ] = {37000 ,18500 ,12330 , +static const int als_imp_table[LM3532_NUM_IMP_VALS ] = {37000 ,18500 ,12330 ,92500 ,7400 ,6170 ,5290 ,4630 ,4110 ,3700 ,3360 ,3080 ,2850 ,2640 ,2440 ,
@@ -265,7 +265,7 @@ static int lm3532_get_index(const int table[], int size, int value)return -EINVAL ; } -const static int als_avrg_table[LM3532_NUM_AVG_VALS ] = {17920 ,35840 ,71680 , +static const int als_avrg_table[LM3532_NUM_AVG_VALS ] = {17920 ,35840 ,71680 ,1433360 ,286720 ,573440 ,1146880 ,2293760 };static int lm3532_get_als_avg_index (int avg_time)
@@ -280,7 +280,7 @@ static int lm3532_get_als_avg_index(int avg_time) avg_time); } -const static int ramp_table[LM3532_NUM_RAMP_VALS ] = {8 ,1024 ,2048 ,4096 ,8192 , +static const int ramp_table[LM3532_NUM_RAMP_VALS ] = {8 ,1024 ,2048 ,4096 ,8192 ,16384 ,32768 ,65536 };static int lm3532_get_ramp_index (int ramp_time) {
Signature · 1 line
2.22.1
PATCH v2 2/2 leds: ti-lmu-common: Move static keyword to the front of declaration
Move the static keyword to the front of declaration of ramp_table, and resolve the following compiler warning that can be seen when building with warnings enabled (W=1):
drivers/leds/leds-ti-lmu-common.c:14:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
---
Related: https://lore.kernel.org/r/[email protected]
drivers/leds/leds-ti-lmu-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-ti-lmu-common.c +1 -1
@@ -11,7 +11,7 @@#include <linux/leds-ti-lmu-common.h> -const static unsigned int ramp_table[16 ] = {2048 ,262000 ,524000 ,1049000 , +static const unsigned int ramp_table[16 ] = {2048 ,262000 ,524000 ,1049000 ,2090000 ,4194000 ,8389000 ,16780000 ,33550000 ,41940000 ,50330000 ,58720000 ,67110000 ,83880000 ,100660000 ,117440000 };
Signature · 1 line
2.22.1
Re: [PATCH v2 1/2] leds: lm3532: Move static keyword to the front of declarations
In reply to Krzysztof WilczynskiHi Krzysztof,
Thank you for the patch set.
Quoted 45 lines · Krzysztof Wilczynski
Move the static keyword to the front of declarations
ramp_table,als_avrg_tableandals_imp_table, and resolve the following compiler warnings that can be seen when building with warnings enabled (W=1):
drivers/leds/leds-lm3532.c:209:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:266:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]
drivers/leds/leds-lm3532.c:281:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]Signed-off-by Krzysztof Wilczynski <[email protected]>---
Related: https://lore.kernel.org/r/[email protected]drivers/leds/leds-lm3532.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/leds/leds-lm3532.c +2
-2@@ -208,7 +208,7 @@ static const struct regmap_config lm3532_regmap_config = { .cache_type = REGCACHE_FLAT, }; -const static int als_imp_table[LM3532_NUM_IMP_VALS ] = {37000 ,18500 ,12330 , +static const int als_imp_table[LM3532_NUM_IMP_VALS ] = {37000 ,18500 ,12330 ,92500 ,7400 ,6170 ,5290 ,4630 ,4110 ,3700 ,3360 ,3080 ,2850 ,2640 ,2440 ,@@ -265,7 +265,7 @@ static int lm3532_get_index(const int table[], int size, int value)return -EINVAL ; } -const static int als_avrg_table[LM3532_NUM_AVG_VALS ] = {17920 ,35840 ,71680 , +static const int als_avrg_table[LM3532_NUM_AVG_VALS ] = {17920 ,35840 ,71680 ,1433360 ,286720 ,573440 ,1146880 ,2293760 };static int lm3532_get_als_avg_index (int avg_time)
drivers/leds/leds-lm3532.c static int lm3532_get_als_avg_index(int avg_time) · line 286
Quoted 8 lines
drivers/leds/leds-lm3532.c +1
-1@@ -280,7 +280,7 @@ static int lm3532_get_als_avg_index(int avg_time) avg_time); } -const static int ramp_table[LM3532_NUM_RAMP_VALS ] = {8 ,1024 ,2048 ,4096 ,8192 , +static const int ramp_table[LM3532_NUM_RAMP_VALS ] = {8 ,1024 ,2048 ,4096 ,8192 ,16384 ,32768 ,65536 };static int lm3532_get_ramp_index (int ramp_time) {
Both 1/2 and 2/2 applied.
Signature · 2 lines
Best regards, Jacek Anaszewski