Re: [Patch] Shut up warnings from files under drivers/

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff Garzik <jeff@...>
Cc: WANG Cong <xiyou.wangcong@...>, Greg KH <gregkh@...>, LKML <linux-kernel@...>, Andrew Morton <akpm@...>
Date: Saturday, January 26, 2008 - 3:17 pm

On Sat, Jan 26, 2008 at 04:55:58AM -0500, Jeff Garzik wrote:

I checked up on the synclink.c warning.
We have the following code:

static void synclink_remove_one (struct pci_dev *dev);

...

static struct pci_driver synclink_pci_driver = {
        .remove         = __devexit_p(synclink_remove_one),
};

...

static void __devexit synclink_remove_one (struct pci_dev *dev)
{
}

And I double checked the preprocessed source to check
that we applied the __attribute__((__used__)) to the function.

Investigating a bit more I realized that gcc looses the
__used__ attribution due to the prototype.
So there are two correct fixes:
a) move the function up so we do not need the forward
   declaration
b) add a __devexit to the forward decalration too.

I strongly prefer the first version and this is the
correct fix for these cases.

Do we have a gcc bug here - I did not see a definitive answer in gcc docs?

	Sam
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Patch] Shut up warnings from files under drivers/, WANG Cong, (Sat Jan 26, 5:30 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 5:57 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 6:21 am)
Re: [Patch] Shut up warnings from files under drivers/, Jeff Garzik, (Sat Jan 26, 5:55 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 3:17 pm)
[PATCH 2/2] Char: applicom, use pci_match_id, Jiri Slaby, (Wed Jan 30, 7:13 am)
Re: [PATCH 2/2] Char: applicom, use pci_match_id, Andrew Morton, (Wed Jan 30, 7:10 pm)
Re: [PATCH 2/2] Char: applicom, use pci_match_id, Jiri Slaby, (Thu Jan 31, 5:26 am)
[PATCH 1/2] Char: applicom, use pci_resource_start, Jiri Slaby, (Wed Jan 30, 7:13 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 3:30 pm)
Re: [Patch] Shut up warnings from files under drivers/, Jeff Garzik, (Sat Jan 26, 7:44 am)