mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhangshaokun <zhangshaokun@hisilicon.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	<linux-kernel@vger.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RESEND PATCH] intel_th: msu: Fix unused variable warning on arm64 platform
Date: Mon, 20 May 2019 18:53:15 +0800	[thread overview]
Message-ID: <46480fe3-8639-c6a3-4acf-e7db2a6157b5@hisilicon.com> (raw)
In-Reply-To: <87woilwjli.fsf@ashishki-desk.ger.corp.intel.com>

Hi Alex,

On 2019/5/20 17:39, Alexander Shishkin wrote:
> Shaokun Zhang <zhangshaokun@hisilicon.com> writes:
> 
>> drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_alloc’:
>> drivers/hwtracing/intel_th/msu.c:783:21: warning: unused variable ‘i’ [-Wunused-variable]
>>   int ret = -ENOMEM, i;
>>                      ^
>> drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_free’:
>> drivers/hwtracing/intel_th/msu.c:863:6: warning: unused variable ‘i’ [-Wunused-variable]
>>   int i;
>>       ^
>> Fix this compiler warning on arm64 platform.
> 
> Thank you for taking care of this.
> 
>> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
>> ---
>>  drivers/hwtracing/intel_th/msu.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
>> index 81bb54fa3ce8..833a5a8f13ad 100644
>> --- a/drivers/hwtracing/intel_th/msu.c
>> +++ b/drivers/hwtracing/intel_th/msu.c
>> @@ -780,7 +780,10 @@ static int __msc_buffer_win_alloc(struct msc_window *win,
>>  static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks)
>>  {
>>  	struct msc_window *win;
>> -	int ret = -ENOMEM, i;
>> +	int ret = -ENOMEM;
>> +#ifdef CONFIG_X86
>> +	int i;
>> +#endif
> 
> Can you factor it out into its own function? And one for the other
> memory type? So we can maybe keep it to just one #ifdef like
> 

Got it, I will update it in next version soon.

Thanks,
Shaokun

> #ifdef CONFIG_X86
> void msc_buffer_set_uc()
> { ... }
> void msc_buffer_set_wb()
> { ... }
> #else /* !X86 */
> static void msc_buffer_set_uc() {}
> static void msc_buffer_set_wb() {}
> #endif
> 
> Thanks,
> --
> Alex
> 
> .
> 


      reply	other threads:[~2019-05-20 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20  6:26 Shaokun Zhang
2019-05-20  9:39 ` Alexander Shishkin
2019-05-20 10:53   ` Zhangshaokun [this message]

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=46480fe3-8639-c6a3-4acf-e7db2a6157b5@hisilicon.com \
    --to=zhangshaokun@hisilicon.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=gregkh@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®