• Jean Delvare's avatar
    [PATCH] I2C: Remove NULL client checks in rtc8564 driver · 14bef7a5
    Jean Delvare authored
    Several functions in your rtc8564 driver verify the non-NULLity of the
    i2c client that is passed to them. It doesn't seem to be necessary, as I
    can't think of any case where these functions could possibly be called
    with a NULL i2c client. As a matter of fact, I couldn't find any similar
    driver doing such checks.
    
    My attention was brought on this by Coverity's SWAT which correctly
    noticed that three of these functions contain explicit or hidden
    dereferences of the i2c client pointer *before* the NULL check. I guess
    it wasn't a problem because the NULL case cannot happen (unless I miss
    something), but this still is confusing code.
    
    Thus I propose the following changes:
    Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    14bef7a5
rtc8564.c 8.77 KB