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.

scsi: core: Remove unused code from scsi_sysfs.c

Remove unused code since we do not keep unused code in the Linux kernel.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251031220857.2917954-1-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
61deab8a 480ca795

-62
-62
drivers/scsi/scsi_sysfs.c
··· 605 605 sdev_show_function(field, format_string) \ 606 606 static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL); 607 607 608 - 609 - /* 610 - * sdev_rw_attr: create a function and attribute variable for a 611 - * read/write field. 612 - */ 613 - #define sdev_rw_attr(field, format_string) \ 614 - sdev_show_function(field, format_string) \ 615 - \ 616 - static ssize_t \ 617 - sdev_store_##field (struct device *dev, struct device_attribute *attr, \ 618 - const char *buf, size_t count) \ 619 - { \ 620 - struct scsi_device *sdev; \ 621 - sdev = to_scsi_device(dev); \ 622 - sscanf (buf, format_string, &sdev->field); \ 623 - return count; \ 624 - } \ 625 - static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field); 626 - 627 - /* Currently we don't export bit fields, but we might in future, 628 - * so leave this code in */ 629 - #if 0 630 - /* 631 - * sdev_rd_attr: create a function and attribute variable for a 632 - * read/write bit field. 633 - */ 634 - #define sdev_rw_attr_bit(field) \ 635 - sdev_show_function(field, "%d\n") \ 636 - \ 637 - static ssize_t \ 638 - sdev_store_##field (struct device *dev, struct device_attribute *attr, \ 639 - const char *buf, size_t count) \ 640 - { \ 641 - int ret; \ 642 - struct scsi_device *sdev; \ 643 - ret = scsi_sdev_check_buf_bit(buf); \ 644 - if (ret >= 0) { \ 645 - sdev = to_scsi_device(dev); \ 646 - sdev->field = ret; \ 647 - ret = count; \ 648 - } \ 649 - return ret; \ 650 - } \ 651 - static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field); 652 - 653 - /* 654 - * scsi_sdev_check_buf_bit: return 0 if buf is "0", return 1 if buf is "1", 655 - * else return -EINVAL. 656 - */ 657 - static int scsi_sdev_check_buf_bit(const char *buf) 658 - { 659 - if ((buf[1] == '\0') || ((buf[1] == '\n') && (buf[2] == '\0'))) { 660 - if (buf[0] == '1') 661 - return 1; 662 - else if (buf[0] == '0') 663 - return 0; 664 - else 665 - return -EINVAL; 666 - } else 667 - return -EINVAL; 668 - } 669 - #endif 670 608 /* 671 609 * Create the actual show/store functions and data structures. 672 610 */