diff mbox series

[3.16-stable,34/87] ips: remove pointless #warning

Message ID 20170505194745.3627137-35-arnd@arndb.de
State New
Headers show
Series build warnings and errors | expand

Commit Message

Arnd Bergmann May 5, 2017, 7:46 p.m. UTC
From: James Bottomley <JBottomley@Odin.com>


Commit e03c2da6574223081b786960e39c1e5ecf5d492d upstream.

non-x86 builds want the #warning in the IPS code about compiling on the wrong
architecture removed because it keeps triggering on their platforms build
farms.  Transform from a compile time warning into a runtime one with taint to
preserve the original intent of the authors.

Acked-by: Arnd Bergmann <arnd@arndb.de>

Signed-off-by: James Bottomley <JBottomley@Odin.com>

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/scsi/ips.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

-- 
2.9.0

Comments

Ben Hutchings Nov. 6, 2017, 5:31 p.m. UTC | #1
On Fri, 2017-05-05 at 21:46 +0200, Arnd Bergmann wrote:
> From: James Bottomley <JBottomley@Odin.com>

> 

> Commit e03c2da6574223081b786960e39c1e5ecf5d492d upstream.

> 

> non-x86 builds want the #warning in the IPS code about compiling on the wrong

> architecture removed because it keeps triggering on their platforms build

> farms.  Transform from a compile time warning into a runtime one with taint to

> preserve the original intent of the authors.


I'll apply this, but:

[...]
> @@ -6789,6 +6785,11 @@ ips_remove_device(struct pci_dev *pci_dev)

>  static int __init

>  ips_module_init(void)

>  {

> +#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)

> +	printk(KERN_ERR "ips: This driver has only been tested on the x86/ia64/x86_64 platforms\n");

> +	add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);

> +#endif

[...]

This is not the right taint flag to use. 
Documentation/sysctl/kernel.txt says:

   4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.

Ben.

-- 
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert
Einstein
diff mbox series

Patch

diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 52a216f21ae5..946084014316 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -206,10 +206,6 @@  module_param(ips, charp, 0);
 #define IPS_VERSION_HIGH        IPS_VER_MAJOR_STRING "." IPS_VER_MINOR_STRING
 #define IPS_VERSION_LOW         "." IPS_VER_BUILD_STRING " "
 
-#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)
-#warning "This driver has only been tested on the x86/ia64/x86_64 platforms"
-#endif
-
 #define IPS_DMA_DIR(scb) ((!scb->scsi_cmd || ips_is_passthru(scb->scsi_cmd) || \
                          DMA_NONE == scb->scsi_cmd->sc_data_direction) ? \
                          PCI_DMA_BIDIRECTIONAL : \
@@ -6789,6 +6785,11 @@  ips_remove_device(struct pci_dev *pci_dev)
 static int __init
 ips_module_init(void)
 {
+#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)
+	printk(KERN_ERR "ips: This driver has only been tested on the x86/ia64/x86_64 platforms\n");
+	add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+#endif
+
 	if (pci_register_driver(&ips_pci_driver) < 0)
 		return -ENODEV;
 	ips_driver_template.module = THIS_MODULE;