Patchwork [v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

login
register
mail settings
Submitter srishti
Date Sept. 6, 2017, 9:13 p.m.
Message ID <1504732426-9765-1-git-send-email-srishtishar@gmail.com>
Download mbox | patch
Permalink /patch/9941321/
State Not Applicable
Delegated to: Herbert Xu
Headers show

Comments

srishti - Sept. 6, 2017, 9:13 p.m.
Remove local variable inflight_counter ,as it is never used.

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
---
Changes in v3:
 - There was no longer a need to make the comment more comprehensible as
   I have deleted the variable associated with it because it is unused .
 drivers/staging/ccree/ssi_cipher.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.7.4
Julia Lawall - Sept. 6, 2017, 9:17 p.m.
On Thu, 7 Sep 2017, Srishti Sharma wrote:

> Remove local variable inflight_counter ,as it is never used.

"counter ,as" -> "counter, as"

> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
> ---
> Changes in v3:
>  - There was no longer a need to make the comment more comprehensible as
>    I have deleted the variable associated with it because it is unused .
>  drivers/staging/ccree/ssi_cipher.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c
> index fec2faa..609ebe4 100644
> --- a/drivers/staging/ccree/ssi_cipher.c
> +++ b/drivers/staging/ccree/ssi_cipher.c
> @@ -702,10 +702,7 @@ static int ssi_blkcipher_complete(struct device *dev,
>
>  	ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
>
> -	/*
> -	 * Save inflight_counter in a local variable.
> -	 */
> -	inflight_counter =  ctx_p->drvdata->inflight_counter;
> +

This is a patch on your previous patch.  It should be a patch on the
original code.  Also, don't add a new blank line.  Just remove the line
completely.

julia

>  	/*Decrease the inflight counter*/
>  	if (ctx_p->flow_mode == BYPASS && ctx_p->drvdata->inflight_counter > 0)
>  		ctx_p->drvdata->inflight_counter--;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1504732426-9765-1-git-send-email-srishtishar%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
srishti - Sept. 6, 2017, 9:22 p.m.
On Thu, Sep 7, 2017 at 2:47 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Thu, 7 Sep 2017, Srishti Sharma wrote:
>
>> Remove local variable inflight_counter ,as it is never used.
>
> "counter ,as" -> "counter, as"
>
>> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
>> ---
>> Changes in v3:
>>  - There was no longer a need to make the comment more comprehensible as
>>    I have deleted the variable associated with it because it is unused .
>>  drivers/staging/ccree/ssi_cipher.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c
>> index fec2faa..609ebe4 100644
>> --- a/drivers/staging/ccree/ssi_cipher.c
>> +++ b/drivers/staging/ccree/ssi_cipher.c
>> @@ -702,10 +702,7 @@ static int ssi_blkcipher_complete(struct device *dev,
>>
>>       ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
>>
>> -     /*
>> -      * Save inflight_counter in a local variable.
>> -      */
>> -     inflight_counter =  ctx_p->drvdata->inflight_counter;
>> +
>
> This is a patch on your previous patch.  It should be a patch on the
> original code.  Also, don't add a new blank line.  Just remove the line
> completely.

  so , when I resend it should I version it as v3 or send as a new
patch as it is now fixing a different problem ?

 Regards,
 Srishti
>
> julia
>
>>       /*Decrease the inflight counter*/
>>       if (ctx_p->flow_mode == BYPASS && ctx_p->drvdata->inflight_counter > 0)
>>               ctx_p->drvdata->inflight_counter--;
>> --
>> 2.7.4
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1504732426-9765-1-git-send-email-srishtishar%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
Julia Lawall - Sept. 6, 2017, 9:26 p.m.
On Thu, 7 Sep 2017, Srishti Sharma wrote:

> On Thu, Sep 7, 2017 at 2:47 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Thu, 7 Sep 2017, Srishti Sharma wrote:
> >
> >> Remove local variable inflight_counter ,as it is never used.
> >
> > "counter ,as" -> "counter, as"
> >
> >> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
> >> ---
> >> Changes in v3:
> >>  - There was no longer a need to make the comment more comprehensible as
> >>    I have deleted the variable associated with it because it is unused .
> >>  drivers/staging/ccree/ssi_cipher.c | 5 +----
> >>  1 file changed, 1 insertion(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c
> >> index fec2faa..609ebe4 100644
> >> --- a/drivers/staging/ccree/ssi_cipher.c
> >> +++ b/drivers/staging/ccree/ssi_cipher.c
> >> @@ -702,10 +702,7 @@ static int ssi_blkcipher_complete(struct device *dev,
> >>
> >>       ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
> >>
> >> -     /*
> >> -      * Save inflight_counter in a local variable.
> >> -      */
> >> -     inflight_counter =  ctx_p->drvdata->inflight_counter;
> >> +
> >
> > This is a patch on your previous patch.  It should be a patch on the
> > original code.  Also, don't add a new blank line.  Just remove the line
> > completely.
>
>   so , when I resend it should I version it as v3 or send as a new
> patch as it is now fixing a different problem ?

v3 (or maybe now v4?) would be fine.  It's still the same code that is
under consideration.  Then it will be clear that he previosu patches are
not needed.

julia

>  Regards,
>  Srishti
> >
> > julia
> >
> >>       /*Decrease the inflight counter*/
> >>       if (ctx_p->flow_mode == BYPASS && ctx_p->drvdata->inflight_counter > 0)
> >>               ctx_p->drvdata->inflight_counter--;
> >> --
> >> 2.7.4
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1504732426-9765-1-git-send-email-srishtishar%40gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
srishti - Sept. 6, 2017, 9:27 p.m.
On Thu, Sep 7, 2017 at 2:56 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Thu, 7 Sep 2017, Srishti Sharma wrote:
>
>> On Thu, Sep 7, 2017 at 2:47 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> >
>> >
>> > On Thu, 7 Sep 2017, Srishti Sharma wrote:
>> >
>> >> Remove local variable inflight_counter ,as it is never used.
>> >
>> > "counter ,as" -> "counter, as"
>> >
>> >> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
>> >> ---
>> >> Changes in v3:
>> >>  - There was no longer a need to make the comment more comprehensible as
>> >>    I have deleted the variable associated with it because it is unused .
>> >>  drivers/staging/ccree/ssi_cipher.c | 5 +----
>> >>  1 file changed, 1 insertion(+), 4 deletions(-)
>> >>
>> >> diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c
>> >> index fec2faa..609ebe4 100644
>> >> --- a/drivers/staging/ccree/ssi_cipher.c
>> >> +++ b/drivers/staging/ccree/ssi_cipher.c
>> >> @@ -702,10 +702,7 @@ static int ssi_blkcipher_complete(struct device *dev,
>> >>
>> >>       ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
>> >>
>> >> -     /*
>> >> -      * Save inflight_counter in a local variable.
>> >> -      */
>> >> -     inflight_counter =  ctx_p->drvdata->inflight_counter;
>> >> +
>> >
>> > This is a patch on your previous patch.  It should be a patch on the
>> > original code.  Also, don't add a new blank line.  Just remove the line
>> > completely.
>>
>>   so , when I resend it should I version it as v3 or send as a new
>> patch as it is now fixing a different problem ?
>
> v3 (or maybe now v4?) would be fine.  It's still the same code that is
> under consideration.  Then it will be clear that he previosu patches are
> not needed.

 Okay , Thanks !
 Regards,
 Srishti
>
> julia
>
>>  Regards,
>>  Srishti
>> >
>> > julia
>> >
>> >>       /*Decrease the inflight counter*/
>> >>       if (ctx_p->flow_mode == BYPASS && ctx_p->drvdata->inflight_counter > 0)
>> >>               ctx_p->drvdata->inflight_counter--;
>> >> --
>> >> 2.7.4
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1504732426-9765-1-git-send-email-srishtishar%40gmail.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>
Dan Carpenter - Sept. 6, 2017, 9:32 p.m.
Always compile your patches.

  CC [M]  drivers/staging/ccree/ssi_cipher.o
drivers/staging/ccree/ssi_cipher.c: In function ‘ssi_blkcipher_complete’:
drivers/staging/ccree/ssi_cipher.c:700:6: warning: unused variable ‘inflight_counter’ [-Wunused-variable]
  u32 inflight_counter;
      ^~~~~~~~~~~~~~~~

You need to delete the declaration as well.

Don't be in a rush to resend patches.  I normally write them then let
them sit in my outbox overnight and send them in the morning.  The extra
delay helps me to calm down a bit and focus better.  Even though I've
sent thousands of patches, it sometimes still stresses me out.  It's
like you're disagreeing with the original author and the reviewers are
disagreeing with you and everyone's trying to be nice about it but
patches are fundamentally points of disagreement and that's stress.

regards,
dan carpenter
srishti - Sept. 6, 2017, 9:42 p.m.
On Thu, Sep 7, 2017 at 3:02 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Always compile your patches.
>
>   CC [M]  drivers/staging/ccree/ssi_cipher.o
> drivers/staging/ccree/ssi_cipher.c: In function ‘ssi_blkcipher_complete’:
> drivers/staging/ccree/ssi_cipher.c:700:6: warning: unused variable ‘inflight_counter’ [-Wunused-variable]
>   u32 inflight_counter;
>       ^~~~~~~~~~~~~~~~
>
> You need to delete the declaration as well.
>
> Don't be in a rush to resend patches.  I normally write them then let
> them sit in my outbox overnight and send them in the morning.  The extra
> delay helps me to calm down a bit and focus better.  Even though I've
> sent thousands of patches, it sometimes still stresses me out.  It's
> like you're disagreeing with the original author and the reviewers are
> disagreeing with you and everyone's trying to be nice about it but
> patches are fundamentally points of disagreement and that's stress.
>
> regards,
> dan carpenter
>
 Thanks , I'll be more careful !

 Regards,
 Srishti
Joe Perches - Sept. 7, 2017, 6:16 a.m.
On Thu, 2017-09-07 at 00:32 +0300, Dan Carpenter wrote:
> Always compile your patches.
> 
>   CC [M]  drivers/staging/ccree/ssi_cipher.o
> drivers/staging/ccree/ssi_cipher.c: In function ‘ssi_blkcipher_complete’:
> drivers/staging/ccree/ssi_cipher.c:700:6: warning: unused variable ‘inflight_counter’ [-Wunused-variable]
>   u32 inflight_counter;
>       ^~~~~~~~~~~~~~~~
> 
> You need to delete the declaration as well.
> 
> Don't be in a rush to resend patches.  I normally write them then let
> them sit in my outbox overnight and send them in the morning.  The extra
> delay helps me to calm down a bit and focus better.  Even though I've
> sent thousands of patches, it sometimes still stresses me out.  It's
> like you're disagreeing with the original author and the reviewers are
> disagreeing with you and everyone's trying to be nice about it but
> patches are fundamentally points of disagreement and that's stress.

True, and you shouldn't add a blank link either.
there's already one above the block you deleted.

Patch

diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c
index fec2faa..609ebe4 100644
--- a/drivers/staging/ccree/ssi_cipher.c
+++ b/drivers/staging/ccree/ssi_cipher.c
@@ -702,10 +702,7 @@  static int ssi_blkcipher_complete(struct device *dev,

 	ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);

-	/*
-	 * Save inflight_counter in a local variable.
-	 */
-	inflight_counter =  ctx_p->drvdata->inflight_counter;
+
 	/*Decrease the inflight counter*/
 	if (ctx_p->flow_mode == BYPASS && ctx_p->drvdata->inflight_counter > 0)
 		ctx_p->drvdata->inflight_counter--;