Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon patches from Guenter Roeck:
"Fix build warnings in four drivers"

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (pmbus_core) Fix compiler warning
hwmon: (smsc47m1) Fix compiler warning
hwmon: (acpi_power_meter) Fix compiler warning seen in some configurations
hwmon: (smsc47b397) Fix compiler warning

+27 -24
+1
drivers/hwmon/acpi_power_meter.c
··· 391 391 break; 392 392 default: 393 393 BUG(); 394 + val = ""; 394 395 } 395 396 396 397 return sprintf(buf, "%s\n", val);
+8 -9
drivers/hwmon/pmbus/pmbus_core.c
··· 710 710 * If a negative value is stored in any of the referenced registers, this value 711 711 * reflects an error code which will be returned. 712 712 */ 713 - static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val) 713 + static int pmbus_get_boolean(struct pmbus_data *data, int index) 714 714 { 715 715 u8 s1 = (index >> 24) & 0xff; 716 716 u8 s2 = (index >> 16) & 0xff; 717 717 u8 reg = (index >> 8) & 0xff; 718 718 u8 mask = index & 0xff; 719 - int status; 719 + int ret, status; 720 720 u8 regval; 721 721 722 722 status = data->status[reg]; ··· 725 725 726 726 regval = status & mask; 727 727 if (!s1 && !s2) 728 - *val = !!regval; 728 + ret = !!regval; 729 729 else { 730 730 long v1, v2; 731 731 struct pmbus_sensor *sensor1, *sensor2; ··· 739 739 740 740 v1 = pmbus_reg2data(data, sensor1); 741 741 v2 = pmbus_reg2data(data, sensor2); 742 - *val = !!(regval && v1 >= v2); 742 + ret = !!(regval && v1 >= v2); 743 743 } 744 - return 0; 744 + return ret; 745 745 } 746 746 747 747 static ssize_t pmbus_show_boolean(struct device *dev, ··· 750 750 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); 751 751 struct pmbus_data *data = pmbus_update_device(dev); 752 752 int val; 753 - int err; 754 753 755 - err = pmbus_get_boolean(data, attr->index, &val); 756 - if (err) 757 - return err; 754 + val = pmbus_get_boolean(data, attr->index); 755 + if (val < 0) 756 + return val; 758 757 return snprintf(buf, PAGE_SIZE, "%d\n", val); 759 758 } 760 759
+8 -6
drivers/hwmon/smsc47b397.c
··· 343 343 return err; 344 344 } 345 345 346 - static int __init smsc47b397_find(unsigned short *addr) 346 + static int __init smsc47b397_find(void) 347 347 { 348 348 u8 id, rev; 349 349 char *name; 350 + unsigned short addr; 350 351 351 352 superio_enter(); 352 353 id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID); ··· 371 370 rev = superio_inb(SUPERIO_REG_DEVREV); 372 371 373 372 superio_select(SUPERIO_REG_LD8); 374 - *addr = (superio_inb(SUPERIO_REG_BASE_MSB) << 8) 373 + addr = (superio_inb(SUPERIO_REG_BASE_MSB) << 8) 375 374 | superio_inb(SUPERIO_REG_BASE_LSB); 376 375 377 376 pr_info("found SMSC %s (base address 0x%04x, revision %u)\n", 378 - name, *addr, rev); 377 + name, addr, rev); 379 378 380 379 superio_exit(); 381 - return 0; 380 + return addr; 382 381 } 383 382 384 383 static int __init smsc47b397_init(void) ··· 386 385 unsigned short address; 387 386 int ret; 388 387 389 - ret = smsc47b397_find(&address); 390 - if (ret) 388 + ret = smsc47b397_find(); 389 + if (ret < 0) 391 390 return ret; 391 + address = ret; 392 392 393 393 ret = platform_driver_register(&smsc47b397_driver); 394 394 if (ret)
+10 -9
drivers/hwmon/smsc47m1.c
··· 491 491 .attrs = smsc47m1_attributes, 492 492 }; 493 493 494 - static int __init smsc47m1_find(unsigned short *addr, 495 - struct smsc47m1_sio_data *sio_data) 494 + static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data) 496 495 { 497 496 u8 val; 497 + unsigned short addr; 498 498 499 499 superio_enter(); 500 500 val = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID); ··· 546 546 } 547 547 548 548 superio_select(); 549 - *addr = (superio_inb(SUPERIO_REG_BASE) << 8) 549 + addr = (superio_inb(SUPERIO_REG_BASE) << 8) 550 550 | superio_inb(SUPERIO_REG_BASE + 1); 551 - if (*addr == 0) { 551 + if (addr == 0) { 552 552 pr_info("Device address not set, will not use\n"); 553 553 superio_exit(); 554 554 return -ENODEV; ··· 565 565 } 566 566 567 567 superio_exit(); 568 - return 0; 568 + return addr; 569 569 } 570 570 571 571 /* Restore device to its initial state */ ··· 938 938 unsigned short address; 939 939 struct smsc47m1_sio_data sio_data; 940 940 941 - if (smsc47m1_find(&address, &sio_data)) 942 - return -ENODEV; 941 + err = smsc47m1_find(&sio_data); 942 + if (err < 0) 943 + return err; 944 + address = err; 943 945 944 946 /* Sets global pdev as a side effect */ 945 947 err = smsc47m1_device_add(address, &sio_data); 946 948 if (err) 947 - goto exit; 949 + return err; 948 950 949 951 err = platform_driver_probe(&smsc47m1_driver, smsc47m1_probe); 950 952 if (err) ··· 957 955 exit_device: 958 956 platform_device_unregister(pdev); 959 957 smsc47m1_restore(&sio_data); 960 - exit: 961 958 return err; 962 959 } 963 960