Commit 7f72d173 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

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: default avatarColin Ian King <colin.i.king@gmail.com>
Reviewed-by: default avatarTakashi 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 226ff2e6
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;