diff mbox series

libertas: remove ifdef OLPC noise

Message ID 20190116151618.1972197-1-lkundrak@v3.sk (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series libertas: remove ifdef OLPC noise | expand

Commit Message

Lubomir Rintel Jan. 16, 2019, 3:16 p.m. UTC
<asm/olpc.h> provides machine_is_olpc() stub for CONFIG_OLPC=n,
compiler should just optimize the unneeded bits away.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Kalle Valo Jan. 16, 2019, 4:04 p.m. UTC | #1
Lubomir Rintel <lkundrak@v3.sk> writes:

> <asm/olpc.h> provides machine_is_olpc() stub for CONFIG_OLPC=n,
> compiler should just optimize the unneeded bits away.
>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
>  drivers/net/wireless/marvell/libertas/if_usb.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
> index 220dcdee8d2b..7b61c599948e 100644
> --- a/drivers/net/wireless/marvell/libertas/if_usb.c
> +++ b/drivers/net/wireless/marvell/libertas/if_usb.c
> @@ -12,9 +12,7 @@
>  #include <linux/usb.h>
>  #include <linux/olpc-ec.h>
>  
> -#ifdef CONFIG_OLPC
>  #include <asm/olpc.h>
> -#endif

Using asm directory looked odd to me so I did some investigation:

$ find -name olpc.h
./arch/x86/include/asm/olpc.h

Did you build this on something else than x86? For example, will the
compiler find olpc.h when building for arm?
Lubomir Rintel Jan. 16, 2019, 4:20 p.m. UTC | #2
On Wed, 2019-01-16 at 18:04 +0200, Kalle Valo wrote:
> Lubomir Rintel <lkundrak@v3.sk> writes:
> 
> > <asm/olpc.h> provides machine_is_olpc() stub for CONFIG_OLPC=n,
> > compiler should just optimize the unneeded bits away.
> > 
> > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > ---
> >  drivers/net/wireless/marvell/libertas/if_usb.c | 10 ----------
> >  1 file changed, 10 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
> > index 220dcdee8d2b..7b61c599948e 100644
> > --- a/drivers/net/wireless/marvell/libertas/if_usb.c
> > +++ b/drivers/net/wireless/marvell/libertas/if_usb.c
> > @@ -12,9 +12,7 @@
> >  #include <linux/usb.h>
> >  #include <linux/olpc-ec.h>
> >  
> > -#ifdef CONFIG_OLPC
> >  #include <asm/olpc.h>
> > -#endif
> 
> Using asm directory looked odd to me so I did some investigation:
> 
> $ find -name olpc.h
> ./arch/x86/include/asm/olpc.h
> 
> Did you build this on something else than x86? For example, will the
> compiler find olpc.h when building for arm?

Uh, no. You're right, this indeed breaks on non-x86.

Perhaps olpc-ec.h should provide something that could tell whether the
EC is available that could be used instead of machine_is_olpc(), or the
olpc.h moved outside arch/x86.

For now, please just ignore the patch..

Lubo
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index 220dcdee8d2b..7b61c599948e 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -12,9 +12,7 @@ 
 #include <linux/usb.h>
 #include <linux/olpc-ec.h>
 
-#ifdef CONFIG_OLPC
 #include <asm/olpc.h>
-#endif
 
 #define DRV_NAME "usb8xxx"
 
@@ -174,13 +172,11 @@  static void if_usb_fw_timeo(struct timer_list *t)
 	wake_up(&cardp->fw_wq);
 }
 
-#ifdef CONFIG_OLPC
 static void if_usb_reset_olpc_card(struct lbs_private *priv)
 {
 	printk(KERN_CRIT "Resetting OLPC wireless via EC...\n");
 	olpc_ec_cmd(0x25, NULL, 0, NULL, 0);
 }
-#endif
 
 /**
  * if_usb_probe - sets the configuration values
@@ -267,10 +263,8 @@  static int if_usb_probe(struct usb_interface *intf,
 	priv->exit_deep_sleep = NULL;
 	priv->reset_deep_sleep_wakeup = NULL;
 	priv->is_polling = false;
-#ifdef CONFIG_OLPC
 	if (machine_is_olpc())
 		priv->reset_card = if_usb_reset_olpc_card;
-#endif
 
 	cardp->boot2_version = udev->descriptor.bcdDevice;
 
@@ -395,10 +389,8 @@  static int if_usb_reset_device(struct if_usb_card *cardp)
 	ret = usb_reset_device(cardp->udev);
 	msleep(100);
 
-#ifdef CONFIG_OLPC
 	if (ret && machine_is_olpc())
 		if_usb_reset_olpc_card(NULL);
-#endif
 
 	return ret;
 }
@@ -939,14 +931,12 @@  static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
 		goto out;
 	}
 
-#ifdef CONFIG_OLPC
 	if (machine_is_olpc()) {
 		if (priv->wol_criteria == EHS_REMOVE_WAKEUP)
 			olpc_ec_wakeup_clear(EC_SCI_SRC_WLAN);
 		else
 			olpc_ec_wakeup_set(EC_SCI_SRC_WLAN);
 	}
-#endif
 
 	ret = lbs_suspend(priv);
 	if (ret)