public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] scsi: mpt3sas: Use lo_hi_writeq() helper
@ 2018-02-14 18:10 Andy Shevchenko
  2018-02-14 19:40 ` James Bottomley
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2018-02-14 18:10 UTC (permalink / raw)
  To: Sathya Prakash, Chaitra P B, Suganath Prabu Subramani,
	MPT-FusionLinux.pdl, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi
  Cc: Andy Shevchenko

Since we have a writeq() for 32-bit architectures as provided by IO
non-atomic helpers, there is no need to open code it.

Moreover sparse complains about this:

drivers/scsi/mpt3sas/mpt3sas_base.c:2975:16: expected unsigned long long val
drivers/scsi/mpt3sas/mpt3sas_base.c:2975:16: got restricted __le64 <noident>

Fixing this by replacing custom writeq() with one provided by
io-64-nonatomic-lo-hi.h header.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 59a87ca328d3..a92ab4a801d7 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -56,6 +56,7 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
+#include <linux/io-64-nonatomic-lo-hi.h>
 #include <linux/time.h>
 #include <linux/ktime.h>
 #include <linux/kthread.h>
@@ -2968,16 +2969,9 @@ mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid)
  * @writeq_lock: spin lock
  *
  * Glue for handling an atomic 64 bit word to MMIO. This special handling takes
- * care of 32 bit environment where its not quarenteed to send the entire word
+ * care of 32 bit environment where its not guaranteed to send the entire word
  * in one transfer.
  */
-#if defined(writeq) && defined(CONFIG_64BIT)
-static inline void
-_base_writeq(__u64 b, volatile void __iomem *addr, spinlock_t *writeq_lock)
-{
-	writeq(cpu_to_le64(b), addr);
-}
-#else
 static inline void
 _base_writeq(__u64 b, volatile void __iomem *addr, spinlock_t *writeq_lock)
 {
@@ -2985,11 +2979,9 @@ _base_writeq(__u64 b, volatile void __iomem *addr, spinlock_t *writeq_lock)
 	__u64 data_out = cpu_to_le64(b);
 
 	spin_lock_irqsave(writeq_lock, flags);
-	writel((u32)(data_out), addr);
-	writel((u32)(data_out >> 32), (addr + 4));
+	writeq(data_out, addr);
 	spin_unlock_irqrestore(writeq_lock, flags);
 }
-#endif
 
 /**
  * _base_put_smid_scsi_io - send SCSI_IO request to firmware
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-14 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 18:10 [PATCH v1] scsi: mpt3sas: Use lo_hi_writeq() helper Andy Shevchenko
2018-02-14 19:40 ` James Bottomley
2018-02-14 19:48   ` Andy Shevchenko
2018-02-14 20:01     ` James Bottomley
2018-02-14 22:15       ` Sathya Prakash Veerichetty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox