Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277268 > unrolled thread

[PATCH v3 3/5] arcmsr: modifies codes for more readable

Started byChing Huang <ching2048@areca.com.tw>
First post2015-11-25 12:50 +0100
Last post2015-11-25 13:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 3/5] arcmsr: modifies codes for more readable Ching Huang <ching2048@areca.com.tw> - 2015-11-25 12:50 +0100
    Re: [PATCH v3 3/5] arcmsr: modifies codes for more readable Hannes Reinecke <hare@suse.de> - 2015-11-25 13:10 +0100
    Re: [PATCH v3 3/5] arcmsr: modifies codes for more readable Johannes Thumshirn <jthumshirn@suse.de> - 2015-11-25 13:10 +0100

#1277268 — [PATCH v3 3/5] arcmsr: modifies codes for more readable

FromChing Huang <ching2048@areca.com.tw>
Date2015-11-25 12:50 +0100
Subject[PATCH v3 3/5] arcmsr: modifies codes for more readable
Message-ID<qyGKd-5Jh-1@gated-at.bofh.it>
From: Ching Huang <ching2048@areca.com.tw>

Modifies codes for more readable

Signed-of-by: Ching Huang <ching2048@areca.com.tw>

---

diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
--- a/drivers/scsi/arcmsr/arcmsr.h	2015-11-25 10:52:16.286470000 +0800
+++ b/drivers/scsi/arcmsr/arcmsr.h	2015-11-25 19:10:21.309960000 +0800
@@ -288,6 +288,9 @@ struct FIRMWARE_INFO
 #define ARCMSR_MESSAGE_RBUFFER			      0x0000ff00
 /* iop message_rwbuffer for message command */
 #define ARCMSR_MESSAGE_RWBUFFER			      0x0000fa00
+
+#define MEM_BASE0(x)	(u32 __iomem *)((unsigned long)acb->mem_base0 + x)
+#define MEM_BASE1(x)	(u32 __iomem *)((unsigned long)acb->mem_base1 + x)
 /* 
 ************************************************************************
 **                SPEC. for Areca HBC adapter
diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
--- a/drivers/scsi/arcmsr/arcmsr_hba.c	2015-11-25 19:04:44.590970000 +0800
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c	2015-11-25 19:11:27.679958000 +0800
@@ -2649,13 +2649,13 @@ static bool arcmsr_hbaB_get_config(struc
 	acb->dma_coherent2 = dma_coherent;
 	reg = (struct MessageUnit_B *)dma_coherent;
 	acb->pmuB = reg;
-	reg->drv2iop_doorbell= (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL);
-	reg->drv2iop_doorbell_mask = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL_MASK);
-	reg->iop2drv_doorbell = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_IOP2DRV_DOORBELL);
-	reg->iop2drv_doorbell_mask = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_IOP2DRV_DOORBELL_MASK);
-	reg->message_wbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_WBUFFER);
-	reg->message_rbuffer =  (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_RBUFFER);
-	reg->message_rwbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_RWBUFFER);
+	reg->drv2iop_doorbell= MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
+	reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
+	reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
+	reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
+	reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
+	reg->message_rbuffer =  MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
+	reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
 	iop_firm_model = (char __iomem *)(&reg->message_rwbuffer[15]);	/*firm_model,15,60-67*/
 	iop_firm_version = (char __iomem *)(&reg->message_rwbuffer[17]);	/*firm_version,17,68-83*/
 	iop_device_map = (char __iomem *)(&reg->message_rwbuffer[21]);	/*firm_version,21,84-99*/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1277283

