summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_devinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_devinfo.c')
-rw-r--r--drivers/scsi/scsi_devinfo.c56
1 files changed, 15 insertions, 41 deletions
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index ba7237e83863..a348df895dca 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -39,13 +39,12 @@ static LIST_HEAD(scsi_dev_info_list);
static char scsi_dev_flags[256];
/*
- * scsi_static_device_list: deprecated list of devices that require
- * settings that differ from the default, includes black-listed (broken)
- * devices. The entries here are added to the tail of scsi_dev_info_list
- * via scsi_dev_info_list_init.
+ * scsi_static_device_list: list of devices that require settings that differ
+ * from the default, includes black-listed (broken) devices. The entries here
+ * are added to the tail of scsi_dev_info_list via scsi_dev_info_list_init.
*
- * Do not add to this list, use the command line or proc interface to add
- * to the scsi_dev_info_list. This table will eventually go away.
+ * If possible, set the BLIST_* flags from inside a SCSI LLD rather than
+ * adding an entry to this list.
*/
static struct {
char *vendor;
@@ -293,14 +292,16 @@ static void scsi_strcpy_devinfo(char *name, char *to, size_t to_length,
size_t from_length;
from_length = strlen(from);
- /* This zero-pads the destination */
- strncpy(to, from, to_length);
- if (from_length < to_length && !compatible) {
- /*
- * space pad the string if it is short.
- */
- memset(&to[from_length], ' ', to_length - from_length);
- }
+
+ /*
+ * null pad and null terminate if compatible
+ * otherwise space pad
+ */
+ if (compatible)
+ strscpy_pad(to, from, to_length);
+ else
+ memcpy_and_pad(to, to_length, from, from_length, ' ');
+
if (from_length > to_length)
printk(KERN_WARNING "%s: %s string '%s' is too long\n",
__func__, name, from);
@@ -485,33 +486,6 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
}
/**
- * scsi_dev_info_list_del_keyed - remove one dev_info list entry.
- * @vendor: vendor string
- * @model: model (product) string
- * @key: specify list to use
- *
- * Description:
- * Remove and destroy one dev_info entry for @vendor, @model
- * in list specified by @key.
- *
- * Returns: 0 OK, -error on failure.
- **/
-int scsi_dev_info_list_del_keyed(char *vendor, char *model,
- enum scsi_devinfo_key key)
-{
- struct scsi_dev_info_list *found;
-
- found = scsi_dev_info_list_find(vendor, model, key);
- if (IS_ERR(found))
- return PTR_ERR(found);
-
- list_del(&found->dev_info_list);
- kfree(found);
- return 0;
-}
-EXPORT_SYMBOL(scsi_dev_info_list_del_keyed);
-
-/**
* scsi_dev_info_list_add_str - parse dev_list and add to the scsi_dev_info_list.
* @dev_list: string of device flags to add
*