public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix cciss/hpsa build errors
@ 2009-11-12  0:25 Alex Chiang
  2009-11-12  0:25 ` [PATCH 1/2] cciss: make device attrs static Alex Chiang
  2009-11-12  0:25 ` [PATCH 2/2] hpsa: " Alex Chiang
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Chiang @ 2009-11-12  0:25 UTC (permalink / raw)
  To: akpm, jens.axboe
  Cc: James Bottomley, Mike Miller, linux-kernel, Stephen M. Cameron

I recently tried to build mmotm, and configured both hpsa and cciss
as built-ins. I encountered the following build error since they
both export device attrs with the same name:

	drivers/scsi/built-in.o: multiple definition of `dev_attr_lunid'
	drivers/block/built-in.o: first defined here

The cciss patch seems obviously correct to me and would be appropriate
for the next .32-rc. But it's not critical, so if Jens wants to hold off
until next merge window, I'm fine with that.

The hpsa patch applies against mmotm. I haven't peeked at James's tree
to see if he's carrying hpsa, but my guess is "probably not". In that
case, I'm hoping Andrew can carry it until hpsa gets merged.

Thanks,
/ac

---

Alex Chiang (2):
      cciss: make device attrs static
      hpsa: make device attrs static


 drivers/block/cciss.c |   16 ++++++++--------
 drivers/scsi/hpsa.c   |    8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] cciss: make device attrs static
  2009-11-12  0:25 [PATCH 0/2] Fix cciss/hpsa build errors Alex Chiang
@ 2009-11-12  0:25 ` Alex Chiang
  2009-11-12  0:25 ` [PATCH 2/2] hpsa: " Alex Chiang
  1 sibling, 0 replies; 5+ messages in thread
From: Alex Chiang @ 2009-11-12  0:25 UTC (permalink / raw)
  To: akpm, jens.axboe; +Cc: linux-kernel, Stephen M. Cameron

No need to export those device attributes.

In fact, without this patch, we can trip over a build error if cciss
is a built-in and another driver also declares and exports attributes
with the same name.

You'll see errors like:

	drivers/scsi/built-in.o: multiple definition of `dev_attr_lunid'
	drivers/block/built-in.o: first defined here

Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
---

 drivers/block/cciss.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 6399e50..92b1263 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -482,7 +482,7 @@ static ssize_t host_store_rescan(struct device *dev,
 
 	return count;
 }
-DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
+static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
 
 static ssize_t dev_show_unique_id(struct device *dev,
 				 struct device_attribute *attr,
@@ -512,7 +512,7 @@ static ssize_t dev_show_unique_id(struct device *dev,
 				sn[8], sn[9], sn[10], sn[11],
 				sn[12], sn[13], sn[14], sn[15]);
 }
-DEVICE_ATTR(unique_id, S_IRUGO, dev_show_unique_id, NULL);
+static DEVICE_ATTR(unique_id, S_IRUGO, dev_show_unique_id, NULL);
 
 static ssize_t dev_show_vendor(struct device *dev,
 			       struct device_attribute *attr,
@@ -536,7 +536,7 @@ static ssize_t dev_show_vendor(struct device *dev,
 	else
 		return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor);
 }
-DEVICE_ATTR(vendor, S_IRUGO, dev_show_vendor, NULL);
+static DEVICE_ATTR(vendor, S_IRUGO, dev_show_vendor, NULL);
 
 static ssize_t dev_show_model(struct device *dev,
 			      struct device_attribute *attr,
@@ -560,7 +560,7 @@ static ssize_t dev_show_model(struct device *dev,
 	else
 		return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model);
 }
-DEVICE_ATTR(model, S_IRUGO, dev_show_model, NULL);
+static DEVICE_ATTR(model, S_IRUGO, dev_show_model, NULL);
 
 static ssize_t dev_show_rev(struct device *dev,
 			    struct device_attribute *attr,
@@ -584,7 +584,7 @@ static ssize_t dev_show_rev(struct device *dev,
 	else
 		return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev);
 }
-DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL);
+static DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL);
 
 static ssize_t cciss_show_lunid(struct device *dev,
 				struct device_attribute *attr, char *buf)
@@ -609,7 +609,7 @@ static ssize_t cciss_show_lunid(struct device *dev,
 		lunid[0], lunid[1], lunid[2], lunid[3],
 		lunid[4], lunid[5], lunid[6], lunid[7]);
 }
-DEVICE_ATTR(lunid, S_IRUGO, cciss_show_lunid, NULL);
+static DEVICE_ATTR(lunid, S_IRUGO, cciss_show_lunid, NULL);
 
 static ssize_t cciss_show_raid_level(struct device *dev,
 				     struct device_attribute *attr, char *buf)
@@ -632,7 +632,7 @@ static ssize_t cciss_show_raid_level(struct device *dev,
 	return snprintf(buf, strlen(raid_label[raid]) + 7, "RAID %s\n",
 			raid_label[raid]);
 }
-DEVICE_ATTR(raid_level, S_IRUGO, cciss_show_raid_level, NULL);
+static DEVICE_ATTR(raid_level, S_IRUGO, cciss_show_raid_level, NULL);
 
 static ssize_t cciss_show_usage_count(struct device *dev,
 				      struct device_attribute *attr, char *buf)
@@ -651,7 +651,7 @@ static ssize_t cciss_show_usage_count(struct device *dev,
 	spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
 	return snprintf(buf, 20, "%d\n", count);
 }
