linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	fischer@norbit.de, Andy Whitcroft <apw@shadowen.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Samuel Ortiz <samuel@sortiz.org>,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH] aha152x: fix isa/pcmcia compile problem
Date: Fri, 18 Jan 2008 11:59:26 +0530	[thread overview]
Message-ID: <20080118062926.GA6883@linux.vnet.ibm.com> (raw)
In-Reply-To: <478FF87C.2050307@gmail.com>

On Fri, Jan 18, 2008 at 09:53:16AM +0900, Tejun Heo wrote:
> aha152x.c is 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 which changes 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.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
>  drivers/scsi/aha152x.c             |   12 ++++++------
>  drivers/scsi/aha152x.h             |   20 +++++++++++++++++---
>  drivers/scsi/pcmcia/aha152x_stub.c |   10 ++++++----
>  3 files changed, 29 insertions(+), 13 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<setup_count; i++) {
>  		if ( request_region(setup[i].io_port, IO_RANGE, "aha152x") ) {
> -			struct Scsi_Host *shpnt = aha152x_probe_one(&setup[i]);
> +			struct Scsi_Host *shpnt = GLOBAL(aha152x_probe_one)(&setup[i]);
> 
>  			if( !shpnt ) {
>  				release_region(setup[i].io_port, IO_RANGE);
> @@ -3946,7 +3946,7 @@ static void __exit aha152x_exit(void)
>  	list_for_each_entry(hd, &aha152x_host_list, host_list) {
>  		struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata);
> 
> -		aha152x_release(shost);
> +		GLOBAL(aha152x_release)(shost);
>  	}
>  }
> 
> diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h
> index ac4bfa4..7db6c47 100644
> --- a/drivers/scsi/aha152x.h
> +++ b/drivers/scsi/aha152x.h
> @@ -330,8 +330,22 @@ struct aha152x_setup {
>  	char *conf;
>  };
> 
> -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *);
> -void aha152x_release(struct Scsi_Host *);
> -int aha152x_host_reset_host(struct Scsi_Host *);
> +/*
> + * This file and aha152x.c are compiled in two different ways - for
> + * the isa driver and pcmcia one.  When building the pcmcia one, the
> + * file is slightly modified, so they can't share the same object
> + * file.  The following macro alters a symbol depending on whether
> + * pcmcia driver is being built or not and should be used for any
> + * global symbol.
> + */
> +#if defined(PCMCIA)
> +#define GLOBAL(x)	CS_##x
> +#else
> +#define GLOBAL(x)	x
> +#endif
> +
> +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *);
> +void GLOBAL(aha152x_release)(struct Scsi_Host *);
> +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *);
> 
>  #endif /* _AHA152X_H */
> diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
> index 2dd0dc9..57f83d1 100644
> --- a/drivers/scsi/pcmcia/aha152x_stub.c
> +++ b/drivers/scsi/pcmcia/aha152x_stub.c
> @@ -47,13 +47,15 @@
> 
>  #include "scsi.h"
>  #include <scsi/scsi_host.h>
> -#include "aha152x.h"
> 
>  #include <pcmcia/cs_types.h>
>  #include <pcmcia/cs.h>
>  #include <pcmcia/cistpl.h>
>  #include <pcmcia/ds.h>
> 
> +#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/fs/sysfs/dir.c b/fs/sysfs/dir.c
> --
Hi Tejun Heo,

Thanks, I have tested the patch fixes the build failure on aha152x.c.
Tested-By: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>

