lkml.org 
[lkml]   [2014]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: lpfc: lpfc_init: use kcalloc for allocating memory
From
Date
On Tue, 2014-04-08 at 23:42 +0300, Matei Oprea wrote:
> It's easier to use kcalloc for allocating arrays. While at it
> also remove useless casting value.
[]
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
[]
> @@ -4742,12 +4742,14 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
[]
> - if (!phba->sli.ring)
[]
> + if (unlikely(!phba->sli.ring)) {

Why add the unlikely?

Glancing at the code it seems more like that this
should be likely than unlikely.

> + phba->sli.ring = kcalloc(LPFC_SLI3_MAX_RING,
> + sizeof(struct lpfc_sli_ring),
> + GFP_KERNEL);

It'd be nicer looking if aligned better

phba->sli.ring = kcalloc(LPFC_SLI3_MAX_RING,
sizeof(struct lpfc_sli_ring),
GFP_KERNEL);




\
 
 \ /
  Last update: 2014-04-09 02:21    [W:0.047 / U:16.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site