From: Colin Ian King Date: Thu, 7 Nov 2024 13:33:48 +0000 (+0000) Subject: usb: gadget: function: remove redundant else statement X-Git-Tag: v6.13-rc1~31^2~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f72d17359e5916eb1abb416c7ac57f7eeb8aa51;p=thirdparty%2Fkernel%2Flinux.git usb: gadget: function: remove redundant else statement After an initial range change on the insigned int alt being > 1 the only possible values for alt are 0 or 1. Therefore the else statement for values other than 0 or 1 is redundant and can be removed. Replace the else if (all == 1) check with just an else. Signed-off-by: Colin Ian King Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/5f54ffd0-b5fe-4203-a626-c166becad362@gmail.com Link: https://lore.kernel.org/r/20241107133348.22762-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index 8285df9ed6fd7..ee3d9e3578f79 100644 --- a/drivers/usb/gadget/function/f_midi2.c +++ b/drivers/usb/gadget/function/f_midi2.c @@ -1285,10 +1285,8 @@ static int f_midi2_set_alt(struct usb_function *fn, unsigned int intf, if (alt == 0) op_mode = MIDI_OP_MODE_MIDI1; - else if (alt == 1) - op_mode = MIDI_OP_MODE_MIDI2; else - op_mode = MIDI_OP_MODE_UNSET; + op_mode = MIDI_OP_MODE_MIDI2; if (midi2->operation_mode == op_mode) return 0;