public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, Mike Travis <mike.travis@hpe.com>,
	Steve Wahl <steve.wahl@hpe.com>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Hedi Berriche <hedi.berriche@hpe.com>,
	Justin Ernst <justin.ernst@hpe.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Russ Anderson <russ.anderson@hpe.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/platform/uv: avoid unused variable warning
Date: Thu, 12 Dec 2019 06:54:32 -0800	[thread overview]
Message-ID: <20191212145432.GA15634@infradead.org> (raw)
In-Reply-To: <20191212135815.4176658-1-arnd@arndb.de>

Instead of that maybe_unused mess please just use good old ifdefs.

>  	if (hubless)
> -		proc_version_fops.open = proc_hubless_open;
> +		proc_create_single("hubless", 0, pde, proc_hubless_show);
>  	else
> -		proc_version_fops.open = proc_hubbed_open;
> +		proc_create_single("hubbed", 0, pde, proc_hubbed_show);
>  }

Or someone could figure out what happens if we turn the
proc_create_single stub into an inline function instead of the
define.  That makes it used at a syntactic level, the big question is
if the compiler is smart enough to optimize away the unused callback
still.

  parent reply	other threads:[~2019-12-12 14:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 13:58 [PATCH] x86/platform/uv: avoid unused variable warning Arnd Bergmann
2019-12-12 14:01 ` Arnd Bergmann
2019-12-12 14:54 ` Christoph Hellwig [this message]
2019-12-12 15:16   ` Mike Travis
  -- strict thread matches above, loose matches on Subject: below --
2019-12-12 14:03 Arnd Bergmann

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=20191212145432.GA15634@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=dimitri.sivanich@hpe.com \
    --cc=hedi.berriche@hpe.com \
    --cc=hpa@zytor.com \
    --cc=justin.ernst@hpe.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.travis@hpe.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=russ.anderson@hpe.com \
    --cc=steve.wahl@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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