FromHannes Reinecke <hare@suse.de>
Date2015-11-25 13:10 +0100
Message-ID<qyH3z-67h-5@gated-at.bofh.it>
In reply to#1277268
On 11/25/2015 12:45 PM, Ching Huang wrote:
> From: Ching Huang <ching2048@areca.com.tw>
> 
> Modifies codes for more readable
> 
> Signed-of-by: Ching Huang <ching2048@areca.com.tw>
> 
> ---
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277288

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2015-11-25 13:10 +0100
Message-ID<qyH3A-67h-15@gated-at.bofh.it>
In reply to#1277268
On Wed, 2015-11-25 at 19:45 +0800, Ching Huang wrote:
> From: Ching Huang <ching2048@areca.com.tw>
> 
> Modifies codes for more readable
> 
> Signed-of-by: Ching Huang <ching2048@areca.com.tw>
> 
> ---
> 
> diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
> --- a/drivers/scsi/arcmsr/arcmsr.h	2015-11-25 10:52:16.286470000 +0800
> +++ b/drivers/scsi/arcmsr/arcmsr.h	2015-11-25 19:10:21.309960000 +0800
> @@ -288,6 +288,9 @@ struct FIRMWARE_INFO
>  #define ARCMSR_MESSAGE_RBUFFER			      0x0000ff00
>  /* iop message_rwbuffer for message command */
>  #define ARCMSR_MESSAGE_RWBUFFER			      0x0000fa00
> +
> +#define MEM_BASE0(x)	(u32 __iomem *)((unsigned long)acb->mem_base0 +
> x)
> +#define MEM_BASE1(x)	(u32 __iomem *)((unsigned long)acb->mem_base1 +
> x)
>  /* 
>  ************************************************************************
>  **                SPEC. for Areca HBC adapter
> diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c
> b/drivers/scsi/arcmsr/arcmsr_hba.c
> --- a/drivers/scsi/arcmsr/arcmsr_hba.c	2015-11-25 19:04:44.590970000
> +0800
> +++ b/drivers/scsi/arcmsr/arcmsr_hba.c	2015-11-25 19:11:27.679958000
> +0800
> @@ -2649,13 +2649,13 @@ static bool arcmsr_hbaB_get_config(struc
>  	acb->dma_coherent2 = dma_coherent;
>  	reg = (struct MessageUnit_B *)dma_coherent;
>  	acb->pmuB = reg;
> -	reg->drv2iop_doorbell= (uint32_t __iomem *)((unsigned long)acb-
> >mem_base0 + ARCMSR_DRV2IOP_DOORBELL);
> -	reg->drv2iop_doorbell_mask = (uint32_t __iomem *)((unsigned
> long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL_MASK);
> -	reg->iop2drv_doorbell = (uint32_t __iomem *)((unsigned long)acb-
> >mem_base0 + ARCMSR_IOP2DRV_DOORBELL);
> -	reg->iop2drv_doorbell_mask = (uint32_t __iomem *)((unsigned
> long)acb->mem_base0 + ARCMSR_IOP2DRV_DOORBELL_MASK);
> -	reg->message_wbuffer = (uint32_t __iomem *)((unsigned long)acb-
> >mem_base1 + ARCMSR_MESSAGE_WBUFFER);
> -	reg->message_rbuffer =  (uint32_t __iomem *)((unsigned long)acb-
> >mem_base1 + ARCMSR_MESSAGE_RBUFFER);
> -	reg->message_rwbuffer = (uint32_t __iomem *)((unsigned long)acb-
> >mem_base1 + ARCMSR_MESSAGE_RWBUFFER);
> +	reg->drv2iop_doorbell= MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
> +	reg->drv2iop_doorbell_mask =
> MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
> +	reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
> +	reg->iop2drv_doorbell_mask =
> MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
> +	reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
> +	reg->message_rbuffer =  MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
> +	reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
>  	iop_firm_model = (char __iomem *)(&reg->message_rwbuffer[15]);	
> /*firm_model,15,60-67*/
>  	iop_firm_version = (char __iomem *)(&reg->message_rwbuffer[17]);	
> /*firm_version,17,68-83*/
>  	iop_device_map = (char __iomem *)(&reg->message_rwbuffer[21]);	
> /*firm_version,21,84-99*/
> 
> 

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web