Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2099973a authored by Jesper Juhl's avatar Jesper Juhl Committed by Jiri Kosina
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 1dcb202f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4780,7 +4780,7 @@ ahc_init_scbdata(struct ahc_softc *ahc)
	SLIST_INIT(&scb_data->sg_maps);
	SLIST_INIT(&scb_data->sg_maps);


	/* Allocate SCB resources */
	/* Allocate SCB resources */
	scb_data->scbarray = (struct scb *)kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC);
	scb_data->scbarray = kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC);
	if (scb_data->scbarray == NULL)
	if (scb_data->scbarray == NULL)
		return (ENOMEM);
		return (ENOMEM);
	memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC);
	memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC);
+4 −6
Original line number Original line Diff line number Diff line
@@ -1484,7 +1484,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst
	int			dbg              = debugging;
	int			dbg              = debugging;
#endif
#endif


	if ((buffer = (unsigned char *)vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
	if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
		return (-EIO);
		return (-EIO);


	printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n",
	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
	if (STp->raw) return 0;
	if (STp->raw) return 0;


	if (STp->header_cache == NULL) {
	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);
			printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name);
			return (-ENOMEM);
			return (-ENOMEM);
		}
		}
@@ -2484,7 +2484,7 @@ static int __osst_analyze_headers(struct osst_tape * STp, struct osst_request **
				   name, ppos, update_frame_cntr);
				   name, ppos, update_frame_cntr);
#endif
#endif
		if (STp->header_cache == NULL) {
		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);
				printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name);
				return 0;
				return 0;
			}
			}
@@ -5851,9 +5851,7 @@ static int osst_probe(struct device *dev)
	/* if this is the first attach, build the infrastructure */
	/* if this is the first attach, build the infrastructure */
	write_lock(&os_scsi_tapes_lock);
	write_lock(&os_scsi_tapes_lock);
	if (os_scsi_tapes == NULL) {
	if (os_scsi_tapes == NULL) {
		os_scsi_tapes =
		os_scsi_tapes = kmalloc(osst_max_dev * sizeof(struct osst_tape *), GFP_ATOMIC);
			(struct osst_tape **)kmalloc(osst_max_dev * sizeof(struct osst_tape *),
				   GFP_ATOMIC);
		if (os_scsi_tapes == NULL) {
		if (os_scsi_tapes == NULL) {
			write_unlock(&os_scsi_tapes_lock);
			write_unlock(&os_scsi_tapes_lock);
			printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n");
			printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n");