linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent
@ 2018-11-18 14:38 Sabyasachi Gupta
  2018-11-20  9:40 ` John Garry
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sabyasachi Gupta @ 2018-11-18 14:38 UTC (permalink / raw)
  To: james.smart, dick.kennedy, jejb, martin.petersen
  Cc: jrdr.linux, linux-scsi, linux-kernel, brajeswar.linux

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 783a154..3491ff7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -6229,7 +6229,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
 			goto free_mem;
 		}
 
-		dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
+		dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
 						  LPFC_RAS_MAX_ENTRY_SIZE,
 						  &dmabuf->phys,
 						  GFP_KERNEL);
@@ -6240,7 +6240,6 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
 					"6187 DMA Alloc Failed FW logging");
 			goto free_mem;
 		}
-		memset(dmabuf->virt, 0, LPFC_RAS_MAX_ENTRY_SIZE);
 		dmabuf->buffer_tag = i;
 		list_add_tail(&dmabuf->list, &ras_fwlog->fwlog_buff_list);
 	}
-- 
2.7.4


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

* Re: [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent
  2018-11-18 14:38 [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent Sabyasachi Gupta
@ 2018-11-20  9:40 ` John Garry
  2018-11-20 21:52   ` James Smart
  2018-11-20 21:53 ` James Smart
  2018-11-22  3:32 ` Martin K. Petersen
  2 siblings, 1 reply; 6+ messages in thread
From: John Garry @ 2018-11-20  9:40 UTC (permalink / raw)
  To: Sabyasachi Gupta, james.smart, dick.kennedy, jejb, martin.petersen
  Cc: jrdr.linux, linux-scsi, linux-kernel, brajeswar.linux

On 18/11/2018 14:38, Sabyasachi Gupta wrote:
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent
>
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> ---
>  drivers/scsi/lpfc/lpfc_sli.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 783a154..3491ff7 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -6229,7 +6229,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
>  			goto free_mem;
>  		}
>
> -		dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
> +		dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
>  						  LPFC_RAS_MAX_ENTRY_SIZE,

please ensure that you maintain alignment with opening brackets

>  						  &dmabuf->phys,
>  						  GFP_KERNEL);
> @@ -6240,7 +6240,6 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
>  					"6187 DMA Alloc Failed FW logging");
>  			goto free_mem;
>  		}
> -		memset(dmabuf->virt, 0, LPFC_RAS_MAX_ENTRY_SIZE);
>  		dmabuf->buffer_tag = i;
>  		list_add_tail(&dmabuf->list, &ras_fwlog->fwlog_buff_list);
>  	}
>



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

* Re: [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent
  2018-11-20  9:40 ` John Garry
@ 2018-11-20 21:52   ` James Smart
  2018-11-21  7:56     ` John Garry
  0 siblings, 1 reply; 6+ messages in thread
From: James Smart @ 2018-11-20 21:52 UTC (permalink / raw)
  To: John Garry, Sabyasachi Gupta, dick.kennedy, jejb, martin.petersen
  Cc: jrdr.linux, linux-scsi, linux-kernel, brajeswar.linux

On 11/20/2018 1:40 AM, John Garry wrote:
>
> please ensure that you maintain alignment with opening brackets 

I don't think this is a requirement.  From the rules I've read 
preference is tabs-only indentation.  Spacing (less than a tab), after 
tabs, for open brace alignment is allowed, thus is coder's choice.

-- james






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

* Re: [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent
  2018-11-18 14:38 [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent Sabyasachi Gupta
  2018-11-20  9:40 ` John Garry
@ 2018-11-20 21:53 ` James Smart
  2018-11-22  3:32 ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: James Smart @ 2018-11-20 21:53 UTC (permalink / raw)
  To: Sabyasachi Gupta, dick.kennedy, jejb, martin.petersen
  Cc: jrdr.linux, linux-scsi, linux-kernel, brajeswar.linux

On 11/18/2018 6:38 AM, Sabyasachi Gupta wrote:
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent
>
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> ---
>   drivers/scsi/lpfc/lpfc_sli.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 783a154..3491ff7 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -6229,7 +6229,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
>   			goto free_mem;
>   		}
>   
> -		dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
> +		dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
>   						  LPFC_RAS_MAX_ENTRY_SIZE,
>   						  &dmabuf->phys,
>   						  GFP_KERNEL);
> @@ -6240,7 +6240,6 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
>   					"6187 DMA Alloc Failed FW logging");
>   			goto free_mem;
>   		}
> -		memset(dmabuf->virt, 0, LPFC_RAS_MAX_ENTRY_SIZE);
>   		dmabuf->buffer_tag = i;
>   		list_add_tail(&dmabuf->list, &ras_fwlog->fwlog_buff_list);
>   	}

Looks fine.

-- james

Reviewed-by:   James Smart   <jsmart2021@gmail.com>


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

* Re: [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent
  2018-11-20 21:52   ` James Smart
@ 2018-11-21  7:56     ` John Garry
  0 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2018-11-21  7:56 UTC (permalink / raw)
  To: James Smart, Sabyasachi Gupta, dick.kennedy, jejb, martin.petersen
  Cc: jrdr.linux, linux-scsi, linux-kernel, brajeswar.linux

On 20/11/2018 21:52, James Smart wrote:
> On 11/20/2018 1:40 AM, John Garry wrote:
>>
>> please ensure that you maintain alignment with opening brackets
>
> I don't think this is a requirement.  From the rules I've read
> preference is tabs-only indentation.

This is the only rule (enforcement) I see:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20181120&id=d1fe9c099cecc6e49324355f1b15573e9dbbe0f9

Spacing (less than a tab), after
> tabs, for open brace alignment is allowed, thus is coder's choice.

It seems that alignment was being implemented with tab+space, and now it 
would be tab+space but no alignment.

cheers,
John

>
> -- james
>
>
>
>
>
>
>



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

* Re: [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent
  2018-11-18 14:38 [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent Sabyasachi Gupta
  2018-11-20  9:40 ` John Garry
  2018-11-20 21:53 ` James Smart
@ 2018-11-22  3:32 ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2018-11-22  3:32 UTC (permalink / raw)
  To: Sabyasachi Gupta
  Cc: james.smart, dick.kennedy, jejb, martin.petersen, jrdr.linux,
	linux-scsi, linux-kernel, brajeswar.linux


Sabyasachi,

> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Applied to 4.21/scsi-queue. Thanks.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2018-11-22  3:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-18 14:38 [PATCH] scsi/lpfc/lpfc_sli.c: Use dma_zalloc_coherent Sabyasachi Gupta
2018-11-20  9:40 ` John Garry
2018-11-20 21:52   ` James Smart
2018-11-21  7:56     ` John Garry
2018-11-20 21:53 ` James Smart
2018-11-22  3:32 ` 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).