Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755351AbYARHbD (ORCPT ); Fri, 18 Jan 2008 02:31:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752220AbYARHav (ORCPT ); Fri, 18 Jan 2008 02:30:51 -0500 Received: from E23SMTP03.au.ibm.com ([202.81.18.172]:58097 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbYARHau (ORCPT ); Fri, 18 Jan 2008 02:30:50 -0500 Date: Fri, 18 Jan 2008 13:00:45 +0530 From: Kamalesh Babulal To: Tejun Heo Cc: Kamalesh Babulal , Andrew Morton , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, fischer@norbit.de, Andy Whitcroft , Balbir Singh , Samuel Ortiz , James Bottomley Subject: Re: [PATCH] SCSI: fix isa/pcmcia compile problem Message-ID: <20080118073045.GB6883@linux.vnet.ibm.com> Reply-To: Kamalesh Babulal References: <20080117023514.9df393cf.akpm@linux-foundation.org> <478F7F2B.9000801@linux.vnet.ibm.com> <20080117111104.3baa878e.akpm@linux-foundation.org> <47904927.1040000@linux.vnet.ibm.com> <47905348.1000709@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47905348.1000709@gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10888 Lines: 331 On Fri, Jan 18, 2008 at 04:20:40PM +0900, Tejun Heo wrote: > aha152x.c and fdomain are built twice - once for the isa driver and > once for the PCMCIA one. Through #ifdefs, the compiled codes are > slightly different; thus, global symbols need to be given different > names depending on which flavor is being built. This patch adds > GLOBAL() macro to aha152x.h and fdomain.h which change the symbol > depending on PCMCIA. > > This bug has always existed but has been masked by the fact the > drivers/scsi/pcmcia used subdir-(y|m) instead of obj-(y|m) which made > drivers/scsi/pcmcia/built_in.o not linked into the kernel and thus > avoided the duplicate symbols during compilation. > Hi Tejun Heo, Thanks, I have tested the patch, it fixes both build failures. Tested-by: Kamalesh Babulal Signed-off-by: Tejun Heo --- Ah... missed that one. Here's the updated version. drivers/scsi/aha152x.c | 12 ++++++------ drivers/scsi/aha152x.h | 20 +++++++++++++++++--- drivers/scsi/fdomain.c | 20 ++++++++++---------- drivers/scsi/fdomain.h | 21 +++++++++++++++++---- drivers/scsi/pcmcia/aha152x_stub.c | 10 ++++++---- drivers/scsi/pcmcia/fdomain_stub.c | 10 ++++++---- 6 files changed, 62 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index ea8c699..0204f44 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -769,7 +769,7 @@ static irqreturn_t swintr(int irqno, void *dev_id) return IRQ_HANDLED; } -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *setup) { struct Scsi_Host *shpnt; @@ -905,7 +905,7 @@ out_host_put: return NULL; } -void aha152x_release(struct Scsi_Host *shpnt) +void GLOBAL(aha152x_release)(struct Scsi_Host *shpnt) { if (!shpnt) return; @@ -1327,7 +1327,7 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ -int aha152x_host_reset_host(struct Scsi_Host *shpnt) +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *shpnt) { DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no); @@ -1345,7 +1345,7 @@ int aha152x_host_reset_host(struct Scsi_Host *shpnt) */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { - return aha152x_host_reset_host(SCpnt->device->host); + return GLOBAL(aha152x_host_reset_host)(SCpnt->device->host); } /* @@ -3916,7 +3916,7 @@ static int __init aha152x_init(void) for (i=0; i -#include "aha152x.h" #include #include #include #include +#define PCMCIA 1 +#include "aha152x.h" + #ifdef PCMCIA_DEBUG static int pc_debug = PCMCIA_DEBUG; module_param(pc_debug, int, 0644); @@ -194,7 +196,7 @@ static int aha152x_config_cs(struct pcmcia_device *link) if (ext_trans) s.ext_trans = ext_trans; - host = aha152x_probe_one(&s); + host = GLOBAL(aha152x_probe_one)(&s); if (host == NULL) { printk(KERN_INFO "aha152x_cs: no SCSI devices found\n"); goto cs_failed; @@ -216,7 +218,7 @@ static void aha152x_release_cs(struct pcmcia_device *link) { scsi_info_t *info = link->priv; - aha152x_release(info->host); + GLOBAL(aha152x_release)(info->host); pcmcia_disable_device(link); } @@ -224,7 +226,7 @@ static int aha152x_resume(struct pcmcia_device *link) { scsi_info_t *info = link->priv; - aha152x_host_reset_host(info->host); + GLOBAL(aha152x_host_reset_host)(info->host); return 0; } diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 4b82b20..b075576 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c @@ -44,13 +44,15 @@ #include "scsi.h" #include -#include "fdomain.h" #include #include #include #include +#define PCMCIA 1 +#include "fdomain.h" + /*====================================================================*/ /* Module parameters */ @@ -161,9 +163,9 @@ static int fdomain_config(struct pcmcia_device *link) /* Set configuration options for the fdomain driver */ sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); - fdomain_setup(str); + GLOBAL(fdomain_setup)(str); - host = __fdomain_16x0_detect(&fdomain_driver_template); + host = GLOBAL(__fdomain_16x0_detect)(&GLOBAL(fdomain_driver_template)); if (!host) { printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); goto cs_failed; @@ -202,7 +204,7 @@ static void fdomain_release(struct pcmcia_device *link) static int fdomain_resume(struct pcmcia_device *link) { - fdomain_16x0_bus_reset(NULL); + GLOBAL(fdomain_16x0_bus_reset)(NULL); return 0; } diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/