lkml.org 
[lkml]   [2007]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc return values in osst driver
Date
Jesper Juhl wrote:
> [kv]alloc() return void *. No need to cast the return value.

> @@ -5756,7 +5756,7 @@ static int osst_probe(struct device *dev)
> 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 *),
> + kmalloc(osst_max_dev * sizeof(struct osst_tape *),
> GFP_ATOMIC);
> if (os_scsi_tapes == NULL) {
> write_unlock(&os_scsi_tapes_lock);

Three lines later:

for (i=0; i < osst_max_dev; ++i) os_scsi_tapes[i] = NULL;

This wants to be

os_scsi_tapes = kcalloc(osst_max_dev, sizeof(struct osst_tape *), GFP_ATOMIC);

Eike
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2007-08-24 09:15    [W:0.110 / U:9.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site