summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Scally <dan.scally@ideasonboard.com>2023-02-09 10:43:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-09 12:12:47 +0100
commit8488a831e0c4d59528d20713a14cb8958af15bfe (patch)
treebb621a2b2a3d9f1c43b0d7d9e6cc0037e9329efe /drivers
parentMerge tag 'thunderbolt-for-v6.3-rc1' of git://git.kernel.org/pub/scm/linux/ke... (diff)
downloadlinux-8488a831e0c4d59528d20713a14cb8958af15bfe.tar.xz
linux-8488a831e0c4d59528d20713a14cb8958af15bfe.zip
usb: gadget: configfs: Fix set but not used variable warning
Fix a -Wunused-but-set-variable warning in gadget_string_s_store() Fixes: 15a7cf8caabe ("usb: gadget: configfs: Support arbitrary string descriptors") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Link: https://lore.kernel.org/r/20230209094359.1549629-1-dan.scally@ideasonboard.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/configfs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 06a0b73e0546..b9f1136aa0a2 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -821,13 +821,11 @@ static ssize_t gadget_string_s_store(struct config_item *item, const char *page,
{
struct gadget_string *string = to_gadget_string(item);
int size = min(sizeof(string->string), len + 1);
- int ret;
if (len > USB_MAX_STRING_LEN)
return -EINVAL;
- ret = strscpy(string->string, page, size);
- return len;
+ return strscpy(string->string, page, size);
}
CONFIGFS_ATTR(gadget_string_, s);