public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Grant Grundler <grundler@google.com>
Cc: jack wang <jack_wang@usish.com>,
	James Bottomley <James.Bottomley@suse.de>,
	lindar_liu <lindar_liu@usish.com>,
	matthew@wil.cx, linux-scsi@vger.kernel.org, tom_peng@usish.com,
	aoqingy <aoqingyun@usish.com>,
	roy_wang@usish.com
Subject: Re: [RFC][PATCH v2]Add pm8001 SAS/SATA HBA driver
Date: Sat, 10 Oct 2009 21:27:10 +0200	[thread overview]
Message-ID: <200910102127.17843.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <da824cf30910091937l761e1b8bo311dc2a0bbf1c115@mail.gmail.com>

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

Grant Grundler wrote:

> Later in the patch I see:
> +       pm8001_ha->tags = kmalloc(sizeof(unsigned long)*PM8001_MAX_DEVICES,
> +               GFP_KERNEL);
> 
> What are we limiting to 1024 devices? LUNS?
> I noticed the constant was also used in an initialization loop too.

There are some other things that I find suspicious at this point:

-for allocations of array kcalloc() is usually the way to go as it does 
overflow checks for the multiplication result (not needed here with the 
current values, but doesn't really hurt in init path either)
-using sizeof(*pm8001_ha->tags) would make sure it's the correct size no 
matter what type this will ever be, because ...
-unsigned long has different size on 32 and 64 bit, I don't know if that makes 
sense here. AFAICT this is sort of bitmap here so this probably doesn't need 
to double it's size on 64 bit.

Greetings,

Eike

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

  reply	other threads:[~2009-10-10 19:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15  3:10 [RFC][PATCH v2]Add pm8001 SAS/SATA HBA driver jack wang
2009-09-15  6:07 ` Rolf Eike Beer
2009-09-16  3:27   ` jack wang
2009-09-24 21:04     ` James Bottomley
2009-09-28  1:41       ` lindar_liu
2009-10-02 21:15         ` James Bottomley
2009-10-07 14:08           ` jack wang
2009-10-09 10:01             ` jack wang
2009-10-10  2:37               ` Grant Grundler
2009-10-10 19:27                 ` Rolf Eike Beer [this message]
2009-10-12  2:37                   ` jack wang
2009-10-12  2:35                 ` jack wang
2009-10-13  9:58                 ` [RFC][PATCH v3]Add " jack wang
2009-10-13 11:05                   ` Rolf Eike Beer
2009-10-14  8:19                     ` [RFC][PATCH v4]Add " jack wang

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=200910102127.17843.eike-kernel@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=James.Bottomley@suse.de \
    --cc=aoqingyun@usish.com \
    --cc=grundler@google.com \
    --cc=jack_wang@usish.com \
    --cc=lindar_liu@usish.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=roy_wang@usish.com \
    --cc=tom_peng@usish.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox