All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Justin P. Mattock" <justinmattock@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, davem@davemloft.net,
	jkosina@suse.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]crypto:hifn_795x.c Fix warning: variable 'ctx' set but not used
Date: Tue, 06 Jul 2010 06:46:49 -0700	[thread overview]
Message-ID: <4C3333C9.8000206@gmail.com> (raw)
In-Reply-To: <20100706070355.GA14626@gondor.apana.org.au>

On 07/06/2010 12:03 AM, Herbert Xu wrote:
> Justin P. Mattock<justinmattock@gmail.com>  wrote:
>> The below fixes a warning message generated by GCC
>>   CC [M]  drivers/crypto/hifn_795x.o
>> drivers/crypto/hifn_795x.c: In function 'hifn_flush':
>> drivers/crypto/hifn_795x.c:2021:23: warning: variable 'ctx' set but not used
>> drivers/crypto/hifn_795x.c: In function 'hifn_process_queue':
>> drivers/crypto/hifn_795x.c:2142:23: warning: variable 'ctx' set but not used
>>
>> Please have a look, and let me know if this is legit or not.
>>
>> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>>
>> ---
>> drivers/crypto/hifn_795x.c |   10 ++++++++++
>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
>> index 16fce3a..e7aa4dc 100644
>> --- a/drivers/crypto/hifn_795x.c
>> +++ b/drivers/crypto/hifn_795x.c
>> @@ -2036,6 +2036,11 @@ static void hifn_flush(struct hifn_device *dev)
>>         spin_lock_irqsave(&dev->lock, flags);
>>         while ((async_req = crypto_dequeue_request(&dev->queue))) {
>>                 ctx = crypto_tfm_ctx(async_req->tfm);
>> +                       if (ctx) {
>> +                               dprintk("%s: Flushing shash. %s\n",
>> +                               dev->name, ctx);
>> +                               return;
>> +                       }
>
> This certainly does not look right! Returning with IRQs disabled
> is considered to be rude.

Well, I certainly did not want to be rude..(searching for the right 
return etc.. when a function returns null gives not vary much results)

>
> I believe the right answer is to delete the line initialising ctx.
>
> Thanks,


o.k. then I'll resend with delete the line initialising ctx

Thanks for having a look..

Justin P. Mattock

WARNING: multiple messages have this Message-ID (diff)
From: "Justin P. Mattock" <justinmattock@gmail.com>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: linux-crypto@vger.kernel.org, davem@davemloft.net,
	jkosina@suse.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]crypto:hifn_795x.c Fix warning: variable 'ctx' set but not used
Date: Tue, 06 Jul 2010 06:46:49 -0700	[thread overview]
Message-ID: <4C3333C9.8000206@gmail.com> (raw)
In-Reply-To: <20100706070355.GA14626@gondor.apana.org.au>

On 07/06/2010 12:03 AM, Herbert Xu wrote:
> Justin P. Mattock<justinmattock@gmail.com>  wrote:
>> The below fixes a warning message generated by GCC
>>   CC [M]  drivers/crypto/hifn_795x.o
>> drivers/crypto/hifn_795x.c: In function 'hifn_flush':
>> drivers/crypto/hifn_795x.c:2021:23: warning: variable 'ctx' set but not used
>> drivers/crypto/hifn_795x.c: In function 'hifn_process_queue':
>> drivers/crypto/hifn_795x.c:2142:23: warning: variable 'ctx' set but not used
>>
>> Please have a look, and let me know if this is legit or not.
>>
>> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>>
>> ---
>> drivers/crypto/hifn_795x.c |   10 ++++++++++
>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
>> index 16fce3a..e7aa4dc 100644
>> --- a/drivers/crypto/hifn_795x.c
>> +++ b/drivers/crypto/hifn_795x.c
>> @@ -2036,6 +2036,11 @@ static void hifn_flush(struct hifn_device *dev)
>>         spin_lock_irqsave(&dev->lock, flags);
>>         while ((async_req = crypto_dequeue_request(&dev->queue))) {
>>                 ctx = crypto_tfm_ctx(async_req->tfm);
>> +                       if (ctx) {
>> +                               dprintk("%s: Flushing shash. %s\n",
>> +                               dev->name, ctx);
>> +                               return;
>> +                       }
>
> This certainly does not look right! Returning with IRQs disabled
> is considered to be rude.

Well, I certainly did not want to be rude..(searching for the right 
return etc.. when a function returns null gives not vary much results)

>
> I believe the right answer is to delete the line initialising ctx.
>
> Thanks,


o.k. then I'll resend with delete the line initialising ctx

Thanks for having a look..

Justin P. Mattock

  reply	other threads:[~2010-07-06 13:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06  6:26 [PATCH]crypto:hifn_795x.c Fix warning: variable 'ctx' set but not used Justin P. Mattock
2010-07-06  7:03 ` Herbert Xu
2010-07-06  7:03   ` Herbert Xu
2010-07-06 13:46   ` Justin P. Mattock [this message]
2010-07-06 13:46     ` Justin P. Mattock
2010-07-06 17:19   ` Justin P. Mattock
2010-07-06 17:19     ` Justin P. Mattock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C3333C9.8000206@gmail.com \
    --to=justinmattock@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jkosina@suse.cz \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.