All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ttyprintk: remove redundant initialization of variable i
@ 2021-05-18 18:21 Colin King
  2021-05-21 12:40 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Colin King @ 2021-05-18 18:21 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman; +Cc: kernel-janitors, linux-kernel

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

The variable i is being initialized with a value that is never read,
it is being updated later on.  The assignment is redundant and can be
removed.

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

diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
index 219fa1382396..230b2c9b3e3c 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -52,7 +52,7 @@ static void tpk_flush(void)
 
 static int tpk_printk(const unsigned char *buf, int count)
 {
-	int i = tpk_curr;
+	int i;
 
 	for (i = 0; i < count; i++) {
 		if (tpk_curr >= TPK_STR_SIZE) {
-- 
2.31.1


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

* Re: [PATCH][next] ttyprintk: remove redundant initialization of variable i
  2021-05-18 18:21 [PATCH][next] ttyprintk: remove redundant initialization of variable i Colin King
@ 2021-05-21 12:40 ` Greg Kroah-Hartman
  2021-05-25  8:54   ` Colin Ian King
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-21 12:40 UTC (permalink / raw)
  To: Colin King; +Cc: Arnd Bergmann, kernel-janitors, linux-kernel

On Tue, May 18, 2021 at 07:21:26PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable i is being initialized with a value that is never read,
> it is being updated later on.  The assignment is redundant and can be
> removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/char/ttyprintk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
> index 219fa1382396..230b2c9b3e3c 100644
> --- a/drivers/char/ttyprintk.c
> +++ b/drivers/char/ttyprintk.c
> @@ -52,7 +52,7 @@ static void tpk_flush(void)
>  
>  static int tpk_printk(const unsigned char *buf, int count)
>  {
> -	int i = tpk_curr;
> +	int i;
>  
>  	for (i = 0; i < count; i++) {
>  		if (tpk_curr >= TPK_STR_SIZE) {
> -- 
> 2.31.1
> 

This is not ok for what is currently in linux-next :(

greg k-h

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

* Re: [PATCH][next] ttyprintk: remove redundant initialization of variable i
  2021-05-21 12:40 ` Greg Kroah-Hartman
@ 2021-05-25  8:54   ` Colin Ian King
  2021-05-27 12:20     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Ian King @ 2021-05-25  8:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Arnd Bergmann, kernel-janitors, linux-kernel

On 21/05/2021 13:40, Greg Kroah-Hartman wrote:
> On Tue, May 18, 2021 at 07:21:26PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The variable i is being initialized with a value that is never read,
>> it is being updated later on.  The assignment is redundant and can be
>> removed.
>>
>> Addresses-Coverity: ("Unused value")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  drivers/char/ttyprintk.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
>> index 219fa1382396..230b2c9b3e3c 100644
>> --- a/drivers/char/ttyprintk.c
>> +++ b/drivers/char/ttyprintk.c
>> @@ -52,7 +52,7 @@ static void tpk_flush(void)
>>  
>>  static int tpk_printk(const unsigned char *buf, int count)
>>  {
>> -	int i = tpk_curr;
>> +	int i;
>>  
>>  	for (i = 0; i < count; i++) {
>>  		if (tpk_curr >= TPK_STR_SIZE) {
>> -- 
>> 2.31.1
>>
> 
> This is not ok for what is currently in linux-next :(

Hmm, it applies cleanly on today's linux-next, do you mind re-apply it?


> 
> greg k-h
> 


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

* Re: [PATCH][next] ttyprintk: remove redundant initialization of variable i
  2021-05-25  8:54   ` Colin Ian King
@ 2021-05-27 12:20     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-27 12:20 UTC (permalink / raw)
  To: Colin Ian King; +Cc: Arnd Bergmann, kernel-janitors, linux-kernel

On Tue, May 25, 2021 at 09:54:37AM +0100, Colin Ian King wrote:
> On 21/05/2021 13:40, Greg Kroah-Hartman wrote:
> > On Tue, May 18, 2021 at 07:21:26PM +0100, Colin King wrote:
> >> From: Colin Ian King <colin.king@canonical.com>
> >>
> >> The variable i is being initialized with a value that is never read,
> >> it is being updated later on.  The assignment is redundant and can be
> >> removed.
> >>
> >> Addresses-Coverity: ("Unused value")
> >> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> >> ---
> >>  drivers/char/ttyprintk.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
> >> index 219fa1382396..230b2c9b3e3c 100644
> >> --- a/drivers/char/ttyprintk.c
> >> +++ b/drivers/char/ttyprintk.c
> >> @@ -52,7 +52,7 @@ static void tpk_flush(void)
> >>  
> >>  static int tpk_printk(const unsigned char *buf, int count)
> >>  {
> >> -	int i = tpk_curr;
> >> +	int i;
> >>  
> >>  	for (i = 0; i < count; i++) {
> >>  		if (tpk_curr >= TPK_STR_SIZE) {
> >> -- 
> >> 2.31.1
> >>
> > 
> > This is not ok for what is currently in linux-next :(
> 
> Hmm, it applies cleanly on today's linux-next, do you mind re-apply it?

Argh, I was looking at the wrong tree, sorry, now queued up.

thanks,

greg "I have too many different trees" k-h

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

end of thread, other threads:[~2021-05-27 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 18:21 [PATCH][next] ttyprintk: remove redundant initialization of variable i Colin King
2021-05-21 12:40 ` Greg Kroah-Hartman
2021-05-25  8:54   ` Colin Ian King
2021-05-27 12:20     ` Greg Kroah-Hartman

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.