mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH/RFC] m68k: Uninline strchr()
Date: Sun, 09 Jan 2011 12:52:56 -0800	[thread overview]
Message-ID: <1294606376.2895.176.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1101091942230.26296@ayla.of.borg>

On Sun, 2011-01-09 at 19:42 +0100, Geert Uytterhoeven wrote:
> Some versions of gcc replace calls to strstr() with single-character
> "needle" string parameters by calls to strchr() behind our back.
> 
> If strchr() is defined as an inline function, this causes linking errors
> like
> 
> 	ERROR: "strchr" [drivers/target/target_core_mod.ko] undefined!
> 
> As m68k is the only architecture that has an inline strchr() and this
> inline version is not an optimized asm version, uninline strchr() and use
> the standard out-of-line C version in lib/string.c instead.
> 
> This also decreases the defconfig/allmodconfig kernel image sizes by a few
> hundred bytes.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Hi Geert,

Thanks for taking the time to fix this up in m68k code.  As m68k is one
of the last architectures that target code has yet to run on, I am
excited to see this finally happen.  ;)

Best Regards,

Reviewed-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

> 
> diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h
> index 2936dda..65b1312 100644
> --- a/arch/m68k/include/asm/string.h
> +++ b/arch/m68k/include/asm/string.h
> @@ -81,18 +81,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n)
>  	strcpy(__d + strlen(__d), (s));		\
>  })
>  
> -#define __HAVE_ARCH_STRCHR
> -static inline char *strchr(const char *s, int c)
> -{
> -	char sc, ch = c;
> -
> -	for (; (sc = *s++) != ch; ) {
> -		if (!sc)
> -			return NULL;
> -	}
> -	return (char *)s - 1;
> -}
> -
>  #ifndef CONFIG_COLDFIRE
>  #define __HAVE_ARCH_STRCMP
>  static inline int strcmp(const char *cs, const char *ct)


      reply	other threads:[~2011-01-09 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-09 18:42 Geert Uytterhoeven
2011-01-09 20:52 ` Nicholas A. Bellinger [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=1294606376.2895.176.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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

all inboxes | Powered by JetHome®