diff options
author | Lee Duncan <lduncan@suse.com> | 2020-01-28 15:19:29 -0800 |
---|---|---|
committer | Lee Duncan <lduncan@suse.com> | 2020-01-28 15:50:16 -0800 |
commit | c1270a591ce1ae162a2d58fb7fdbe9ef1b195c19 (patch) | |
tree | 47c3028e3029489476bf34dfeaee480e331e828d /usr/iscsi_sysfs.c | |
parent | e9c9117b7a84866366691110496984fc651e3e43 (diff) | |
download | open-iscsi-c1270a591ce1ae162a2d58fb7fdbe9ef1b195c19.tar.gz |
Enabled compiler checking options, fixed issues.
Enabled -Wextra and -Werror, then fixed all the issues found.
*Should* be no functional change.
Diffstat (limited to 'usr/iscsi_sysfs.c')
-rw-r--r-- | usr/iscsi_sysfs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c index 418f51b..435c576 100644 --- a/usr/iscsi_sysfs.c +++ b/usr/iscsi_sysfs.c @@ -1781,8 +1781,8 @@ struct iscsi_transport *iscsi_sysfs_get_transport_by_hba(uint32_t host_no) char id[NAME_SIZE]; int rc; - if (host_no == -1) - return NULL; + if (host_no > MAX_HOST_NO) + return NULL; /* not set? */ snprintf(id, sizeof(id), ISCSI_HOST_ID, host_no); rc = sysfs_get_str(id, SCSI_HOST_SUBSYS, "proc_name", name, @@ -1914,7 +1914,8 @@ void iscsi_sysfs_set_queue_depth(void *data, int hostno, int target, int lun) log_error("Could not queue depth for LUN %d err %d.", lun, err); } -void iscsi_sysfs_set_device_online(void *data, int hostno, int target, int lun) +void iscsi_sysfs_set_device_online(__attribute__((unused))void *data, + int hostno, int target, int lun) { char *write_buf = "running\n"; char id[NAME_SIZE]; @@ -1930,7 +1931,8 @@ void iscsi_sysfs_set_device_online(void *data, int hostno, int target, int lun) log_error("Could not online LUN %d err %d.", lun, err); } -void iscsi_sysfs_rescan_device(void *data, int hostno, int target, int lun) +void iscsi_sysfs_rescan_device(__attribute__((unused))void *data, + int hostno, int target, int lun) { char *write_buf = "1"; char id[NAME_SIZE]; |