linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qla2xxx: remove writeq/readq function definitions
@ 2017-06-02 11:32 Corentin Labbe
  2017-06-02 23:28 ` Bart Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Corentin Labbe @ 2017-06-02 11:32 UTC (permalink / raw)
  To: qla2xxx-upstream, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, Corentin Labbe

Instead of rewriting write/readq, use linux/io-64-nonatomic-lo-hi.h which
already have them.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/scsi/qla2xxx/qla_nx.h | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_nx.h b/drivers/scsi/qla2xxx/qla_nx.h
index 77624eac95a4..71a41093530e 100644
--- a/drivers/scsi/qla2xxx/qla_nx.h
+++ b/drivers/scsi/qla2xxx/qla_nx.h
@@ -7,6 +7,8 @@
 #ifndef __QLA_NX_H
 #define __QLA_NX_H
 
+#include <linux/io-64-nonatomic-lo-hi.h>
+
 /*
  * Following are the states of the Phantom. Phantom will set them and
  * Host will read to check if the fields are correct.
@@ -819,21 +821,6 @@ struct qla82xx_uri_data_desc{
 #define MIU_TEST_AGT_WRDATA_UPPER_LO		(0x0b0)
 #define	MIU_TEST_AGT_WRDATA_UPPER_HI		(0x0b4)
 
-#ifndef readq
-static inline u64 readq(void __iomem *addr)
-{
-	return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
-}
-#endif
-
-#ifndef writeq
-static inline void writeq(u64 val, void __iomem *addr)
-{
-	writel(((u32) (val)), (addr));
-	writel(((u32) (val >> 32)), (addr + 4));
-}
-#endif
-
 /* Request and response queue size */
 #define REQUEST_ENTRY_CNT_82XX		128	/* Number of request entries. */
 #define RESPONSE_ENTRY_CNT_82XX		128	/* Number of response entries.*/
-- 
2.13.0

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

* Re: [PATCH] qla2xxx: remove writeq/readq function definitions
  2017-06-02 11:32 [PATCH] qla2xxx: remove writeq/readq function definitions Corentin Labbe
@ 2017-06-02 23:28 ` Bart Van Assche
  2017-06-05 15:57 ` Madhani, Himanshu
  2017-06-06  0:49 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2017-06-02 23:28 UTC (permalink / raw)
  To: jejb@linux.vnet.ibm.com, clabbe.montjoie@gmail.com,
	qla2xxx-upstream@qlogic.com, martin.petersen@oracle.com
  Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org

On Fri, 2017-06-02 at 13:32 +0200, Corentin Labbe wrote:
> Instead of rewriting write/readq, use linux/io-64-nonatomic-lo-hi.h which
> already have them.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH] qla2xxx: remove writeq/readq function definitions
  2017-06-02 11:32 [PATCH] qla2xxx: remove writeq/readq function definitions Corentin Labbe
  2017-06-02 23:28 ` Bart Van Assche
@ 2017-06-05 15:57 ` Madhani, Himanshu
  2017-06-06  0:49 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Madhani, Himanshu @ 2017-06-05 15:57 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: Dept-Eng QLA2xxx Upstream, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com, linux-scsi,
	linux-kernel@vger.kernel.org


> On Jun 2, 2017, at 4:32 AM, Corentin Labbe <clabbe.montjoie@gmail.com> wrote:
> 
> Instead of rewriting write/readq, use linux/io-64-nonatomic-lo-hi.h which
> already have them.
> 
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
> drivers/scsi/qla2xxx/qla_nx.h | 17 ++---------------
> 1 file changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nx.h b/drivers/scsi/qla2xxx/qla_nx.h
> index 77624eac95a4..71a41093530e 100644
> --- a/drivers/scsi/qla2xxx/qla_nx.h
> +++ b/drivers/scsi/qla2xxx/qla_nx.h
> @@ -7,6 +7,8 @@
> #ifndef __QLA_NX_H
> #define __QLA_NX_H
> 
> +#include <linux/io-64-nonatomic-lo-hi.h>
> +
> /*
>  * Following are the states of the Phantom. Phantom will set them and
>  * Host will read to check if the fields are correct.
> @@ -819,21 +821,6 @@ struct qla82xx_uri_data_desc{
> #define MIU_TEST_AGT_WRDATA_UPPER_LO		(0x0b0)
> #define	MIU_TEST_AGT_WRDATA_UPPER_HI		(0x0b4)
> 
> -#ifndef readq
> -static inline u64 readq(void __iomem *addr)
> -{
> -	return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
> -}
> -#endif
> -
> -#ifndef writeq
> -static inline void writeq(u64 val, void __iomem *addr)
> -{
> -	writel(((u32) (val)), (addr));
> -	writel(((u32) (val >> 32)), (addr + 4));
> -}
> -#endif
> -
> /* Request and response queue size */
> #define REQUEST_ENTRY_CNT_82XX		128	/* Number of request entries. */
> #define RESPONSE_ENTRY_CNT_82XX		128	/* Number of response entries.*/
> -- 
> 2.13.0
> 

Looks Good. Thanks 

Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>


- Himanshu

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

* Re: [PATCH] qla2xxx: remove writeq/readq function definitions
  2017-06-02 11:32 [PATCH] qla2xxx: remove writeq/readq function definitions Corentin Labbe
  2017-06-02 23:28 ` Bart Van Assche
  2017-06-05 15:57 ` Madhani, Himanshu
@ 2017-06-06  0:49 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2017-06-06  0:49 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: qla2xxx-upstream, jejb, martin.petersen, linux-scsi, linux-kernel


Corentin,

> Instead of rewriting write/readq, use linux/io-64-nonatomic-lo-hi.h
> which already have them.

Applied to 4.13/scsi-queue, thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2017-06-06  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-02 11:32 [PATCH] qla2xxx: remove writeq/readq function definitions Corentin Labbe
2017-06-02 23:28 ` Bart Van Assche
2017-06-05 15:57 ` Madhani, Himanshu
2017-06-06  0:49 ` Martin K. Petersen

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).