greybus: fix pointless null check
authorAlex Elder <elder@linaro.org>
Tue, 24 May 2016 18:34:50 +0000 (13:34 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 27 May 2016 18:28:16 +0000 (11:28 -0700)
Coccinelle points out that a call in gb_lights_channel_free() to
flush_work() is passed which is always non-null.   Prior to the
call, there is an unnecessary check to see if that address is null.
Get rid of the test.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/light.c

index 8b71ed3..78fb8a9 100644 (file)
@@ -1019,8 +1019,7 @@ static int gb_lights_light_register(struct gb_light *light)
 static void gb_lights_channel_free(struct gb_channel *channel)
 {
 #ifndef LED_HAVE_SET_BLOCKING
-       if (&channel->work_brightness_set)
-               flush_work(&channel->work_brightness_set);
+       flush_work(&channel->work_brightness_set);
 #endif
        kfree(channel->attrs);
        kfree(channel->attr_group);