hwmon: (f71882fg) Secure chip property
PATCH 1/3 hwmon: (f71882fg) Secure chip property
Using C99-style array initialization will ensure definitions won't drift if the chips enum gets new values added.
--- drivers/hwmon/f71882fg.c | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/hwmon/f71882fg.c +24 -24
@@ -120,36 +120,36 @@ static const char *f71882fg_names[] = { };static const char f71882fg_has_in[8 ][F71882FG_MAX_INS ] = { - {1 ,1 ,1 ,1 ,1 ,1 ,0 ,1 ,1 },/* f71808e */ - {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 },/* f71858fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71862fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71869 */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71882fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71889fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71889ed */ - {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 },/* f8000 */ + [f71808e] = {1 ,1 ,1 ,1 ,1 ,1 ,0 ,1 ,1 }, + [f71858fg] = {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 }, + [f71862fg] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71869] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71882fg] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71889fg] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71889ed] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f8000] = {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 }, };static const char f71882fg_has_in1_alarm[8 ] = { -0 ,/* f71808e */ -0 ,/* f71858fg */ -0 ,/* f71862fg */ -0 ,/* f71869 */ -1 ,/* f71882fg */ -1 ,/* f71889fg */ -1 ,/* f71889ed */ -0 ,/* f8000 */ + [f71808e] =0 , + [f71858fg] =0 , + [f71862fg] =0 , + [f71869] =0 , + [f71882fg] =1 , + [f71889fg] =1 , + [f71889ed] =1 , + [f8000] =0 , };static const char f71882fg_has_beep[8 ] = { -0 ,/* f71808e */ -0 ,/* f71858fg */ -1 ,/* f71862fg */ -1 ,/* f71869 */ -1 ,/* f71882fg */ -1 ,/* f71889fg */ -1 ,/* f71889ed */ -0 ,/* f8000 */ + [f71808e] =0 , + [f71858fg] =0 , + [f71862fg] =1 , + [f71869] =1 , + [f71882fg] =1 , + [f71889fg] =1 , + [f71889ed] =1 , + [f8000] =0 , };static struct platform_device *f71882fg_pdev;
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Jean Delvare
Using C99-style array initialization will ensure definitions won't drift if the chips enum gets new values added.
Signed-off-by Jean Delvare <[email protected]>Cc Hans de Goede <[email protected]>
Excellent idea.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi,
I like.
Regards,
Hans
Quoted 64 lines · Jean Delvare
Using C99-style array initialization will ensure definitions won't drift if the chips enum gets new values added.
Signed-off-by Jean Delvare<[email protected]>Cc Hans de Goede<[email protected]>--- drivers/hwmon/f71882fg.c | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-)drivers/hwmon/f71882fg.c +17
-24@@ -120,36 +120,36 @@ static const char *f71882fg_names[] = { };static const char f71882fg_has_in[8 ][F71882FG_MAX_INS ] = { - {1 ,1 ,1 ,1 ,1 ,1 ,0 ,1 ,1 },/* f71808e */ - {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 },/* f71858fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71862fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71869 */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71882fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71889fg */ - {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },/* f71889ed */ - {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 },/* f8000 */ + [f71808e] = {1 ,1 ,1 ,1 ,1 ,1 ,0 ,1 ,1 }, + [f71858fg] = {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 }, + [f71862fg] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71869] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71882fg] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71889fg] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f71889ed] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 }, + [f8000] = {1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 }, };static const char f71882fg_has_in1_alarm[8 ] = { -0 ,/* f71808e */ -0 ,/* f71858fg */ -0 ,/* f71862fg */ -0 ,/* f71869 */ -1 ,/* f71882fg */ -1 ,/* f71889fg */ -1 ,/* f71889ed */ -0 ,/* f8000 */ + [f71808e] =0 , + [f71858fg] =0 , + [f71862fg] =0 , + [f71869] =0 , + [f71882fg] =1 , + [f71889fg] =1 , + [f71889ed] =1 , + [f8000] =0 , };static const char f71882fg_has_beep[8 ] = { -0 ,/* f71808e */ -0 ,/* f71858fg */ -1 ,/* f71862fg */ -1 ,/* f71869 */ -1 ,/* f71882fg */ -1 ,/* f71889fg */ -1 ,/* f71889ed */ -0 ,/* f8000 */ + [f71808e] =0 ,
drivers/hwmon/f71882fg.c static const char *f71882fg_names[] = { · line 155
Quoted 10 lines
drivers/hwmon/f71882fg.c +7
-0+ [f71858fg] = 0, + [f71862fg] = 1, + [f71869] = 1, + [f71882fg] = 1, + [f71889fg] = 1, + [f71889ed] = 1, + [f8000] = 0, };static struct platform_device *f71882fg_pdev;
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors