public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove warning about e1000_suspend
@ 2005-08-07 19:17 Martin J. Bligh
  0 siblings, 0 replies; 5+ messages in thread
From: Martin J. Bligh @ 2005-08-07 19:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

e1000_suspend is only used under #ifdef CONFIG_PM. Move the declaration
of it to be the same way, just like e1000_resume, otherwise gcc whines 
on compile. I offer as evidence:

	static struct pci_driver e1000_driver = {
 	       .name     = e1000_driver_name,
 	      .id_table = e1000_pci_tbl,
  	      .probe    = e1000_probe,
  	      .remove   = __devexit_p(e1000_remove),
 	      /* Power Managment Hooks */
	#ifdef CONFIG_PM
 	       .suspend  = e1000_suspend,
 	       .resume   = e1000_resume
	#endif
	};


diff -aurpN -X /home/fletch/.diff.exclude virgin/drivers/net/e1000/e1000_main.c e1000_suspend/drivers/net/e1000/e1000_main.c
--- virgin/drivers/net/e1000/e1000_main.c	2005-08-07 09:15:36.000000000 -0700
+++ e1000_suspend/drivers/net/e1000/e1000_main.c	2005-08-07 12:10:42.000000000 -0700
@@ -162,8 +162,8 @@ static void e1000_vlan_rx_add_vid(struct
 static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
 static void e1000_restore_vlan(struct e1000_adapter *adapter);
 
-static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
 #ifdef CONFIG_PM
+static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
 static int e1000_resume(struct pci_dev *pdev);
 #endif
 
@@ -3641,6 +3641,7 @@ e1000_set_spd_dplx(struct e1000_adapter 
 	return 0;
 }
 
+#ifdef CONFIG_PM
 static int
 e1000_suspend(struct pci_dev *pdev, uint32_t state)
 {
@@ -3733,7 +3734,6 @@ e1000_suspend(struct pci_dev *pdev, uint
 	return 0;
 }
 
-#ifdef CONFIG_PM
 static int
 e1000_resume(struct pci_dev *pdev)
 {


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

* Re: [PATCH] remove warning about e1000_suspend
       [not found] <256850000.1123442258@10.10.2.4>
@ 2005-08-08  6:09 ` Nikhil Dharashivkar
  2005-08-08  6:16   ` Martin J. Bligh
  2005-08-08  8:49   ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Nikhil Dharashivkar @ 2005-08-08  6:09 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Andrew Morton, linux-kernel

Hi Martin,
    But e1000_notify_reboot () function calls this e1000_suspend()
function irrespective of  CONFIG_FM is defined or not. So according to
your soution, what if CONFIG_FM is not defined.

On 8/8/05, Martin J. Bligh <mbligh@mbligh.org> wrote:
> e1000_suspend is only used under #ifdef CONFIG_PM. Move the declaration
> of it to be the same way, just like e1000_resume, otherwise gcc whines
> on compile. I offer as evidence:
> 
>         static struct pci_driver e1000_driver = {
>                .name     = e1000_driver_name,
>               .id_table = e1000_pci_tbl,
>               .probe    = e1000_probe,
>               .remove   = __devexit_p(e1000_remove),
>               /* Power Managment Hooks */
>         #ifdef CONFIG_PM
>                .suspend  = e1000_suspend,
>                .resume   = e1000_resume
>         #endif
>         };
> 
> 
> diff -aurpN -X /home/fletch/.diff.exclude virgin/drivers/net/e1000/e1000_main.c e1000_suspend/drivers/net/e1000/e1000_main.c
> --- virgin/drivers/net/e1000/e1000_main.c       2005-08-07 09:15:36.000000000 -0700
> +++ e1000_suspend/drivers/net/e1000/e1000_main.c        2005-08-07 12:10:42.000000000 -0700
> @@ -162,8 +162,8 @@ static void e1000_vlan_rx_add_vid(struct
>  static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
>  static void e1000_restore_vlan(struct e1000_adapter *adapter);
> 
> -static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
>  #ifdef CONFIG_PM
> +static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
>  static int e1000_resume(struct pci_dev *pdev);
>  #endif
> 
> @@ -3641,6 +3641,7 @@ e1000_set_spd_dplx(struct e1000_adapter
>         return 0;
>  }
> 
> +#ifdef CONFIG_PM
>  static int
>  e1000_suspend(struct pci_dev *pdev, uint32_t state)
>  {
> @@ -3733,7 +3734,6 @@ e1000_suspend(struct pci_dev *pdev, uint
>         return 0;
>  }
> 
> -#ifdef CONFIG_PM
>  static int
>  e1000_resume(struct pci_dev *pdev)
>  {
> 
> -
> 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/
> 


-- 
Thanks and Regards,
         Nikhil.

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

* Re: [PATCH] remove warning about e1000_suspend
  2005-08-08  6:09 ` [PATCH] remove warning about e1000_suspend Nikhil Dharashivkar
@ 2005-08-08  6:16   ` Martin J. Bligh
  2005-08-08  8:49   ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Martin J. Bligh @ 2005-08-08  6:16 UTC (permalink / raw)
  To: Nikhil Dharashivkar; +Cc: Andrew Morton, linux-kernel



--Nikhil Dharashivkar <nikhildharashivkar@gmail.com> wrote (on Monday, August 08, 2005 11:39:07 +0530):

> Hi Martin,
>     But e1000_notify_reboot () function calls this e1000_suspend()
> function irrespective of  CONFIG_FM is defined or not. So according to
> your soution, what if CONFIG_FM is not defined.

Odd. I wonder why I get a warning then. Hmmmm ....

M.

> On 8/8/05, Martin J. Bligh <mbligh@mbligh.org> wrote:
>> e1000_suspend is only used under #ifdef CONFIG_PM. Move the declaration
>> of it to be the same way, just like e1000_resume, otherwise gcc whines
>> on compile. I offer as evidence:
>> 
>>         static struct pci_driver e1000_driver = {
>>                .name     = e1000_driver_name,
>>               .id_table = e1000_pci_tbl,
>>               .probe    = e1000_probe,
>>               .remove   = __devexit_p(e1000_remove),
>>               /* Power Managment Hooks */
>>         # ifdef CONFIG_PM
>>                .suspend  = e1000_suspend,
>>                .resume   = e1000_resume
>>         # endif
>>         };
>> 
>> 
>> diff -aurpN -X /home/fletch/.diff.exclude virgin/drivers/net/e1000/e1000_main.c e1000_suspend/drivers/net/e1000/e1000_main.c
>> --- virgin/drivers/net/e1000/e1000_main.c       2005-08-07 09:15:36.000000000 -0700
>> +++ e1000_suspend/drivers/net/e1000/e1000_main.c        2005-08-07 12:10:42.000000000 -0700
>> @@ -162,8 +162,8 @@ static void e1000_vlan_rx_add_vid(struct
>>  static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
>>  static void e1000_restore_vlan(struct e1000_adapter *adapter);
>> 
>> -static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
>>  # ifdef CONFIG_PM
>> +static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
>>  static int e1000_resume(struct pci_dev *pdev);
>>  # endif
>> 
>> @@ -3641,6 +3641,7 @@ e1000_set_spd_dplx(struct e1000_adapter
>>         return 0;
>>  }
>> 
>> +#ifdef CONFIG_PM
>>  static int
>>  e1000_suspend(struct pci_dev *pdev, uint32_t state)
>>  {
>> @@ -3733,7 +3734,6 @@ e1000_suspend(struct pci_dev *pdev, uint
>>         return 0;
>>  }
>> 
>> -#ifdef CONFIG_PM
>>  static int
>>  e1000_resume(struct pci_dev *pdev)
>>  {
>> 
>> -
>> 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/
>> 
> 
> 
> -- 
> Thanks and Regards,
>          Nikhil.
> 
> 
> 



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

* Re: [PATCH] remove warning about e1000_suspend
  2005-08-08  6:09 ` [PATCH] remove warning about e1000_suspend Nikhil Dharashivkar
  2005-08-08  6:16   ` Martin J. Bligh
@ 2005-08-08  8:49   ` Michael Ellerman
  2005-08-08 14:57     ` Martin J. Bligh
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2005-08-08  8:49 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: Nikhil Dharashivkar, Martin J. Bligh, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 2802 bytes --]

On Mon, 8 Aug 2005 16:09, Nikhil Dharashivkar wrote:
> Hi Martin,
>     But e1000_notify_reboot () function calls this e1000_suspend()
> function irrespective of  CONFIG_FM is defined or not. So according to
> your soution, what if CONFIG_FM is not defined.

Does it? I can't find it.

Martin's patch works for me.

cheers

>
> On 8/8/05, Martin J. Bligh <mbligh@mbligh.org> wrote:
> > e1000_suspend is only used under #ifdef CONFIG_PM. Move the declaration
> > of it to be the same way, just like e1000_resume, otherwise gcc whines
> > on compile. I offer as evidence:
> >
> >         static struct pci_driver e1000_driver = {
> >                .name     = e1000_driver_name,
> >               .id_table = e1000_pci_tbl,
> >               .probe    = e1000_probe,
> >               .remove   = __devexit_p(e1000_remove),
> >               /* Power Managment Hooks */
> >         #ifdef CONFIG_PM
> >                .suspend  = e1000_suspend,
> >                .resume   = e1000_resume
> >         #endif
> >         };
> >
> >
> > diff -aurpN -X /home/fletch/.diff.exclude
> > virgin/drivers/net/e1000/e1000_main.c
> > e1000_suspend/drivers/net/e1000/e1000_main.c ---
> > virgin/drivers/net/e1000/e1000_main.c       2005-08-07 09:15:36.000000000
> > -0700 +++ e1000_suspend/drivers/net/e1000/e1000_main.c        2005-08-07
> > 12:10:42.000000000 -0700 @@ -162,8 +162,8 @@ static void
> > e1000_vlan_rx_add_vid(struct
> >  static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t
> > vid); static void e1000_restore_vlan(struct e1000_adapter *adapter);
> >
> > -static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
> >  #ifdef CONFIG_PM
> > +static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
> >  static int e1000_resume(struct pci_dev *pdev);
> >  #endif
> >
> > @@ -3641,6 +3641,7 @@ e1000_set_spd_dplx(struct e1000_adapter
> >         return 0;
> >  }
> >
> > +#ifdef CONFIG_PM
> >  static int
> >  e1000_suspend(struct pci_dev *pdev, uint32_t state)
> >  {
> > @@ -3733,7 +3734,6 @@ e1000_suspend(struct pci_dev *pdev, uint
> >         return 0;
> >  }
> >
> > -#ifdef CONFIG_PM
> >  static int
> >  e1000_resume(struct pci_dev *pdev)
> >  {
> >
> > -
> > 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/

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] remove warning about e1000_suspend
  2005-08-08  8:49   ` Michael Ellerman
@ 2005-08-08 14:57     ` Martin J. Bligh
  0 siblings, 0 replies; 5+ messages in thread
From: Martin J. Bligh @ 2005-08-08 14:57 UTC (permalink / raw)
  To: michael, Linux Kernel list; +Cc: Nikhil Dharashivkar, Andrew Morton



--Michael Ellerman <michael@ellerman.id.au> wrote (on Monday, August 08, 2005 18:49:34 +1000):

> On Mon, 8 Aug 2005 16:09, Nikhil Dharashivkar wrote:
>> Hi Martin,
>>     But e1000_notify_reboot () function calls this e1000_suspend()
>> function irrespective of  CONFIG_FM is defined or not. So according to
>> your soution, what if CONFIG_FM is not defined.
> 
> Does it? I can't find it.
> 
> Martin's patch works for me.

Aha. e1000_notify_reboot dissappeared between 2.6.13-rc3 and 2.6.13-rc4,
which caused the warning to start. So patch is good - Andrew, could you
still apply it? Will resend if you need.

M.


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

end of thread, other threads:[~2005-08-08 14:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <256850000.1123442258@10.10.2.4>
2005-08-08  6:09 ` [PATCH] remove warning about e1000_suspend Nikhil Dharashivkar
2005-08-08  6:16   ` Martin J. Bligh
2005-08-08  8:49   ` Michael Ellerman
2005-08-08 14:57     ` Martin J. Bligh
2005-08-07 19:17 Martin J. Bligh

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