mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
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>
This commit is contained in:
parent
226ff2e681
commit
7f72d17359
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user