All of lore.kernel.org
 help / color / mirror / Atom feed
* can someone solve string_32.h issue for SH ?
@ 2019-12-17  6:09 ` Kuninori Morimoto
  0 siblings, 0 replies; 37+ messages in thread
From: Kuninori Morimoto @ 2019-12-17  6:09 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker; +Cc: Linux-SH, Linux-Renesas


Hi SH ML

We get too many below strncpy() warning on SH.
Can someone solve it ?
I don't remember SH assembler code / can't test it...

In file included from /home/morimoto/WORK/linux/arch/sh/include/asm/string.h:3,
                 from /home/morimoto/WORK/linux/include/linux/string.h:20,
                 from /home/morimoto/WORK/linux/include/linux/bitmap.h:9,
                 from /home/morimoto/WORK/linux/include/linux/nodemask.h:95,
                 from /home/morimoto/WORK/linux/include/linux/mmzone.h:17,
                 from /home/morimoto/WORK/linux/include/linux/gfp.h:6,
                 from /home/morimoto/WORK/linux/include/linux/slab.h:15,
                 from /home/morimoto/WORK/linux/drivers/mmc/host/vub300.c:38:
/home/morimoto/WORK/linux/drivers/mmc/host/vub300.c: In function 'new_system_port_status':
/home/morimoto/WORK/linux/arch/sh/include/asm/string_32.h:51:42: warning: array subscript 80 is above array bounds of 'char[26]' [-Warray-bounds]
   : "0" (__dest), "1" (__src), "r" (__src+__n)
                                     ~~~~~^~~~

	static inline char *strncpy(char *__dest, const char *__src, size_t __n)
	{
		register char *__xdest = __dest;
		unsigned long __dummy;

		if (__n = 0)
			return __xdest;

		__asm__ __volatile__(
			"1:\n"
			"mov.b	@%1+, %2\n\t"
			"mov.b	%2, @%0\n\t"
			"cmp/eq	#0, %2\n\t"
			"bt/s	2f\n\t"
			" cmp/eq	%5,%1\n\t"
			"bf/s	1b\n\t"
			" add	#1, %0\n"
			"2:"
			: "=r" (__dest), "=r" (__src), "=&z" (__dummy)
=>			: "0" (__dest), "1" (__src), "r" (__src+__n)
			: "memory", "t");

		return __xdest;
	}

Thank you for your help !!
Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 37+ messages in thread
[parent not found: <339916914.636876.1576627652112.ref@mail.yahoo.com>]

end of thread, other threads:[~2019-12-18  7:28 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  6:09 can someone solve string_32.h issue for SH ? Kuninori Morimoto
2019-12-17  6:09 ` Kuninori Morimoto
2019-12-17  7:36 ` Karl Nasrallah
2019-12-17  7:46 ` Kuninori Morimoto
2019-12-17  8:03 ` Kuninori Morimoto
2019-12-17  8:15 ` Karl Nasrallah
2019-12-17  8:26 ` Karl Nasrallah
2019-12-17  8:29 ` Geert Uytterhoeven
2019-12-17  8:29   ` Geert Uytterhoeven
2019-12-17  8:37   ` Kuninori Morimoto
2019-12-17  8:37     ` Kuninori Morimoto
2019-12-17  8:43     ` Geert Uytterhoeven
2019-12-17  8:43       ` Geert Uytterhoeven
2019-12-17  8:40   ` Geert Uytterhoeven
2019-12-17  8:40     ` Geert Uytterhoeven
2019-12-17  8:51     ` Kuninori Morimoto
2019-12-17  8:51       ` Kuninori Morimoto
2019-12-17  9:09       ` Karl Nasrallah
2019-12-17  9:09         ` Karl Nasrallah
2019-12-17 22:16         ` Karl Nasrallah
2019-12-17 22:16           ` Karl Nasrallah
2019-12-17 23:13           ` Rich Felker
2019-12-17 23:13             ` Rich Felker
2019-12-17  8:50   ` Geert Uytterhoeven
2019-12-17  8:50     ` Geert Uytterhoeven
     [not found] <339916914.636876.1576627652112.ref@mail.yahoo.com>
2019-12-18  0:07 ` Karl Nasrallah
2019-12-18  0:07   ` Karl Nasrallah
2019-12-18  2:01   ` Kuninori Morimoto
2019-12-18  2:01     ` Kuninori Morimoto
2019-12-18  3:56     ` Karl Nasrallah
2019-12-18  3:56       ` Karl Nasrallah
2019-12-18  5:21       ` Kuninori Morimoto
2019-12-18  5:21         ` Kuninori Morimoto
2019-12-18  6:06         ` Karl Nasrallah
2019-12-18  6:06           ` Karl Nasrallah
2019-12-18  7:28           ` Kuninori Morimoto
2019-12-18  7:28             ` Kuninori Morimoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.