mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Shaokun Zhang <zhangshaokun@hisilicon.com>, linux-kernel@vger.kernel.org
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alexander.shishkin@linux.intel.com
Subject: Re: [RESEND PATCH] intel_th: msu: Fix unused variable warning on arm64 platform
Date: Mon, 20 May 2019 12:39:21 +0300	[thread overview]
Message-ID: <87woilwjli.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <1558333597-63774-1-git-send-email-zhangshaokun@hisilicon.com>

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

#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  9:39 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 [this message]
2019-05-20 10:53   ` Zhangshaokun

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=87woilwjli.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhangshaokun@hisilicon.com \
    /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®