[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170507180516.24887-1-colin.king@canonical.com>
Date: Sun, 7 May 2017 19:05:16 +0100
From: Colin King <colin.king@...onical.com>
To: Corey Minyard <minyard@....org>,
openipmi-developer@...ts.sourceforge.net
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ipmi_ssif: remove redundant null check on array client->adapter->name
From: Colin Ian King <colin.king@...onical.com>
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 <colin.king@...onical.com>
---
drivers/char/ipmi/ipmi_ssif.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 0b22a9be5029..d9243c5d2647 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1417,8 +1417,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) {
--
2.11.0
Powered by blists - more mailing lists