ALSA: usb-audio: Don't store returned value and check for errors
Subsystems (2)
PATCH 1/1 ALSA: usb-audio: Don't store returned value and check for errors
The returned value by create_autodetect_quirk isn't being used other than in the success check on next line. Remove the return value assignement. Check for error values instead of success check.
--- sound/usb/quirks.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/usb/quirks.c +3 -3
@@ -425,9 +425,9 @@ static int create_autodetect_quirks(struct snd_usb_audio *chip, USB_CLASS_VENDOR_SPEC)continue ; - err =create_autodetect_quirk (chip, iface, driver); -if (err >=0 ) -usb_driver_claim_interface (driver, iface, (void *)-1L ); +if (create_autodetect_quirk (chip, iface, driver) <0 ) +continue ; +usb_driver_claim_interface (driver, iface, (void *)-1L ); }return 0 ;
Signature · 1 line
2.25.1
Quoted 15 lines · Muhammad Usama Anjum
The returned value by
create_autodetect_quirkisn't being used other than in the success check on next line. Remove the return value assignement. Check for error values instead of success check.Signed-off-by Muhammad Usama Anjum <[email protected]>--- sound/usb/quirks.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)sound/usb/quirks.c +0
-0
sound/usb/quirks.c static int create_autodetect_quirks(struct snd_usb_audio *chip, · line 430
Quoted 9 lines
sound/usb/quirks.c +3
-3@@ -425,9 +425,9 @@ static int create_autodetect_quirks(struct snd_usb_audio *chip, USB_CLASS_VENDOR_SPEC)continue ; - err =create_autodetect_quirk (chip, iface, driver); -if (err >=0 ) -usb_driver_claim_interface (driver, iface, (void *)-1L ); +if (create_autodetect_quirk (chip, iface, driver) <0 ) +continue ; +usb_driver_claim_interface (driver, iface, (void *)-1L );
Hm, basically this change is only for readability (the code optimization makes almost no sense), and the readability itself isn't improved significantly by this change, either.
That is, I'm fine to take this, but OTOH, I see no compelling reason to do so...
thanks,
Takashi