Skip to content

Commit 1e4aa3e

Browse files
henryZegroeck
authored andcommitted
hwmon: (nct6683) remove unused variable in nct6683_create_attr_group
When enable 'unused-but-set-variable' compile warning option, it would raise warning as below: drivers/hwmon/nct6683.c:415:9: warning: variable 'j' set but not used [-Wunused-but-set-variable] Variable 'j' in nct6683_create_attr_group is unused, so remove it and simplify the 'for' loop. Signed-off-by: Zeng Heng <zengheng4@huawei.com> Link: https://lore.kernel.org/r/20220927114352.2498079-1-zengheng4@huawei.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 760bda9 commit 1e4aa3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hwmon/nct6683.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ nct6683_create_attr_group(struct device *dev,
412412
struct sensor_device_attr_u *su;
413413
struct attribute_group *group;
414414
struct attribute **attrs;
415-
int i, j, count;
415+
int i, count;
416416

417417
if (repeat <= 0)
418418
return ERR_PTR(-EINVAL);
@@ -443,7 +443,7 @@ nct6683_create_attr_group(struct device *dev,
443443

444444
for (i = 0; i < repeat; i++) {
445445
t = tg->templates;
446-
for (j = 0; *t != NULL; j++) {
446+
while (*t) {
447447
snprintf(su->name, sizeof(su->name),
448448
(*t)->dev_attr.attr.name, tg->base + i);
449449
if ((*t)->s2) {

0 commit comments

Comments
 (0)