public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6.27-rc4-git4] compilation warnings
@ 2008-08-26  9:37 Rufus & Azrael
  2008-08-26 15:20 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Rufus & Azrael @ 2008-08-26  9:37 UTC (permalink / raw)
  To: Linux-kernel Mailing List; +Cc: Greg KH, Jesse Barnes

Hello all,

Fresh 2.6.27-rc4-git4 causes these compilation warnings on my amd64 box 
with gcc-4.3.1 :

drivers/pci/search.c: In function ‘pci_get_dev_by_id’:
drivers/pci/search.c:284: attention : passing argument 1 of 
‘pci_dev_put’ discards qualifiers from pointer target type

following this commit : ebca4f1bce1eb7b91a63c515db66316db9391221 
PCI: fix reference leak in pci_get_dev_by_id()
---
drivers/video/aty/aty128fb.c: In function ‘aty128_decode_var’:
drivers/video/aty/aty128fb.c:1520: attention : ‘pll.post_divider’ may be 
used uninitialized in this function

Regards.


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

* Re: [2.6.27-rc4-git4] compilation warnings
  2008-08-26  9:37 [2.6.27-rc4-git4] compilation warnings Rufus & Azrael
@ 2008-08-26 15:20 ` Greg KH
  2008-08-26 16:08   ` Jesse Barnes
  2008-08-27 23:35   ` Jesse Barnes
  0 siblings, 2 replies; 5+ messages in thread
From: Greg KH @ 2008-08-26 15:20 UTC (permalink / raw)
  To: Rufus & Azrael; +Cc: Linux-kernel Mailing List, Jesse Barnes

On Tue, Aug 26, 2008 at 11:37:46AM +0200, Rufus & Azrael wrote:
> Hello all,
>
> Fresh 2.6.27-rc4-git4 causes these compilation warnings on my amd64 box 
> with gcc-4.3.1 :
>
> drivers/pci/search.c: In function ‘pci_get_dev_by_id’:
> drivers/pci/search.c:284: attention : passing argument 1 of 
> ‘pci_dev_put’ discards qualifiers from pointer target type
>
> following this commit : ebca4f1bce1eb7b91a63c515db66316db9391221 PCI: fix 
> reference leak in pci_get_dev_by_id()

Ick, sorry about that, I said my fix was not even build tested :)

Here's a fix for this, Jesse, care to forward this on?

thanks,

greg k-h

--------------

From: Greg Kroah-Hartman <gregkh@suse.de>
Subject: PCI: fix compiler warnings in pci_get_subsys()

From: Greg Kroah-Hartman <gregkh@suse.de>

pci_get_subsys() changed in 2.6.26 so that the from pointer is modified when
the call is being invoked, so fix up the 'const' marking of it that the
compiler is complaining about.

Reported-by: Rufus & Azrael <rufus-azrael@numericable.fr>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/search.c |    6 +++---
 include/linux/pci.h  |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -162,7 +162,7 @@ EXPORT_SYMBOL(pci_find_slot);
  * time.
  */
 struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device,
-				const struct pci_dev *from)
+				struct pci_dev *from)
 {
 	struct pci_dev *pdev;
 
@@ -263,7 +263,7 @@ static int match_pci_dev_by_id(struct de
  * this file.
  */
 static struct pci_dev *pci_get_dev_by_id(const struct pci_device_id *id,
-					 const struct pci_dev *from)
+					 struct pci_dev *from)
 {
 	struct device *dev;
 	struct device *dev_start = NULL;
@@ -303,7 +303,7 @@ static struct pci_dev *pci_get_dev_by_id
  */
 struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
 			       unsigned int ss_vendor, unsigned int ss_device,
-			       const struct pci_dev *from)
+			       struct pci_dev *from)
 {
 	struct pci_dev *pdev;
 	struct pci_device_id *id;
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -534,7 +534,7 @@ extern void pci_sort_breadthfirst(void);
 #ifdef CONFIG_PCI_LEGACY
 struct pci_dev __deprecated *pci_find_device(unsigned int vendor,
 					     unsigned int device,
-					     const struct pci_dev *from);
+					     struct pci_dev *from);
 struct pci_dev __deprecated *pci_find_slot(unsigned int bus,
 					   unsigned int devfn);
 #endif /* CONFIG_PCI_LEGACY */
@@ -550,7 +550,7 @@ struct pci_dev *pci_get_device(unsigned 
 				struct pci_dev *from);
 struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
 				unsigned int ss_vendor, unsigned int ss_device,
-				const struct pci_dev *from);
+				struct pci_dev *from);
 struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
 struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
 struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
@@ -816,7 +816,7 @@ _PCI_NOP_ALL(write,)
 
 static inline struct pci_dev *pci_find_device(unsigned int vendor,
 					      unsigned int device,
-					      const struct pci_dev *from)
+					      struct pci_dev *from)
 {
 	return NULL;
 }
@@ -838,7 +838,7 @@ static inline struct pci_dev *pci_get_su
 					     unsigned int device,
 					     unsigned int ss_vendor,
 					     unsigned int ss_device,
-					     const struct pci_dev *from)
+					     struct pci_dev *from)
 {
 	return NULL;
 }

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

* Re: [2.6.27-rc4-git4] compilation warnings
  2008-08-26 15:20 ` Greg KH
