All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Jayamohan Kalickal <jayamohank@serverengines.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/6] RFC: beiscsi : handles core routines
Date: Thu, 13 Aug 2009 12:09:38 +0200	[thread overview]
Message-ID: <200908131209.43643.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <20090813070833.GA28512@serverengines.com>

[-- Attachment #1: Type: Text/Plain, Size: 1779 bytes --]

Jayamohan Kallickal wrote:
> This file handles initiallization/teardown, allocation/free as well
> as IO/Management flows.
>
> Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>

> +struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev)
> +{
[...]
> +	phba = iscsi_host_priv(shost);
> +	memset(phba, 0x0, sizeof(*phba));
> +	phba->shost = shost;
> +	pci_dev_get(pcidev);
> +
> +	phba->shost = shost;
> +	phba->pcidev = pcidev;

You initialized shost 3 lines before. Additionally you can simply say

phba->pcidev = pci_dev_get(pcidev);

> +int beiscsi_enable_pci(struct pci_dev *pcidev)
> +{
> +	if (pci_enable_device(pcidev)) {
> +		dev_err(&pcidev->dev, "beiscsi_enable_pci - enable device "
> +			"failed. Returning -ENODEV\n");
> +		return -ENODEV;
> +	}

You should forward the error code of pci_enable_device() here.

> +	if (pci_set_consistent_dma_mask(pcidev, DMA_BIT_MASK(64))) {
> +		if (pci_set_consistent_dma_mask(pcidev, DMA_BIT_MASK(32))) {
> +			dev_err(&pcidev->dev, "Could not set PCI DMA Mask\n");
> +			return -ENODEV;
> +		}
> +	}
> +	return 0;
> +}

This function is only called from one place. You should move it before that  
caller, remove it from the header file and mark it static.

> +static int beiscsi_alloc_mem(struct beiscsi_hba *phba)
> +{
> +	struct be_mem_descriptor *mem_descr;
> +	dma_addr_t bus_add;
> +	unsigned int num_size, i, j;
> +	phba->phwi_ctrlr = kmalloc(phba->params.hwi_ws_sz, GFP_KERNEL);
> +	if (!phba->phwi_ctrlr)
> +		return -ENOMEM;
> +	phba->init_mem =
> +	    kzalloc(sizeof(struct be_mem_descriptor) * SE_MEM_MAX, GFP_KERNEL);

kcalloc()

There is also a typo (found at least 5 places): Initiallize has one 'l' too 
much.

Greetings,

Eike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2009-08-13 10:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13  7:08 [PATCH 1/6] RFC: beiscsi : handles core routines Jayamohan Kallickal
2009-08-13 10:09 ` Rolf Eike Beer [this message]
2009-08-20 19:26 ` Mike Christie
  -- strict thread matches above, loose matches on Subject: below --
2009-07-28  7:13 Jayamohan Kallickal
2009-07-28 13:13 ` Rolf Eike Beer
2009-07-28 20:12 ` Rolf Eike Beer
2009-08-03 16:57 ` Mike Christie
2009-08-03 20:41   ` Jens Axboe
2009-08-03 22:18     ` Mike Christie
2009-07-27 19:55 RFC: be iscsi driver Jayamohan Kallickal
     [not found] ` <1248724523-10999-1-git-send-email-jayamohank-i5Eg4PDOvn3+uv41P6q33AC/G2K4zDHf@public.gmane.org>
2009-07-27 19:55   ` [PATCH 1/6] RFC: beiscsi : handles core routines Jayamohan Kallickal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200908131209.43643.eike-kernel@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=jayamohank@serverengines.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.