Re: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc return values in osst driver
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 signature.asc Description: This is a digitally signed message part.
Re: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc return values in osst driver
On 24/08/07, Rolf Eike Beer [EMAIL PROTECTED] wrote: 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); Thank you for pointing that out. I plan to resend those patches that don't get picked up in about a week or so. I'll address this issue then (or if it does get picked up in its current form I'll submit a follow-on patch to address this). Eike -- Jesper Juhl [EMAIL PROTECTED] Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 19/30] scsi: Remove explicit casts of [kv]alloc return values in osst driver
[kv]alloc() return void *. No need to cast the return value. Signed-off-by: Jesper Juhl [EMAIL PROTECTED] --- drivers/scsi/osst.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index 08060fb..3ad9d49 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c @@ -1404,7 +1404,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst int dbg = debugging; #endif - if ((buffer = (unsigned char *)vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL) + if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL) return (-EIO); printk(KERN_INFO %s:I: Reading back %d frames from drive buffer%s\n, @@ -2216,7 +2216,7 @@ static int osst_write_header(struct osst_tape * STp, struct osst_request ** aSRp if (STp-raw) return 0; if (STp-header_cache == NULL) { - if ((STp-header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) { + if ((STp-header_cache = vmalloc(sizeof(os_header_t))) == NULL) { printk(KERN_ERR %s:E: Failed to allocate header cache\n, name); return (-ENOMEM); } @@ -2404,7 +2404,7 @@ static int __osst_analyze_headers(struct osst_tape * STp, struct osst_request ** name, ppos, update_frame_cntr); #endif if (STp-header_cache == NULL) { - if ((STp-header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) { + if ((STp-header_cache = vmalloc(sizeof(os_header_t))) == NULL) { printk(KERN_ERR %s:E: Failed to allocate header cache\n, name); return 0; } @@ -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); -- 1.5.2.2 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html