linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sctp: remove redundant initialization of variable status
@ 2020-07-24 12:17 Colin King
  2020-07-24 12:55 ` Marcelo Ricardo Leitner
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2020-07-24 12:17 UTC (permalink / raw)
  To: Vlad Yasevich, Neil Horman, Marcelo Ricardo Leitner,
	David S . Miller, Jakub Kicinski, linux-sctp, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable status is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/sctp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 7ecaf7d575c0..a0448f7c64b9 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1368,7 +1368,7 @@ static struct pernet_operations sctp_ctrlsock_ops = {
 static __init int sctp_init(void)
 {
 	int i;
-	int status = -EINVAL;
+	int status;
 	unsigned long goal;
 	unsigned long limit;
 	unsigned long nr_pages = totalram_pages();
-- 
2.27.0

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

* Re: [PATCH] sctp: remove redundant initialization of variable status
  2020-07-24 12:17 [PATCH] sctp: remove redundant initialization of variable status Colin King
@ 2020-07-24 12:55 ` Marcelo Ricardo Leitner
  2020-07-24 12:56   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2020-07-24 12:55 UTC (permalink / raw)
  To: Colin King
  Cc: Vlad Yasevich, Neil Horman, David S . Miller, Jakub Kicinski,
	linux-sctp, netdev, kernel-janitors, linux-kernel

On Fri, Jul 24, 2020 at 01:17:53PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable status is being initialized with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Are you willing to send another to patch to fix the var ordering in
reverse christmass tree in there?

> ---
>  net/sctp/protocol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 7ecaf7d575c0..a0448f7c64b9 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1368,7 +1368,7 @@ static struct pernet_operations sctp_ctrlsock_ops = {
>  static __init int sctp_init(void)
>  {
>  	int i;
> -	int status = -EINVAL;
> +	int status;
>  	unsigned long goal;
>  	unsigned long limit;
>  	unsigned long nr_pages = totalram_pages();
> -- 
> 2.27.0
> 

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

* Re: [PATCH] sctp: remove redundant initialization of variable status
  2020-07-24 12:55 ` Marcelo Ricardo Leitner
@ 2020-07-24 12:56   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2020-07-24 12:56 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner
  Cc: Vlad Yasevich, Neil Horman, David S . Miller, Jakub Kicinski,
	linux-sctp, netdev, kernel-janitors, linux-kernel

On 24/07/2020 13:55, Marcelo Ricardo Leitner wrote:
> On Fri, Jul 24, 2020 at 01:17:53PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The variable status is being initialized with a value that is never read
>> and it is being updated later with a new value.  The initialization is
>> redundant and can be removed.
>>
>> Addresses-Coverity: ("Unused value")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> 
> Are you willing to send another to patch to fix the var ordering in
> reverse christmass tree in there?

Sure, I'll send a V2 to re-order the vars.

> 
>> ---
>>  net/sctp/protocol.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
>> index 7ecaf7d575c0..a0448f7c64b9 100644
>> --- a/net/sctp/protocol.c
>> +++ b/net/sctp/protocol.c
>> @@ -1368,7 +1368,7 @@ static struct pernet_operations sctp_ctrlsock_ops = {
>>  static __init int sctp_init(void)
>>  {
>>  	int i;
>> -	int status = -EINVAL;
>> +	int status;
>>  	unsigned long goal;
>>  	unsigned long limit;
>>  	unsigned long nr_pages = totalram_pages();
>> -- 
>> 2.27.0
>>

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

end of thread, other threads:[~2020-07-24 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 12:17 [PATCH] sctp: remove redundant initialization of variable status Colin King
2020-07-24 12:55 ` Marcelo Ricardo Leitner
2020-07-24 12:56   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).