diff options
author | Colin Ian King <colin.i.king@gmail.com> | 2024-11-07 14:33:48 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-10 11:06:40 +0100 |
commit | 7f72d17359e5916eb1abb416c7ac57f7eeb8aa51 (patch) | |
tree | c40bb172641e5d4c2091d34b7936e9470fa20e98 /drivers/usb/gadget | |
parent | usb: typec: ucsi: Convert connector specific commands to bitmaps (diff) | |
download | linux-7f72d17359e5916eb1abb416c7ac57f7eeb8aa51.tar.xz linux-7f72d17359e5916eb1abb416c7ac57f7eeb8aa51.zip |
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 <colin.i.king@gmail.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
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 <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_midi2.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index 8285df9ed6fd..ee3d9e3578f7 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; |