[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210804125907.111654-1-colin.king@canonical.com>
Date: Wed, 4 Aug 2021 13:59:07 +0100
From: Colin King <colin.king@...onical.com>
To: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ruslan Bilovol <ruslan.bilovol@...il.com>,
linux-usb@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] usb: gadget: f_uac2: remove redundant assignments to pointer i_feature
From: Colin Ian King <colin.king@...onical.com>
Pointer i_feature is being initialized with a value and then immediately
re-assigned a new value in the next statement. Fix this by replacing the
the redundant initialization with the following assigned value.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/usb/gadget/function/f_uac2.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index b9edc6787f79..3c34995276e7 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -970,17 +970,13 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
std_as_in_if1_desc.iInterface = us[STR_AS_IN_ALT1].id;
if (FUOUT_EN(uac2_opts)) {
- u8 *i_feature = (u8 *)out_feature_unit_desc;
-
- i_feature = (u8 *)out_feature_unit_desc +
- out_feature_unit_desc->bLength - 1;
+ u8 *i_feature = (u8 *)out_feature_unit_desc +
+ out_feature_unit_desc->bLength - 1;
*i_feature = us[STR_FU_OUT].id;
}
if (FUIN_EN(uac2_opts)) {
- u8 *i_feature = (u8 *)in_feature_unit_desc;
-
- i_feature = (u8 *)in_feature_unit_desc +
- in_feature_unit_desc->bLength - 1;
+ u8 *i_feature = (u8 *)in_feature_unit_desc +
+ in_feature_unit_desc->bLength - 1;
*i_feature = us[STR_FU_IN].id;
}
--
2.31.1
Powered by blists - more mailing lists