On Thu, 2018-11-29 at 02:01 +0100, David Disseldorp wrote:
> +static ssize_t target_wwn_vendor_id_show(struct config_item *item,
> +             char *page)
> +{
> +     return sprintf(page, "%s\n", &to_t10_wwn(item)->vendor[0]);
> +}

The "&" and "[0]" are superfluous in the above sprintf() statement.

> +static ssize_t target_wwn_vendor_id_store(struct config_item *item,
> +             const char *page, size_t count)
> +{
> +     struct t10_wwn *t10_wwn = to_t10_wwn(item);
> +     struct se_device *dev = t10_wwn->t10_dev;
> +     unsigned char buf[INQUIRY_VENDOR_LEN + 1];
> +
> +     if (strlen(page) > INQUIRY_VENDOR_LEN) {
> +             pr_err("Emulated T10 Vendor Identification exceeds"
> +                     " INQUIRY_VENDOR_LEN: " __stringify(INQUIRY_VENDOR_LEN)
> +                     "\n");
> +             return -EOVERFLOW;
> +     }

Does this force users to use "echo -n" to configure vendor IDs that are
INQUIRY_VENDOR_LEN bytes long?

Bart.

Reply via email to