linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Ross Zwisler <zwisler@kernel.org>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH] nfit: Hide unused functions behind CONFIG_X86
Date: Mon,  7 Jan 2019 21:58:53 -0700	[thread overview]
Message-ID: <20190108045853.5471-1-natechancellor@gmail.com> (raw)

On arm64 little endian allyesconfig:

drivers/acpi/nfit/intel.c:149:12: warning: unused function 'intel_security_unlock' [-Wunused-function]
static int intel_security_unlock(struct nvdimm *nvdimm,
           ^
drivers/acpi/nfit/intel.c:230:12: warning: unused function 'intel_security_erase' [-Wunused-function]
static int intel_security_erase(struct nvdimm *nvdimm,
           ^
drivers/acpi/nfit/intel.c:279:12: warning: unused function 'intel_security_query_overwrite' [-Wunused-function]
static int intel_security_query_overwrite(struct nvdimm *nvdimm)
           ^
drivers/acpi/nfit/intel.c:316:12: warning: unused function 'intel_security_overwrite' [-Wunused-function]
static int intel_security_overwrite(struct nvdimm *nvdimm,
           ^
4 warnings generated.

These functions are only used in __intel_security_ops when CONFIG_X86 is
set so only define these functions under that same condition.

Fixes: 4c6926a23b76 ("acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/acpi/nfit/intel.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/nfit/intel.c b/drivers/acpi/nfit/intel.c
index 850b2927b4e7..2ba0f1543940 100644
--- a/drivers/acpi/nfit/intel.c
+++ b/drivers/acpi/nfit/intel.c
@@ -144,6 +144,7 @@ static int intel_security_change_key(struct nvdimm *nvdimm,
 	}
 }
 
+#ifdef CONFIG_X86
 static void nvdimm_invalidate_cache(void);
 
 static int intel_security_unlock(struct nvdimm *nvdimm,
@@ -186,6 +187,7 @@ static int intel_security_unlock(struct nvdimm *nvdimm,
 
 	return 0;
 }
+#endif
 
 static int intel_security_disable(struct nvdimm *nvdimm,
 		const struct nvdimm_key_data *key_data)
@@ -227,6 +229,7 @@ static int intel_security_disable(struct nvdimm *nvdimm,
 	return 0;
 }
 
+#ifdef CONFIG_X86
 static int intel_security_erase(struct nvdimm *nvdimm,
 		const struct nvdimm_key_data *key,
 		enum nvdimm_passphrase_type ptype)
@@ -360,16 +363,10 @@ static int intel_security_overwrite(struct nvdimm *nvdimm,
  * TODO: define a cross arch wbinvd equivalent when/if
  * NVDIMM_FAMILY_INTEL command support arrives on another arch.
  */
-#ifdef CONFIG_X86
 static void nvdimm_invalidate_cache(void)
 {
 	wbinvd_on_all_cpus();
 }
-#else
-static void nvdimm_invalidate_cache(void)
-{
-	WARN_ON_ONCE("cache invalidation required after unlock\n");
-}
 #endif
 
 static const struct nvdimm_security_ops __intel_security_ops = {
-- 
2.20.1


             reply	other threads:[~2019-01-08  4:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08  4:58 Nathan Chancellor [this message]
2019-01-08  5:14 ` [PATCH] nfit: Hide unused functions behind CONFIG_X86 Dan Williams
2019-01-08  5:18   ` Nathan Chancellor
2019-01-09  5:00 ` [PATCH v2] nfit: Mark some functions as __maybe_unused Nathan Chancellor
2019-01-09  6:22   ` Dan Williams

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=20190108045853.5471-1-natechancellor@gmail.com \
    --to=natechancellor@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rjw@rjwysocki.net \
    --cc=vishal.l.verma@intel.com \
    --cc=zwisler@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;
as well as URLs for NNTP newsgroup(s).