cxl: Fix compile warning for cxl_security_ops extern
authorDave Jiang <dave.jiang@intel.com>
Mon, 22 Apr 2024 17:06:15 +0000 (10:06 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 30 Apr 2024 17:43:48 +0000 (10:43 -0700)
Jonathan reported he has observed compiler warning when using running with
W=1 C=1 for cxl_security_ops that is declared as an extern in cxl/pmem.c.
Move to cxl.h to make it visible to all cxl sources.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/linux-cxl/167771196186.3285982.18283746206612049722.stgit@djiang5-mobl3.local/
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/cxl.h
drivers/cxl/pmem.c

index 036d17db68e0068752277adf0e5b56c7b526e566..2a09db5f72eed7eb2874ee049dd406a9662bfc59 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/node.h>
 #include <linux/io.h>
 
+extern const struct nvdimm_security_ops *cxl_security_ops;
+
 /**
  * DOC: cxl objects
  *
index 7cb8994f88097599c7bd17f9adec6273b981e7a5..2ecdaee63021550b6ad0502444c62cf4a36b7b67 100644 (file)
@@ -11,8 +11,6 @@
 #include "cxlmem.h"
 #include "cxl.h"
 
-extern const struct nvdimm_security_ops *cxl_security_ops;
-
 static __read_mostly DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX);
 
 static void clear_exclusive(void *mds)