All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
@ 2017-10-27 20:19 Gustavo A. R. Silva
  2017-10-28 17:15   ` Moritz Fischer
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-27 20:19 UTC (permalink / raw)
  To: Alan Tull, Moritz Fischer; +Cc: linux-fpga, linux-kernel, Gustavo A. R. Silva

Notice that bridge = to_fpga_bridge(dev); expands to:

bridge = container_of(dev, struct fpga_bridge, dev);

and container_of is never null, so this null check is
unnecessary.

Addresses-Coverity-ID: 1397912
Reported-by: Alan Tull <atull@kernel.org>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/fpga/fpga-bridge.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index 9651aa5..409d1ac 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
 		goto err_dev;
 
 	bridge = to_fpga_bridge(dev);
-	if (!bridge)
-		goto err_dev;
 
 	bridge->info = info;
 
-- 
2.7.4

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

* Re: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
  2017-10-27 20:19 [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get Gustavo A. R. Silva
@ 2017-10-28 17:15   ` Moritz Fischer
  0 siblings, 0 replies; 6+ messages in thread
From: Moritz Fischer @ 2017-10-28 17:14 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Alan Tull, Moritz Fischer, linux-fpga, linux-kernel

On Fri, Oct 27, 2017 at 08:19:51PM +0000, Gustavo A. R. Silva wrote:
> Notice that bridge = to_fpga_bridge(dev); expands to:
> 
> bridge = container_of(dev, struct fpga_bridge, dev);
> 
> and container_of is never null, so this null check is
> unnecessary.
> 
> Addresses-Coverity-ID: 1397912
> Reported-by: Alan Tull <atull@kernel.org>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
> ---
>  drivers/fpga/fpga-bridge.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
> index 9651aa5..409d1ac 100644
> --- a/drivers/fpga/fpga-bridge.c
> +++ b/drivers/fpga/fpga-bridge.c
> @@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
>  		goto err_dev;
>  
>  	bridge = to_fpga_bridge(dev);
> -	if (!bridge)
> -		goto err_dev;
>  
>  	bridge->info = info;
>  
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks for the fix,

Moritz

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

* Re: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
@ 2017-10-28 17:15   ` Moritz Fischer
  0 siblings, 0 replies; 6+ messages in thread
From: Moritz Fischer @ 2017-10-28 17:15 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Alan Tull, Moritz Fischer, linux-fpga, linux-kernel

On Fri, Oct 27, 2017 at 08:19:51PM +0000, Gustavo A. R. Silva wrote:
> Notice that bridge = to_fpga_bridge(dev); expands to:
> 
> bridge = container_of(dev, struct fpga_bridge, dev);
> 
> and container_of is never null, so this null check is
> unnecessary.
> 
> Addresses-Coverity-ID: 1397912
> Reported-by: Alan Tull <atull@kernel.org>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
> ---
>  drivers/fpga/fpga-bridge.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
> index 9651aa5..409d1ac 100644
> --- a/drivers/fpga/fpga-bridge.c
> +++ b/drivers/fpga/fpga-bridge.c
> @@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
>  		goto err_dev;
>  
>  	bridge = to_fpga_bridge(dev);
> -	if (!bridge)
> -		goto err_dev;
>  
>  	bridge->info = info;
>  
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks for the fix,

Moritz

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

* Re: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
  2017-10-28 17:15   ` Moritz Fischer
  (?)
@ 2017-10-29  0:25   ` Gustavo A. R. Silva
  -1 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-29  0:25 UTC (permalink / raw)
  To: Moritz Fischer; +Cc: Alan Tull, linux-fpga, linux-kernel

Hi Moritz,

Quoting Moritz Fischer <mdf@kernel.org>:

> On Fri, Oct 27, 2017 at 08:19:51PM +0000, Gustavo A. R. Silva wrote:
>> Notice that bridge = to_fpga_bridge(dev); expands to:
>>
>> bridge = container_of(dev, struct fpga_bridge, dev);
>>
>> and container_of is never null, so this null check is
>> unnecessary.
>>
>> Addresses-Coverity-ID: 1397912
>> Reported-by: Alan Tull <atull@kernel.org>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> Reviewed-by: Moritz Fischer <mdf@kernel.org>
>> ---
>>  drivers/fpga/fpga-bridge.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
>> index 9651aa5..409d1ac 100644
>> --- a/drivers/fpga/fpga-bridge.c
>> +++ b/drivers/fpga/fpga-bridge.c
>> @@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct  
>> device_node *np,
>>  		goto err_dev;
>>
>>  	bridge = to_fpga_bridge(dev);
>> -	if (!bridge)
>> -		goto err_dev;
>>
>>  	bridge->info = info;
>>
>> --
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Thanks for the fix,
>

Glad to help.

Thanks
--
Gustavo A. R. Silva

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

* Re: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
  2017-10-28 17:15   ` Moritz Fischer
  (?)
  (?)
@ 2017-10-30 20:34   ` Alan Tull
  2017-10-30 22:20     ` Gustavo A. R. Silva
  -1 siblings, 1 reply; 6+ messages in thread
From: Alan Tull @ 2017-10-30 20:34 UTC (permalink / raw)
  To: Moritz Fischer; +Cc: Gustavo A. R. Silva, linux-fpga, linux-kernel

On Sat, Oct 28, 2017 at 12:15 PM, Moritz Fischer <mdf@kernel.org> wrote:

Hi Gustavo,

Thanks!

Alan

> On Fri, Oct 27, 2017 at 08:19:51PM +0000, Gustavo A. R. Silva wrote:
>> Notice that bridge = to_fpga_bridge(dev); expands to:
>>
>> bridge = container_of(dev, struct fpga_bridge, dev);
>>
>> and container_of is never null, so this null check is
>> unnecessary.
>>
>> Addresses-Coverity-ID: 1397912
>> Reported-by: Alan Tull <atull@kernel.org>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> Reviewed-by: Moritz Fischer <mdf@kernel.org>

Signed-off-by: Alan Tull <atull@kernel.org>

>> ---
>>  drivers/fpga/fpga-bridge.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
>> index 9651aa5..409d1ac 100644
>> --- a/drivers/fpga/fpga-bridge.c
>> +++ b/drivers/fpga/fpga-bridge.c
>> @@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
>>               goto err_dev;
>>
>>       bridge = to_fpga_bridge(dev);
>> -     if (!bridge)
>> -             goto err_dev;
>>
>>       bridge->info = info;
>>
>> --
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Thanks for the fix,
>
> Moritz

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

* Re: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
  2017-10-30 20:34   ` Alan Tull
@ 2017-10-30 22:20     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-30 22:20 UTC (permalink / raw)
  To: Alan Tull; +Cc: Moritz Fischer, linux-fpga, linux-kernel

Hi Alan,

Quoting Alan Tull <atull@kernel.org>:

> On Sat, Oct 28, 2017 at 12:15 PM, Moritz Fischer <mdf@kernel.org> wrote:
>
> Hi Gustavo,
>
> Thanks!
>

Glad to help. :)

Thanks
--
Gustavo A. R. Silva

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

end of thread, other threads:[~2017-10-30 22:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-27 20:19 [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get Gustavo A. R. Silva
2017-10-28 17:14 ` Moritz Fischer
2017-10-28 17:15   ` Moritz Fischer
2017-10-29  0:25   ` Gustavo A. R. Silva
2017-10-30 20:34   ` Alan Tull
2017-10-30 22:20     ` Gustavo A. R. Silva

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.