All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipmi_ssif: remove redundant null check on array client->adapter->name
@ 2017-05-07 18:05 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-05-07 18:05 UTC (permalink / raw)
  To: Corey Minyard, openipmi-developer; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.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@canonical.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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ipmi_ssif: remove redundant null check on array client->adapter->name
@ 2017-05-07 18:05 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-05-07 18:05 UTC (permalink / raw)
  To: Corey Minyard, openipmi-developer; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.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@canonical.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipmi_ssif: remove redundant null check on array client->adapter->name
  2017-05-07 18:05 ` Colin King
@ 2017-05-08 15:18   ` Corey Minyard
  -1 siblings, 0 replies; 4+ messages in thread
From: Corey Minyard @ 2017-05-08 15:18 UTC (permalink / raw)
  To: Colin King, openipmi-developer; +Cc: kernel-janitors, linux-kernel

On 05/07/2017 01:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.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.
Thanks Colin,

Queued for next merge window.

-corey
> Detected by CoverityScan, CID#1375918 ("Array compared against 0")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.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) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipmi_ssif: remove redundant null check on array client->adapter->name
@ 2017-05-08 15:18   ` Corey Minyard
  0 siblings, 0 replies; 4+ messages in thread
From: Corey Minyard @ 2017-05-08 15:18 UTC (permalink / raw)
  To: Colin King, openipmi-developer; +Cc: kernel-janitors, linux-kernel

On 05/07/2017 01:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.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.
Thanks Colin,

Queued for next merge window.

-corey
> Detected by CoverityScan, CID#1375918 ("Array compared against 0")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.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) {



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-08 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07 18:05 [PATCH] ipmi_ssif: remove redundant null check on array client->adapter->name Colin King
2017-05-07 18:05 ` Colin King
2017-05-08 15:18 ` Corey Minyard
2017-05-08 15:18   ` Corey Minyard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.