From: Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: Marcelo Tosatti <marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
Jeff Garzik <jeff-o2qLIJkoznsdnm+yROfE0A@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linux Kernel Development
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] libertas link error due to gcc `smartness'
Date: Mon, 08 Oct 2007 08:56:30 -0400 [thread overview]
Message-ID: <1191848190.2703.17.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0710080940110.8127@anakin>
On Mon, 2007-10-08 at 09:43 +0200, Geert Uytterhoeven wrote:
> Some versions of gcc replace strstr() calls with a single-character `needle'
> parameter by strchr() behind our back. This causes a link error if strchr() is
> defined as an inline function in <asm/string.h> (e.g. on m68k):
>
> | drivers/built-in.o: In function `libertas_parse_chan':
> | linux/drivers/net/wireless/libertas/debugfs.c:209: undefined reference to `strchr'
> | drivers/built-in.o: In function `libertas_parse_ssid':
> | linux/drivers/net/wireless/libertas/debugfs.c:260: undefined reference to `strchr'
>
> Avoid this by explicitly calling strchr() instead.
>
> Also include <linux/string.h>, because this file calls lots of str*() routines.
>
> Signed-off-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Acked-by: Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> Due to the lack of hardware, I could not test the functionality of this change.
> I was just trying to compile a kernel with a much enabled as possible.
>
> drivers/net/wireless/libertas/debugfs.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> --- a/drivers/net/wireless/libertas/debugfs.c
> +++ b/drivers/net/wireless/libertas/debugfs.c
> @@ -3,6 +3,7 @@
> #include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/mm.h>
> +#include <linux/string.h>
> #include <net/iw_handler.h>
>
> #include "dev.h"
> @@ -205,7 +206,7 @@ static int libertas_parse_chan(char *buf
> if (!start)
> return -EINVAL;
> start += 5;
> - end = strstr(start, " ");
> + end = strchr(start, ' ');
> if (!end)
> end = buf + count;
> hold = kzalloc((end - start)+1, GFP_KERNEL);
> @@ -256,7 +257,7 @@ static void libertas_parse_ssid(char *bu
> if (!hold)
> return;
> hold += 5;
> - end = strstr(hold, " ");
> + end = strchr(hold, ' ');
> if (!end)
> end = buf + count - 1;
>
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2007-10-08 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 7:43 [PATCH] libertas link error due to gcc `smartness' Geert Uytterhoeven
2007-10-08 12:56 ` Dan Williams [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1191848190.2703.17.camel@localhost.localdomain \
--to=dcbw-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=jeff-o2qLIJkoznsdnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).