mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-16 02:14:58 +00:00
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>
This commit is contained in:
parent
760bda91cb
commit
1e4aa3e18d
@ -412,7 +412,7 @@ nct6683_create_attr_group(struct device *dev,
|
||||
struct sensor_device_attr_u *su;
|
||||
struct attribute_group *group;
|
||||
struct attribute **attrs;
|
||||
int i, j, count;
|
||||
int i, count;
|
||||
|
||||
if (repeat <= 0)
|
||||
return ERR_PTR(-EINVAL);
|
||||
@ -443,7 +443,7 @@ nct6683_create_attr_group(struct device *dev,
|
||||
|
||||
for (i = 0; i < repeat; i++) {
|
||||
t = tg->templates;
|
||||
for (j = 0; *t != NULL; j++) {
|
||||
while (*t) {
|
||||
snprintf(su->name, sizeof(su->name),
|
||||
(*t)->dev_attr.attr.name, tg->base + i);
|
||||
if ((*t)->s2) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user