Skip to content

Commit

Permalink
usb: gadget: f_uac2: remove redundant assignments to pointer i_feature
Browse files Browse the repository at this point in the history
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.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20210804125907.111654-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Colin Ian King authored and Greg Kroah-Hartman committed Aug 5, 2021
1 parent e21dd90 commit 59e477a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/usb/gadget/function/f_uac2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 59e477a

Please sign in to comment.