From: Colin Ian King Date: Sun, 7 May 2017 18:05:16 +0000 (+0100) Subject: ipmi_ssif: remove redundant null check on array client->adapter->name X-Git-Tag: v4.14-rc1~507^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf10ff69dd6e27710b21863ebd8e6504d9516222;p=platform%2Fkernel%2Flinux-rpi.git ipmi_ssif: remove redundant null check on array client->adapter->name The null check on client->adapter->name is redundant as name is an array of I2C_NAME_SIZE chars and hence can never be null. We may as well remove this redundant check. Detected by CoverityScan, CID#1375918 ("Array compared against 0") Signed-off-by: Colin Ian King Signed-off-by: Corey Minyard --- diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 6dd6476..1d4fd84 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1419,8 +1419,7 @@ static int find_slave_address(struct i2c_client *client, int slave_addr) list_for_each_entry(info, &ssif_infos, link) { if (info->binfo.addr != client->addr) continue; - if (info->adapter_name && client->adapter->name && - strcmp_nospace(info->adapter_name, + if (info->adapter_name && strcmp_nospace(info->adapter_name, client->adapter->name)) continue; if (info->slave_addr) {