diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-11-08 22:56:20 -0500 |
|---|---|---|
| committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-15 17:41:27 -0500 |
| commit | db3a8815fb03f9985713b4ab29e208b7074f939c (patch) | |
| tree | ecd16112552d0161db7763cc669ba30db0d13bd4 | |
| parent | bf4713418b9d8543e7b64bf6c742f1959828033e (diff) | |
[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: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| -rw-r--r-- | drivers/scsi/BusLogic.c | 12 | ||||
| -rw-r--r-- | drivers/scsi/NCR53c406a.c | 5 | ||||
| -rw-r--r-- | drivers/scsi/fd_mcs.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/ncr53c8xx.c | 19 |
4 files changed, 24 insertions, 14 deletions
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 7c59bba98798..689dc4cc789c 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c | |||
| @@ -2186,21 +2186,21 @@ static int __init BusLogic_init(void) | |||
| 2186 | 2186 | ||
| 2187 | if (BusLogic_ProbeOptions.NoProbe) | 2187 | if (BusLogic_ProbeOptions.NoProbe) |
| 2188 | return -ENODEV; | 2188 | return -ENODEV; |
| 2189 | BusLogic_ProbeInfoList = (struct BusLogic_ProbeInfo *) | 2189 | BusLogic_ProbeInfoList = |
| 2190 | kmalloc(BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo), GFP_ATOMIC); | 2190 | kzalloc(BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo), GFP_KERNEL); |
| 2191 | if (BusLogic_ProbeInfoList == NULL) { | 2191 | if (BusLogic_ProbeInfoList == NULL) { |
| 2192 | BusLogic_Error("BusLogic: Unable to allocate Probe Info List\n", NULL); | 2192 | BusLogic_Error("BusLogic: Unable to allocate Probe Info List\n", NULL); |
| 2193 | return -ENOMEM; | 2193 | return -ENOMEM; |
| 2194 | } | 2194 | } |
| 2195 | memset(BusLogic_ProbeInfoList, 0, BusLogic_MaxHostAdapters * sizeof(struct BusLogic_ProbeInfo)); | 2195 | |
| 2196 | PrototypeHostAdapter = (struct BusLogic_HostAdapter *) | 2196 | PrototypeHostAdapter = |
| 2197 | kmalloc(sizeof(struct BusLogic_HostAdapter), GFP_ATOMIC); | 2197 | kzalloc(sizeof(struct BusLogic_HostAdapter), GFP_KERNEL); |
| 2198 | if (PrototypeHostAdapter == NULL) { | 2198 | if (PrototypeHostAdapter == NULL) { |
| 2199 | kfree(BusLogic_ProbeInfoList); | 2199 | kfree(BusLogic_ProbeInfoList); |
| 2200 | BusLogic_Error("BusLogic: Unable to allocate Prototype " "Host Adapter\n", NULL); | 2200 | BusLogic_Error("BusLogic: Unable to allocate Prototype " "Host Adapter\n", NULL); |
| 2201 | return -ENOMEM; | 2201 | return -ENOMEM; |
| 2202 | } | 2202 | } |
| 2203 | memset(PrototypeHostAdapter, 0, sizeof(struct BusLogic_HostAdapter)); | 2203 | |
| 2204 | #ifdef MODULE | 2204 | #ifdef MODULE |
| 2205 | if (BusLogic != NULL) | 2205 | if (BusLogic != NULL) |
| 2206 | BusLogic_Setup(BusLogic); | 2206 | BusLogic_Setup(BusLogic); |
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index d4613815f685..8578555d58fd 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c | |||
| @@ -220,9 +220,11 @@ static void *addresses[] = { | |||
| 220 | static unsigned short ports[] = { 0x230, 0x330, 0x280, 0x290, 0x330, 0x340, 0x300, 0x310, 0x348, 0x350 }; | 220 | static unsigned short ports[] = { 0x230, 0x330, 0x280, 0x290, 0x330, 0x340, 0x300, 0x310, 0x348, 0x350 }; |
| 221 | #define PORT_COUNT ARRAY_SIZE(ports) | 221 | #define PORT_COUNT ARRAY_SIZE(ports) |
| 222 | 222 | ||
| 223 | #ifndef MODULE | ||
| 223 | /* possible interrupt channels */ | 224 | /* possible interrupt channels */ |
| 224 | static unsigned short intrs[] = { 10, 11, 12, 15 }; | 225 | static unsigned short intrs[] = { 10, 11, 12, 15 }; |
| 225 | #define INTR_COUNT ARRAY_SIZE(intrs) | 226 | #define INTR_COUNT ARRAY_SIZE(intrs) |
| 227 | #endif /* !MODULE */ | ||
| 226 | 228 | ||
| 227 | /* signatures for NCR 53c406a based controllers */ | 229 | /* signatures for NCR 53c406a based controllers */ |
| 228 | #if USE_BIOS | 230 | #if USE_BIOS |
| @@ -605,6 +607,7 @@ static int NCR53c406a_release(struct Scsi_Host *shost) | |||
| 605 | return 0; | 607 | return 0; |
| 606 | } | 608 | } |
| 607 | 609 | ||
| 610 | #ifndef MODULE | ||
| 608 | /* called from init/main.c */ | 611 | /* called from init/main.c */ |
| 609 | static int __init NCR53c406a_setup(char *str) | 612 | static int __init NCR53c406a_setup(char *str) |
| 610 | { | 613 | { |
| @@ -661,6 +664,8 @@ static int __init NCR53c406a_setup(char *str) | |||
| 661 | 664 | ||
| 662 | __setup("ncr53c406a=", NCR53c406a_setup); | 665 | __setup("ncr53c406a=", NCR53c406a_setup); |
| 663 | 666 | ||
| 667 | #endif /* !MODULE */ | ||
| 668 | |||
| 664 | static const char *NCR53c406a_info(struct Scsi_Host *SChost) | 669 | static const char *NCR53c406a_info(struct Scsi_Host *SChost) |
| 665 | { | 670 | { |
| 666 | DEB(printk("NCR53c406a_info called\n")); | 671 | DEB(printk("NCR53c406a_info called\n")); |
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c index ef8285c326e4..668569e8856b 100644 --- a/drivers/scsi/fd_mcs.c +++ b/drivers/scsi/fd_mcs.c | |||
| @@ -294,6 +294,7 @@ static struct Scsi_Host *hosts[FD_MAX_HOSTS + 1] = { NULL }; | |||
| 294 | static int user_fifo_count = 0; | 294 | static int user_fifo_count = 0; |
| 295 | static int user_fifo_size = 0; | 295 | static int user_fifo_size = 0; |
| 296 | 296 | ||
| 297 | #ifndef MODULE | ||
| 297 | static int __init fd_mcs_setup(char *str) | 298 | static int __init fd_mcs_setup(char *str) |
| 298 | { | 299 | { |
| 299 | static int done_setup = 0; | 300 | static int done_setup = 0; |
| @@ -311,6 +312,7 @@ static int __init fd_mcs_setup(char *str) | |||
| 311 | } | 312 | } |
| 312 | 313 | ||
| 313 | __setup("fd_mcs=", fd_mcs_setup); | 314 | __setup("fd_mcs=", fd_mcs_setup); |
| 315 | #endif /* !MODULE */ | ||
| 314 | 316 | ||
| 315 | static void print_banner(struct Scsi_Host *shpnt) | 317 | static void print_banner(struct Scsi_Host *shpnt) |
| 316 | { | 318 | { |
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 6cc2bc2f62be..5a88fa0b2fc3 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c | |||
| @@ -589,10 +589,12 @@ static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd) | |||
| 589 | static struct ncr_driver_setup | 589 | static struct ncr_driver_setup |
| 590 | driver_setup = SCSI_NCR_DRIVER_SETUP; | 590 | driver_setup = SCSI_NCR_DRIVER_SETUP; |
| 591 | 591 | ||
| 592 | #ifndef MODULE | ||
| 592 | #ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT | 593 | #ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT |
| 593 | static struct ncr_driver_setup | 594 | static struct ncr_driver_setup |
| 594 | driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP; | 595 | driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP; |
| 595 | #endif | 596 | #endif |
| 597 | #endif /* !MODULE */ | ||
| 596 | 598 | ||
| 597 | #define initverbose (driver_setup.verbose) | 599 | #define initverbose (driver_setup.verbose) |
| 598 | #define bootverbose (np->verbose) | 600 | #define bootverbose (np->verbose) |
| @@ -641,6 +643,13 @@ static struct ncr_driver_setup | |||
| 641 | #define OPT_IARB 26 | 643 | #define OPT_IARB 26 |
| 642 | #endif | 644 | #endif |
| 643 | 645 | ||
| 646 | #ifdef MODULE | ||
| 647 | #define ARG_SEP ' ' | ||
| 648 | #else | ||
| 649 | #define ARG_SEP ',' | ||
| 650 | #endif | ||
| 651 | |||
| 652 | #ifndef MODULE | ||
| 644 | static char setup_token[] __initdata = | 653 | static char setup_token[] __initdata = |
| 645 | "tags:" "mpar:" | 654 | "tags:" "mpar:" |
| 646 | "spar:" "disc:" | 655 | "spar:" "disc:" |
| @@ -660,12 +669,6 @@ static char setup_token[] __initdata = | |||
| 660 | #endif | 669 | #endif |
| 661 | ; /* DONNOT REMOVE THIS ';' */ | 670 | ; /* DONNOT REMOVE THIS ';' */ |
| 662 | 671 | ||
| 663 | #ifdef MODULE | ||
| 664 | #define ARG_SEP ' ' | ||
| 665 | #else | ||
| 666 | #define ARG_SEP ',' | ||
| 667 | #endif | ||
| 668 | |||
| 669 | static int __init get_setup_token(char *p) | 672 | static int __init get_setup_token(char *p) |
| 670 | { | 673 | { |
| 671 | char *cur = setup_token; | 674 | char *cur = setup_token; |
| @@ -682,7 +685,6 @@ static int __init get_setup_token(char *p) | |||
| 682 | return 0; | 685 | return 0; |
| 683 | } | 686 | } |
| 684 | 687 | ||
| 685 | |||
| 686 | static int __init sym53c8xx__setup(char *str) | 688 | static int __init sym53c8xx__setup(char *str) |
| 687 | { | 689 | { |
| 688 | #ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT | 690 | #ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT |
| @@ -804,6 +806,7 @@ static int __init sym53c8xx__setup(char *str) | |||
| 804 | #endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */ | 806 | #endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */ |
| 805 | return 1; | 807 | return 1; |
| 806 | } | 808 | } |
| 809 | #endif /* !MODULE */ | ||
| 807 | 810 | ||
| 808 | /*=================================================================== | 811 | /*=================================================================== |
| 809 | ** | 812 | ** |
| @@ -8321,12 +8324,12 @@ char *ncr53c8xx; /* command line passed by insmod */ | |||
| 8321 | module_param(ncr53c8xx, charp, 0); | 8324 | module_param(ncr53c8xx, charp, 0); |
| 8322 | #endif | 8325 | #endif |
| 8323 | 8326 | ||
| 8327 | #ifndef MODULE | ||
| 8324 | static int __init ncr53c8xx_setup(char *str) | 8328 | static int __init ncr53c8xx_setup(char *str) |
| 8325 | { | 8329 | { |
| 8326 | return sym53c8xx__setup(str); | 8330 | return sym53c8xx__setup(str); |
| 8327 | } | 8331 | } |
| 8328 | 8332 | ||
| 8329 | #ifndef MODULE | ||
| 8330 | __setup("ncr53c8xx=", ncr53c8xx_setup); | 8333 | __setup("ncr53c8xx=", ncr53c8xx_setup); |
| 8331 | #endif | 8334 | #endif |
| 8332 | 8335 | ||
