]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: core: Remove unused code from scsi_sysfs.c
authorBart Van Assche <bvanassche@acm.org>
Fri, 31 Oct 2025 22:08:56 +0000 (15:08 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 3 Nov 2025 02:54:40 +0000 (21:54 -0500)
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>
drivers/scsi/scsi_sysfs.c

index 15ba493d2138685d4d31a983ef5b687384ff2a80..2cbbba192b246c3135ac20b6572a4322b23bf460 100644 (file)
@@ -605,68 +605,6 @@ sdev_show_##field (struct device *dev, struct device_attribute *attr,      \
        sdev_show_function(field, format_string)                        \
 static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL);
 
-
-/*
- * sdev_rw_attr: create a function and attribute variable for a
- * read/write field.
- */
-#define sdev_rw_attr(field, format_string)                             \
-       sdev_show_function(field, format_string)                                \
-                                                                       \
-static ssize_t                                                         \
-sdev_store_##field (struct device *dev, struct device_attribute *attr, \
-                   const char *buf, size_t count)                      \
-{                                                                      \
-       struct scsi_device *sdev;                                       \
-       sdev = to_scsi_device(dev);                                     \
-       sscanf (buf, format_string, &sdev->field);                      \
-       return count;                                                   \
-}                                                                      \
-static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field);
-
-/* Currently we don't export bit fields, but we might in future,
- * so leave this code in */
-#if 0
-/*
- * sdev_rd_attr: create a function and attribute variable for a
- * read/write bit field.
- */
-#define sdev_rw_attr_bit(field)                                                \
-       sdev_show_function(field, "%d\n")                                       \
-                                                                       \
-static ssize_t                                                         \
-sdev_store_##field (struct device *dev, struct device_attribute *attr, \
-                   const char *buf, size_t count)                      \
-{                                                                      \
-       int ret;                                                        \
-       struct scsi_device *sdev;                                       \
-       ret = scsi_sdev_check_buf_bit(buf);                             \
-       if (ret >= 0)   {                                               \
-               sdev = to_scsi_device(dev);                             \
-               sdev->field = ret;                                      \
-               ret = count;                                            \
-       }                                                               \
-       return ret;                                                     \
-}                                                                      \
-static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field);
-
-/*
- * scsi_sdev_check_buf_bit: return 0 if buf is "0", return 1 if buf is "1",
- * else return -EINVAL.
- */
-static int scsi_sdev_check_buf_bit(const char *buf)
-{
-       if ((buf[1] == '\0') || ((buf[1] == '\n') && (buf[2] == '\0'))) {
-               if (buf[0] == '1')
-                       return 1;
-               else if (buf[0] == '0')
-                       return 0;
-               else
-                       return -EINVAL;
-       } else
-               return -EINVAL;
-}
-#endif
 /*
  * Create the actual show/store functions and data structures.
  */