diff options
author | Jesper Juhl <jj@chaosbits.net> | 2010-11-08 18:09:25 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-01-19 09:26:40 -0500 |
commit | 2099973abfb96f98290d52de24940561e29bbeea (patch) | |
tree | a54134b6137622a3deafa2bdfe5e30249003e1af /drivers/scsi | |
parent | 1dcb202f42d0483d8d24015d8ded3badc1d11e2e (diff) |
scsi: Remove unnecessary casts of void ptr returning alloc function return values
The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.
This patch removes such casts from drivers/scsi/
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_core.c | 2 | ||||
-rw-r--r-- | drivers/scsi/osst.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index 3f5a542a7793..e021b4812d58 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c | |||
@@ -4780,7 +4780,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) | |||
4780 | SLIST_INIT(&scb_data->sg_maps); | 4780 | SLIST_INIT(&scb_data->sg_maps); |
4781 | 4781 | ||
4782 | /* Allocate SCB resources */ | 4782 | /* Allocate SCB resources */ |
4783 | scb_data->scbarray = (struct scb *)kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC); | 4783 | scb_data->scbarray = kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC); |
4784 | if (scb_data->scbarray == NULL) | 4784 | if (scb_data->scbarray == NULL) |
4785 | return (ENOMEM); | 4785 | return (ENOMEM); |
4786 | memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC); | 4786 | memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC); |
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index 54de1d1af1a7..521e2182d45b 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -1484,7 +1484,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst | |||
1484 | int dbg = debugging; | 1484 | int dbg = debugging; |
1485 | #endif | 1485 | #endif |
1486 | 1486 | ||
1487 | if ((buffer = (unsigned char *)vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL) | 1487 | if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL) |
1488 | return (-EIO); | 1488 | return (-EIO); |
1489 | 1489 | ||
1490 | printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n", | 1490 | printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n", |
@@ -2296,7 +2296,7 @@ static int osst_write_header(struct osst_tape * STp, struct osst_request ** aSRp | |||
2296 | if (STp->raw) return 0; | 2296 | if (STp->raw) return 0; |
2297 | 2297 | ||
2298 | if (STp->header_cache == NULL) { | 2298 | if (STp->header_cache == NULL) { |
2299 | if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) { | 2299 | if ((STp->header_cache = vmalloc(sizeof(os_header_t))) == NULL) { |
2300 | printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name); | 2300 | printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name); |
2301 | return (-ENOMEM); | 2301 | return (-ENOMEM); |
2302 | } | 2302 | } |
@@ -2484,7 +2484,7 @@ static int __osst_analyze_headers(struct osst_tape * STp, struct osst_request ** | |||
2484 | name, ppos, update_frame_cntr); | 2484 | name, ppos, update_frame_cntr); |
2485 | #endif | 2485 | #endif |
2486 | if (STp->header_cache == NULL) { | 2486 | if (STp->header_cache == NULL) { |
2487 | if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) { | 2487 | if ((STp->header_cache = vmalloc(sizeof(os_header_t))) == NULL) { |
2488 | printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name); | 2488 | printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name); |
2489 | return 0; | 2489 | return 0; |
2490 | } | 2490 | } |
@@ -5851,9 +5851,7 @@ static int osst_probe(struct device *dev) | |||
5851 | /* if this is the first attach, build the infrastructure */ | 5851 | /* if this is the first attach, build the infrastructure */ |
5852 | write_lock(&os_scsi_tapes_lock); | 5852 | write_lock(&os_scsi_tapes_lock); |
5853 | if (os_scsi_tapes == NULL) { | 5853 | if (os_scsi_tapes == NULL) { |
5854 | os_scsi_tapes = | 5854 | os_scsi_tapes = kmalloc(osst_max_dev * sizeof(struct osst_tape *), GFP_ATOMIC); |
5855 | (struct osst_tape **)kmalloc(osst_max_dev * sizeof(struct osst_tape *), | ||
5856 | GFP_ATOMIC); | ||
5857 | if (os_scsi_tapes == NULL) { | 5855 | if (os_scsi_tapes == NULL) { |
5858 | write_unlock(&os_scsi_tapes_lock); | 5856 | write_unlock(&os_scsi_tapes_lock); |
5859 | printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n"); | 5857 | printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n"); |