usb: gadget: f_mass_storage: Rework do_request_sense slightly
When building with clang, it notes that sdinfo may be unused
uninitialized in some cases. This appears to be true from reading the
code, and we can simply set the variable to zero to start with and be as
correct as before.
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 45f0504..f46829e 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -1117,7 +1117,7 @@
{
struct fsg_lun *curlun = &common->luns[common->lun];
u8 *buf = (u8 *) bh->buf;
- u32 sd, sdinfo;
+ u32 sd, sdinfo = 0;
int valid;
/*
@@ -1145,7 +1145,6 @@
if (!curlun) { /* Unsupported LUNs are okay */
common->bad_lun_okay = 1;
sd = SS_LOGICAL_UNIT_NOT_SUPPORTED;
- sdinfo = 0;
valid = 0;
} else {
sd = curlun->sense_data;