-DEVICE_ATTR(usage_count, S_IRUGO, cciss_show_usage_count, NULL);
+static DEVICE_ATTR(usage_count, S_IRUGO, cciss_show_usage_count, NULL);
 
 static struct attribute *cciss_host_attrs[] = {
 	&dev_attr_rescan.attr,


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] hpsa: make device attrs static
  2009-11-12  0:25 [PATCH 0/2] Fix cciss/hpsa build errors Alex Chiang
  2009-11-12  0:25 ` [PATCH 1/2] cciss: make device attrs static Alex Chiang
@ 2009-11-12  0:25 ` Alex Chiang
  2009-11-12  1:12   ` Alex Chiang
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Chiang @ 2009-11-12  0:25 UTC (permalink / raw)
  To: akpm, jens.axboe
  Cc: James Bottomley, Mike Miller, linux-kernel, Stephen M. Cameron

No need to export those device attributes.

In fact, without this patch, we can trip over a build error if hpsa
is a built-in and another driver also declares and exports attributes
with the same name.

You'll see errors like:

	drivers/scsi/built-in.o: multiple definition of `dev_attr_lunid'
	drivers/block/built-in.o: first defined here

Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Cc: Mike Miller <mikem@beardog.cce.hp.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
---

 drivers/scsi/hpsa.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index e402155..aae5f5a 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -146,11 +146,11 @@ static ssize_t lunid_show(struct device *dev,
 static ssize_t unique_id_show(struct device *dev,
 	struct device_attribute *attr, char *buf);
 
-DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
-DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
-DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
+static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
+static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
+static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
 
-struct device_attribute *hpsa_sdev_attrs[] = {
+static struct device_attribute *hpsa_sdev_attrs[] = {
 	&dev_attr_raid_level,
 	&dev_attr_lunid,
 	&dev_attr_unique_id,


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] hpsa: make device attrs static
  2009-11-12  0:25 ` [PATCH 2/2] hpsa: " Alex Chiang
@ 2009-11-12  1:12   ` Alex Chiang
  2009-11-12 13:56     ` scameron
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Chiang @ 2009-11-12  1:12 UTC (permalink / raw)
  To: akpm, jens.axboe
  Cc: James Bottomley, Mike Miller, linux-kernel, Stephen M. Cameron

Ah whoops --

* Alex Chiang <achiang@hp.com>:
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index e402155..aae5f5a 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -146,11 +146,11 @@ static ssize_t lunid_show(struct device *dev,
>  static ssize_t unique_id_show(struct device *dev,
>  	struct device_attribute *attr, char *buf);
>  
> -DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
> -DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
> -DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
> +static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
> +static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
> +static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
>  
> -struct device_attribute *hpsa_sdev_attrs[] = {
> +static struct device_attribute *hpsa_sdev_attrs[] = {
>  	&dev_attr_raid_level,
>  	&dev_attr_lunid,
>  	&dev_attr_unique_id,
 
This will conflict with the patch that Stephen sent earlier today

	[PATCH 11/17] hpsa: Make hpsa_sdev_attrs static
	Message-ID: <20091111165119.17754.81784.stgit@beardog.cce.hp.com>

My patch does more. ;)

I suggest whoever picks up Stephen's series drops his 11/17 patch
and takes mine instead.

On the other hand, Stephen, if you have to go through some
revisions and end up reposting your patch set, can you pick this
one up too?

Thanks,
/ac


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] hpsa: make device attrs static
  2009-11-12  1:12   ` Alex Chiang
@ 2009-11-12 13:56     ` scameron
  0 siblings, 0 replies; 5+ messages in thread
From: scameron @ 2009-11-12 13:56 UTC (permalink / raw)
  To: Alex Chiang; +Cc: akpm, jens.axboe, James Bottomley, Mike Miller, linux-kernel

On Wed, Nov 11, 2009 at 06:12:45PM -0700, Alex Chiang wrote:
> Ah whoops --
> 
> * Alex Chiang <achiang@hp.com>:
> > 
> > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> > index e402155..aae5f5a 100644
> > --- a/drivers/scsi/hpsa.c
> > +++ b/drivers/scsi/hpsa.c
> > @@ -146,11 +146,11 @@ static ssize_t lunid_show(struct device *dev,
> >  static ssize_t unique_id_show(struct device *dev,
> >  	struct device_attribute *attr, char *buf);
> >  
> > -DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
> > -DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
> > -DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
> > +static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);
> > +static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL);
> > +static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
> >  
> > -struct device_attribute *hpsa_sdev_attrs[] = {
> > +static struct device_attribute *hpsa_sdev_attrs[] = {
> >  	&dev_attr_raid_level,
> >  	&dev_attr_lunid,
> >  	&dev_attr_unique_id,
>  
> This will conflict with the patch that Stephen sent earlier today
> 
> 	[PATCH 11/17] hpsa: Make hpsa_sdev_attrs static
> 	Message-ID: <20091111165119.17754.81784.stgit@beardog.cce.hp.com>
> 
> My patch does more. ;)
> 
> I suggest whoever picks up Stephen's series drops his 11/17 patch
> and takes mine instead.
> 
> On the other hand, Stephen, if you have to go through some
> revisions and end up reposting your patch set, can you pick this
> one up too?

Sounds good.  Thanks.

-- steve

> 
> Thanks,
> /ac



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-12 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12  0:25 [PATCH 0/2] Fix cciss/hpsa build errors Alex Chiang
2009-11-12  0:25 ` [PATCH 1/2] cciss: make device attrs static Alex Chiang
2009-11-12  0:25 ` [PATCH 2/2] hpsa: " Alex Chiang
2009-11-12  1:12   ` Alex Chiang
2009-11-12 13:56     ` scameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox