ALSA: line6: Remove CHECK_RETURN macro
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 15:08:02 +0000 (16:08 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 20 Jan 2015 07:18:27 +0000 (08:18 +0100)
Such a macro doesn't improve readability.

Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/line6/driver.h
sound/usb/line6/pod.c
sound/usb/line6/toneport.c

index 8e4d946a130c54b54ea5389a020a2967aad85bbe..f484aa09840be1ae82358d38e39e929361f33d28 100644 (file)
 
 #define LINE6_CHANNEL_MASK 0x0f
 
-#define CHECK_RETURN(x)                \
-do {                           \
-       err = x;                \
-       if (err < 0)            \
-               return err;     \
-} while (0)
-
 #define CHECK_STARTUP_PROGRESS(x, n)   \
 do {                                   \
        if ((x) >= (n))                 \
index 6b30deb6b15791aa6b743309a26f8705c4ffe610..6f4b0998258960787ea908caf2915c15d1f12d7e 100644 (file)
@@ -429,9 +429,15 @@ static int pod_create_files2(struct device *dev)
 {
        int err;
 
-       CHECK_RETURN(device_create_file(dev, &dev_attr_device_id));
-       CHECK_RETURN(device_create_file(dev, &dev_attr_firmware_version));
-       CHECK_RETURN(device_create_file(dev, &dev_attr_serial_number));
+       err = device_create_file(dev, &dev_attr_device_id);
+       if (err < 0)
+               return err;
+       err = device_create_file(dev, &dev_attr_firmware_version);
+       if (err < 0)
+               return err;
+       err = device_create_file(dev, &dev_attr_serial_number);
+       if (err < 0)
+               return err;
        return 0;
 }
 
index 3097a75a9bec82b0271b14dfb022477362f8418e..24544b7ab4765589187663ae14e35f1b28eac355 100644 (file)
@@ -431,10 +431,12 @@ static int toneport_init(struct usb_interface *interface,
        line6_read_data(line6, 0x80c2, &toneport->firmware_version, 1);
 
        if (toneport_has_led(toneport->type)) {
-               CHECK_RETURN(device_create_file
-                            (&interface->dev, &dev_attr_led_red));
-               CHECK_RETURN(device_create_file
-                            (&interface->dev, &dev_attr_led_green));
+               err = device_create_file(&interface->dev, &dev_attr_led_red);
+               if (err < 0)
+                       return err;
+               err = device_create_file(&interface->dev, &dev_attr_led_green);
+               if (err < 0)
+                       return err;
        }
 
        toneport_setup(toneport);