]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: line6: eliminate useless NULL checks
authorStefan Hajnoczi <stefanha@gmail.com>
Sat, 10 Dec 2011 01:12:30 +0000 (02:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 Dec 2011 03:26:09 +0000 (19:26 -0800)
The line6 driver checks struct field addresses for NULL where it does
not make sense to do so.  The struct has already been checked for NULL
and there is no value in checking the first field's address too.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/line6/pod.c
drivers/staging/line6/podhd.c
drivers/staging/line6/toneport.c
drivers/staging/line6/variax.c

index d9b30212585c6851c428a7c525976feb05e7b85d..4dadc571d9617c798835defdffd8977637658761 100644 (file)
@@ -1149,14 +1149,10 @@ static struct snd_kcontrol_new pod_control_monitor = {
 static void pod_destruct(struct usb_interface *interface)
 {
        struct usb_line6_pod *pod = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (pod == NULL)
                return;
-       line6 = &pod->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&pod->line6);
 
        del_timer(&pod->startup_timer);
        cancel_work_sync(&pod->startup_work);
index 6c0f7f21c2481f8861daf5948e95f78cccf2abcc..7ef45437b4f2392726ea7c7493495c049ce170f8 100644 (file)
@@ -80,14 +80,10 @@ static struct line6_pcm_properties podhd_pcm_properties = {
 static void podhd_destruct(struct usb_interface *interface)
 {
        struct usb_line6_podhd *podhd = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (podhd == NULL)
                return;
-       line6 = &podhd->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&podhd->line6);
 }
 
 /*
index 879e6992bbc6f8976c8fbea0c450db15428dda8e..f31057830dbc37769fc70cb982076369d0462feb 100644 (file)
@@ -295,14 +295,10 @@ static struct snd_kcontrol_new toneport_control_source = {
 static void toneport_destruct(struct usb_interface *interface)
 {
        struct usb_line6_toneport *toneport = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (toneport == NULL)
                return;
-       line6 = &toneport->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&toneport->line6);
 }
 
 /*
index 81241cdf1be97ec60888550c128f3827f23713a2..d36622228b2df7baf4e244dcd7fc889986324d45 100644 (file)
@@ -572,14 +572,10 @@ static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, variax_set_raw2);
 static void variax_destruct(struct usb_interface *interface)
 {
        struct usb_line6_variax *variax = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (variax == NULL)
                return;
-       line6 = &variax->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&variax->line6);
 
        del_timer(&variax->startup_timer1);
        del_timer(&variax->startup_timer2);