Thanks & Regards,
Kamalesh Babulal.

  reply	other threads:[~2008-01-18  6:30 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17 10:35 2.6.24-rc8-mm1 Andrew Morton
2008-01-17 12:41 ` 2.6.24-rc8-mm1 Build Failure on S390x Kamalesh Babulal
2008-01-17 14:05   ` Martin Schwidefsky
2008-01-17 12:46 ` 2.6.24-rc8-mm1 Balbir Singh
2008-01-17 18:40   ` 2.6.24-rc8-mm1 Andrew Morton
2008-01-17 19:22     ` 2.6.24-rc8-mm1 Pallipadi, Venkatesh
2008-01-17 19:40       ` 2.6.24-rc8-mm1 Andrew Morton
2008-01-17 19:47         ` [E1000-devel] 2.6.24-rc8-mm1 Brandeburg, Jesse
2008-01-17 23:33         ` 2.6.24-rc8-mm1 Venki Pallipadi
2008-01-17 23:04       ` 2.6.24-rc8-mm1 Balbir Singh
2008-01-18  1:42         ` 2.6.24-rc8-mm1 Siddha, Suresh B
2008-01-18  5:06           ` 2.6.24-rc8-mm1 Balbir Singh
2008-01-17 20:25     ` 2.6.24-rc8-mm1 Balbir Singh
2008-01-17 13:21 ` [-mm Patch] UML: fix a building error WANG Cong
2008-01-17 17:59   ` Jeff Dike
2008-01-17 13:34 ` 2.6.24-rc8-mm1 Kamalesh Babulal
2008-01-17 14:26   ` 2.6.24-rc8-mm1 Ingo Molnar
2008-01-17 13:54 ` 2.6.24-rc8-mm1 kernel panic while bootup Kamalesh Babulal
2008-01-17 18:54   ` Andrew Morton
2008-01-17 19:00     ` Randy Dunlap
2008-01-20  6:24     ` Kamalesh Babulal
2008-01-20  7:17       ` Andrew Morton
2008-01-17 13:56 ` [-mm Patch] uml: fix a building error WANG Cong
2008-01-17 17:59   ` Jeff Dike
2008-01-17 18:11   ` Mariusz Kozlowski
2008-01-17 18:56     ` Andrew Morton
2008-01-17 19:38       ` Pallipadi, Venkatesh
2008-01-17 19:44         ` Andrew Morton
2008-01-17 20:42         ` Mariusz Kozlowski
2008-01-17 21:14         ` Jeff Dike
2008-01-17 21:41           ` Venki Pallipadi
2008-01-17 23:08             ` Jeff Dike
2008-01-17 23:17               ` Pallipadi, Venkatesh
2008-01-18  2:19                 ` Jeff Dike
2008-01-17 18:56     ` Jeff Dike
2008-01-17 15:23 ` do_md_run returned -22 [Was: 2.6.24-rc8-mm1] Jiri Slaby
2008-01-17 19:01   ` Andrew Morton
2008-01-17 23:15     ` Neil Brown
2008-01-17 16:15 ` 2.6.24-rc8-mm1 Build Failure on scsi driver Kamalesh Babulal
2008-01-17 19:11   ` Andrew Morton
2008-01-18  0:53     ` [PATCH] aha152x: fix isa/pcmcia compile problem Tejun Heo
2008-01-18  6:29       ` Kamalesh Babulal [this message]
2008-01-18  6:37     ` 2.6.24-rc8-mm1 Build Failure on scsi driver Kamalesh Babulal
2008-01-18  7:20       ` [PATCH] SCSI: fix isa/pcmcia compile problem Tejun Heo
2008-01-18  7:30         ` Kamalesh Babulal
2008-01-18 14:58         ` James Bottomley
2008-01-18 23:27           ` Tejun Heo
2008-01-18 23:28             ` Tejun Heo
2008-01-18 23:32             ` James Bottomley
2008-01-18 23:46               ` Tejun Heo
2008-01-18 23:47               ` James Bottomley
2008-01-18 23:54                 ` Tejun Heo
2008-01-21  9:56         ` Christoph Hellwig
2008-01-21 14:59           ` James Bottomley
2008-01-18  7:27       ` 2.6.24-rc8-mm1 Build Failure on scsi driver Andrew Morton
2008-01-17 16:48 ` 2.6.24-rc8-mm1 (BUG: sched_rt) Randy Dunlap
2008-01-17 17:11   ` Peter Zijlstra
2008-01-17 18:05     ` Randy Dunlap
2008-01-17 19:14     ` Randy Dunlap
2008-01-17 19:38       ` Andrew Morton
2008-01-17 17:15   ` Peter Zijlstra
2008-01-17 17:28 ` x86 refuses to build [Re: 2.6.24-rc8-mm1] Dhaval Giani
2008-01-17 18:44   ` Dhaval Giani
2008-01-18  8:59     ` Ingo Molnar
2008-01-18 16:16       ` Mike Travis
2008-01-17 18:13 ` 2.6.24-rc8-mm1: broken suspend Rafael J. Wysocki
2008-01-17 18:18 ` 2.6.24-rc8-mm1: powerpc: include/asm/nvram.h:62: error: field 'partition' has incomplete type Mariusz Kozlowski
2008-01-17 19:27   ` Andrew Morton
2008-01-17 19:06 ` 2.6.24-rc8-mm1 powerpc build errors Olof Johansson
2008-01-17 19:35   ` Andrew Morton
2008-01-17 22:00     ` Greg KH
2008-01-17 21:10 ` 2.6.24-rc8-mm1 Matt Mackall
2008-01-18  1:29   ` 2.6.24-rc8-mm1 Matt Mackall
2008-01-18  5:08     ` 2.6.24-rc8-mm1 Andrew Morton
2008-01-18 13:55       ` 2.6.24-rc8-mm1 Matt Mackall
2008-01-17 21:29 ` 2.6.24-rc8-mm1 - mkubootimg wants <zlib.h> Joseph Fannin
2008-01-17 22:21   ` Josh Boyer
2008-01-17 22:15 ` 2.6.24-rc8-mm1: powerpc oopses Mariusz Kozlowski
2008-01-17 22:51   ` Andrew Morton
2008-01-17 23:39     ` Matt Mackall
2008-01-18  0:05       ` Andrew Morton
2008-01-18  0:12         ` Matt Mackall
2008-01-18  0:29           ` Andrew Morton
2008-01-18  0:47             ` Matt Mackall
2008-01-18  1:07               ` Andrew Morton
2008-01-18  1:16                 ` Matt Mackall
2008-01-18 17:23               ` Mariusz Kozlowski
2008-01-18 17:33                 ` Matt Mackall
2008-01-18  6:14 ` 2.6.24-rc8-mm1 Build Failure at scripts/mkubooting/crc32.c Kamalesh Babulal
2008-01-18  8:06   ` Sam Ravnborg
2008-01-20 15:30   ` Mel Gorman
2008-01-18  7:09 ` 2.6.24-rc8-mm1 build failure on headers_check Kamalesh Babulal
2008-01-18  7:38   ` Andrew Morton
2008-01-18  8:36 ` 2.6.24-rc8-mm1 Kernel oops will running kernbench Kamalesh Babulal
2008-01-18  8:44   ` Andrew Morton
2008-01-18  9:01     ` Paul Mackerras
2008-01-18  9:34       ` Kamalesh Babulal
2008-01-18 10:19         ` Paul Mackerras
2008-01-18 10:26         ` Paul Mackerras
2008-01-18 10:44           ` Kamalesh Babulal
2008-01-18 10:54             ` Balbir Singh
2008-01-25  6:05           ` 2.6.24 Kernel oops will running kernbench regression from 2.6.24-rc8-mm1 Kamalesh Babulal
2008-01-18 13:34 ` 2.6.24-rc8-mm1: broken suspend (due to git-cpufreq.patch) Rafael J. Wysocki
2008-01-18 16:53   ` Dave Jones
2008-01-18 17:10   ` Dave Jones
2008-01-18 20:50     ` Rafael J. Wysocki
2008-01-18 21:55       ` Rafael J. Wysocki
2008-01-18 17:26 ` 2.6.24-rc8-mm1 (KVM build issues) Balbir Singh
2008-01-22  8:40   ` Andrew Morton
2008-01-18 18:06 ` 2.6.24-rc8-mm1 Kyle McMartin
2008-01-20  1:10 ` 2.6.24-rc8-mm1: WARN_ON() in clockevents_register_device() on HP nx6325 Rafael J. Wysocki
2008-01-20 10:24   ` Ingo Molnar
2008-01-20 11:21     ` Rafael J. Wysocki
2008-01-20 16:31 ` 2.6.24-rc8-mm1 Mel Gorman
2008-01-20 16:35   ` 2.6.24-rc8-mm1 Balbir Singh
2008-01-20 18:24     ` 2.6.24-rc8-mm1 Mel Gorman
2008-01-21 18:31 ` 2.6.24-rc8-mm1 - SELinux issues Valdis.Kletnieks
2008-01-21 18:53 ` [PATCH} 2.6.24-rc8-mm1 - x86_64 PAT issues with vesafb and NVidia cards Valdis.Kletnieks
2008-01-22 20:30 ` 2.6.24-rc8-mm1: sparc64 warning at fs/file_table.c:49 __fput+0x1a8/0x1e0() Mariusz Kozlowski
2008-01-22 21:02   ` Andrew Morton
2008-01-22 22:28     ` Dave Hansen
2008-01-22 23:13     ` Dave Hansen
2008-01-23  5:47       ` Christoph Hellwig
2008-02-01 23:34       ` Andrew Morton
2008-01-24  6:09 ` 2.6.24-rc8-mm1 Kernel oops on CIFS while running fsstress Kamalesh Babulal
2008-01-24  6:44 ` 2.6.24-rc8-mm1 Badness at net/ipv4/tcp_input.c:2506 Kamalesh Babulal
2008-01-25  0:04 ` 2.6.24-rc8-mm1: old sparc64 bug Mariusz Kozlowski
2008-01-25 17:11   ` Takashi Iwai
2008-01-25 18:34     ` Mariusz Kozlowski
2008-01-28 11:55       ` Takashi Iwai
2008-01-28 22:13         ` Mariusz Kozlowski
2008-01-25 21:59 ` 2.6.24-rc8-mm1 Torsten Kaiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080118062926.GA6883@linux.vnet.ibm.com \
    --to=kamalesh@linux.vnet.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=fischer@norbit.de \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=samuel@sortiz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).