@ 2008-08-26 16:08   ` Jesse Barnes
  2008-08-26 16:20     ` Rufus & Azrael
  2008-08-27 23:35   ` Jesse Barnes
  1 sibling, 1 reply; 5+ messages in thread
From: Jesse Barnes @ 2008-08-26 16:08 UTC (permalink / raw)
  To: Greg KH; +Cc: Rufus & Azrael, Linux-kernel Mailing List

On Tuesday, August 26, 2008 8:20 am Greg KH wrote:
> On Tue, Aug 26, 2008 at 11:37:46AM +0200, Rufus & Azrael wrote:
> > Hello all,
> >
> > Fresh 2.6.27-rc4-git4 causes these compilation warnings on my amd64 box
> > with gcc-4.3.1 :
> >
> > drivers/pci/search.c: In function ‘pci_get_dev_by_id’:
> > drivers/pci/search.c:284: attention : passing argument 1 of
> > ‘pci_dev_put’ discards qualifiers from pointer target type
> >
> > following this commit : ebca4f1bce1eb7b91a63c515db66316db9391221 PCI: fix
> > reference leak in pci_get_dev_by_id()
>
> Ick, sorry about that, I said my fix was not even build tested :)
>
> Here's a fix for this, Jesse, care to forward this on?

Yeah, thanks Greg.  Alex and I built & booted it, but obviously I missed the 
warning.

Jesse

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

* Re: [2.6.27-rc4-git4] compilation warnings
  2008-08-26 16:08   ` Jesse Barnes
@ 2008-08-26 16:20     ` Rufus & Azrael
  0 siblings, 0 replies; 5+ messages in thread
From: Rufus & Azrael @ 2008-08-26 16:20 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Greg KH, Linux-kernel Mailing List

Jesse Barnes wrote:
> On Tuesday, August 26, 2008 8:20 am Greg KH wrote:
>    
>> On Tue, Aug 26, 2008 at 11:37:46AM +0200, Rufus&  Azrael wrote:
>>      
>>> Hello all,
>>>
>>> Fresh 2.6.27-rc4-git4 causes these compilation warnings on my amd64 box
>>> with gcc-4.3.1 :
>>>
>>> drivers/pci/search.c: In function ‘pci_get_dev_by_id’:
>>> drivers/pci/search.c:284: attention : passing argument 1 of
>>> ‘pci_dev_put’ discards qualifiers from pointer target type
>>>
>>> following this commit : ebca4f1bce1eb7b91a63c515db66316db9391221 PCI: fix
>>> reference leak in pci_get_dev_by_id()
>>>        
>> Ick, sorry about that, I said my fix was not even build tested :)
>>
>> Here's a fix for this, Jesse, care to forward this on?
>>      
>
> Yeah, thanks Greg.  Alex and I built&  booted it, but obviously I missed the
> warning.
>
> Jesse
>
>    
Hello Greg and Jesse,

I have tested this patch which works fine and the warning disappears, 
thanks for all.

Regards.



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

* Re: [2.6.27-rc4-git4] compilation warnings
  2008-08-26 15:20 ` Greg KH
  2008-08-26 16:08   ` Jesse Barnes
@ 2008-08-27 23:35   ` Jesse Barnes
  1 sibling, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2008-08-27 23:35 UTC (permalink / raw)
  To: Greg KH; +Cc: Rufus & Azrael, Linux-kernel Mailing List

On Tuesday, August 26, 2008 8:20 am Greg KH wrote:
> On Tue, Aug 26, 2008 at 11:37:46AM +0200, Rufus & Azrael wrote:
> > Hello all,
> >
> > Fresh 2.6.27-rc4-git4 causes these compilation warnings on my amd64 box
> > with gcc-4.3.1 :
> >
> > drivers/pci/search.c: In function ‘pci_get_dev_by_id’:
> > drivers/pci/search.c:284: attention : passing argument 1 of
> > ‘pci_dev_put’ discards qualifiers from pointer target type
> >
> > following this commit : ebca4f1bce1eb7b91a63c515db66316db9391221 PCI: fix
> > reference leak in pci_get_dev_by_id()
>
> Ick, sorry about that, I said my fix was not even build tested :)
>
> Here's a fix for this, Jesse, care to forward this on?

This one's in my linux-next branch now, thanks Greg.

Jesse

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

end of thread, other threads:[~2008-08-27 23:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-26  9:37 [2.6.27-rc4-git4] compilation warnings Rufus & Azrael
2008-08-26 15:20 ` Greg KH
2008-08-26 16:08   ` Jesse Barnes
2008-08-26 16:20     ` Rufus & Azrael
2008-08-27 23:35   ` Jesse Barnes

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