Commit db3a8815 authored by Jeff Garzik's avatar Jeff Garzik Committed by James Bottomley

[SCSI] minor bug fixes and cleanups

BusLogic: use kzalloc(), remove cast to/from void*

aic7xxx_old: fix typo in cast

NCR53c406a: ifdef out static built code

fd_mcs: ifdef out static built code

ncr53c8xx: ifdef out static built code
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent bf471341
...@@ -2186,21 +2186,21 @@ static int __init BusLogic_init(void) ...@@ -2186,21 +2186,21 @@ static int __init BusLogic_init(void)
if (BusLogic_ProbeOptions.NoProbe) if (BusLogic_ProbeOptions.NoProbe)
return -ENODEV; return -ENODEV;
BusLogic_ProbeInfoList = (struct BusLogic_ProbeInfo *) BusLogic_ProbeInfoList =
kmalloc(BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo), GFP_ATOMIC); kzalloc(BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo), GFP_KERNEL);
if (BusLogic_ProbeInfoList == NULL) { if (BusLogic_ProbeInfoList == NULL) {
BusLogic_Error("BusLogic: Unable to allocate Probe Info List\n", NULL); BusLogic_Error("BusLogic: Unable to allocate Probe Info List\n", NULL);
return -ENOMEM; return -ENOMEM;
} }
memset(BusLogic_ProbeInfoList, 0, BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo));
PrototypeHostAdapter = (struct BusLogic_HostAdapter *) PrototypeHostAdapter =
kmalloc(sizeof(struct BusLogic_HostAdapter), GFP_ATOMIC); kzalloc(sizeof(struct BusLogic_HostAdapter), GFP_KERNEL);
if (PrototypeHostAdapter == NULL) { if (PrototypeHostAdapter == NULL) {
kfree(BusLogic_ProbeInfoList); kfree(BusLogic_ProbeInfoList);
BusLogic_Error("BusLogic: Unable to allocate Prototype " "Host Adapter\n", NULL); BusLogic_Error("BusLogic: Unable to allocate Prototype " "Host Adapter\n", NULL);
return -ENOMEM; return -ENOMEM;
} }
memset(PrototypeHostAdapter, 0, sizeof(struct BusLogic_HostAdapter));
#ifdef MODULE #ifdef MODULE
if (BusLogic != NULL) if (BusLogic != NULL)
BusLogic_Setup(BusLogic); BusLogic_Setup(BusLogic);
......
...@@ -220,9 +220,11 @@ static void *addresses[] = { ...@@ -220,9 +220,11 @@ static void *addresses[] = {
static unsigned short ports[] = { 0x230, 0x330, 0x280, 0x290, 0x330, 0x340, 0x300, 0x310, 0x348, 0x350 }; static unsigned short ports[] = { 0x230, 0x330, 0x280, 0x290, 0x330, 0x340, 0x300, 0x310, 0x348, 0x350 };
#define PORT_COUNT ARRAY_SIZE(ports) #define PORT_COUNT ARRAY_SIZE(ports)
#ifndef MODULE
/* possible interrupt channels */ /* possible interrupt channels */
static unsigned short intrs[] = { 10, 11, 12, 15 }; static unsigned short intrs[] = { 10, 11, 12, 15 };
#define INTR_COUNT ARRAY_SIZE(intrs) #define INTR_COUNT ARRAY_SIZE(intrs)
#endif /* !MODULE */
/* signatures for NCR 53c406a based controllers */ /* signatures for NCR 53c406a based controllers */
#if USE_BIOS #if USE_BIOS
...@@ -605,6 +607,7 @@ static int NCR53c406a_release(struct Scsi_Host *shost) ...@@ -605,6 +607,7 @@ static int NCR53c406a_release(struct Scsi_Host *shost)
return 0; return 0;
} }
#ifndef MODULE
/* called from init/main.c */ /* called from init/main.c */
static int __init NCR53c406a_setup(char *str) static int __init NCR53c406a_setup(char *str)
{ {
...@@ -661,6 +664,8 @@ static int __init NCR53c406a_setup(char *str) ...@@ -661,6 +664,8 @@ static int __init NCR53c406a_setup(char *str)
__setup("ncr53c406a=", NCR53c406a_setup); __setup("ncr53c406a=", NCR53c406a_setup);
#endif /* !MODULE */
static const char *NCR53c406a_info(struct Scsi_Host *SChost) static const char *NCR53c406a_info(struct Scsi_Host *SChost)
{ {
DEB(printk("NCR53c406a_info called\n")); DEB(printk("NCR53c406a_info called\n"));
......
...@@ -294,6 +294,7 @@ static struct Scsi_Host *hosts[FD_MAX_HOSTS + 1] = { NULL }; ...@@ -294,6 +294,7 @@ static struct Scsi_Host *hosts[FD_MAX_HOSTS + 1] = { NULL };
static int user_fifo_count = 0; static int user_fifo_count = 0;
static int user_fifo_size = 0; static int user_fifo_size = 0;
#ifndef MODULE
static int __init fd_mcs_setup(char *str) static int __init fd_mcs_setup(char *str)
{ {
static int done_setup = 0; static int done_setup = 0;
...@@ -311,6 +312,7 @@ static int __init fd_mcs_setup(char *str) ...@@ -311,6 +312,7 @@ static int __init fd_mcs_setup(char *str)
} }
__setup("fd_mcs=", fd_mcs_setup); __setup("fd_mcs=", fd_mcs_setup);
#endif /* !MODULE */
static void print_banner(struct Scsi_Host *shpnt) static void print_banner(struct Scsi_Host *shpnt)
{ {
......
...@@ -589,10 +589,12 @@ static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd) ...@@ -589,10 +589,12 @@ static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd)
static struct ncr_driver_setup static struct ncr_driver_setup
driver_setup = SCSI_NCR_DRIVER_SETUP; driver_setup = SCSI_NCR_DRIVER_SETUP;
#ifndef MODULE
#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT #ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT
static struct ncr_driver_setup static struct ncr_driver_setup
driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP; driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP;
#endif #endif
#endif /* !MODULE */
#define initverbose (driver_setup.verbose) #define initverbose (driver_setup.verbose)
#define bootverbose (np->verbose) #define bootverbose (np->verbose)
...@@ -641,6 +643,13 @@ static struct ncr_driver_setup ...@@ -641,6 +643,13 @@ static struct ncr_driver_setup
#define OPT_IARB 26 #define OPT_IARB 26
#endif #endif
#ifdef MODULE
#define ARG_SEP ' '
#else
#define ARG_SEP ','
#endif
#ifndef MODULE
static char setup_token[] __initdata = static char setup_token[] __initdata =
"tags:" "mpar:" "tags:" "mpar:"
"spar:" "disc:" "spar:" "disc:"
...@@ -660,12 +669,6 @@ static char setup_token[] __initdata = ...@@ -660,12 +669,6 @@ static char setup_token[] __initdata =
#endif #endif
; /* DONNOT REMOVE THIS ';' */ ; /* DONNOT REMOVE THIS ';' */
#ifdef MODULE
#define ARG_SEP ' '
#else
#define ARG_SEP ','
#endif
static int __init get_setup_token(char *p) static int __init get_setup_token(char *p)
{ {
char *cur = setup_token; char *cur = setup_token;
...@@ -682,7 +685,6 @@ static int __init get_setup_token(char *p) ...@@ -682,7 +685,6 @@ static int __init get_setup_token(char *p)
return 0; return 0;
} }
static int __init sym53c8xx__setup(char *str) static int __init sym53c8xx__setup(char *str)
{ {
#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT #ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT
...@@ -804,6 +806,7 @@ static int __init sym53c8xx__setup(char *str) ...@@ -804,6 +806,7 @@ static int __init sym53c8xx__setup(char *str)
#endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */ #endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */
return 1; return 1;
} }
#endif /* !MODULE */
/*=================================================================== /*===================================================================
** **
...@@ -8321,12 +8324,12 @@ char *ncr53c8xx; /* command line passed by insmod */ ...@@ -8321,12 +8324,12 @@ char *ncr53c8xx; /* command line passed by insmod */
module_param(ncr53c8xx, charp, 0); module_param(ncr53c8xx, charp, 0);
#endif #endif
#ifndef MODULE
static int __init ncr53c8xx_setup(char *str) static int __init ncr53c8xx_setup(char *str)
{ {
return sym53c8xx__setup(str); return sym53c8xx__setup(str);
} }
#ifndef MODULE
__setup("ncr53c8xx=", ncr53c8xx_setup); __setup("ncr53c8xx=", ncr53c8xx_setup);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment