mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Thiago Farina <tfransosi@gmail.com>
Cc: linux-kernel@vger.kernel.org, Willem Riede <osst@riede.org>,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	osst-users@lists.sourceforge.net, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi/osst.c: remove unncessary casting of kmalloc.
Date: Sat, 16 Jan 2010 16:35:27 +0100	[thread overview]
Message-ID: <4B51DCBF.9090902@s5r6.in-berlin.de> (raw)
In-Reply-To: <503939f4cfd0b8c362a2f5a103285f8dc330b99a.1263651173.git.tfransosi@gmail.com>

Thiago Farina wrote:
> --- a/drivers/scsi/osst.c
> +++ b/drivers/scsi/osst.c
> @@ -5842,9 +5842,8 @@ static int osst_probe(struct device *dev)
>  	/* if this is the first attach, build the infrastructure */
>  	write_lock(&os_scsi_tapes_lock);
>  	if (os_scsi_tapes == NULL) {
> -		os_scsi_tapes =
> -			(struct osst_tape **)kmalloc(osst_max_dev * sizeof(struct osst_tape *),
> -				   GFP_ATOMIC);
> +		os_scsi_tapes = kmalloc(osst_max_dev * sizeof(struct osst_tape *),
> +					GFP_ATOMIC);
>  		if (os_scsi_tapes == NULL) {
>  			write_unlock(&os_scsi_tapes_lock);
>  			printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n");

Since you update the style of this kmalloc usage, you could at the same
time change the sizeof expression to sizeof(* os_scsi_tapes).

There is a lot more that could be renovated around os_scsi_tapes, and
osst in general (GFP_ATOMIC allocations in a device probe?  Fixed
maximum number of devices?  BKL usage?), but whether it'd be worth the
effort I don't know.
-- 
Stefan Richter
-=====-==-=- ---= =----
http://arcgraph.de/sr/

  reply	other threads:[~2010-01-16 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16 14:15 Thiago Farina
2010-01-16 15:35 ` Stefan Richter [this message]
2010-01-16 15:37   ` Stefan Richter
2010-01-16 15:46   ` James Bottomley

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=4B51DCBF.9090902@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=James.Bottomley@suse.de \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osst-users@lists.sourceforge.net \
    --cc=osst@riede.org \
    --cc=tfransosi@gmail.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

all inboxes | Powered by JetHome®