Re: drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used uninitialized in this function

2017-08-09 Thread Daniel Micay
On Wed, 2017-08-09 at 17:32 +0200, Arnd Bergmann wrote:
> On Wed, Aug 9, 2017 at 5:07 PM, kbuild test robot
>  wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin
> > ux.git master
> > head:   bfa738cf3dfae2111626650f86135f93c5ff0a22
> > commit: 6974f0c4555e285ab217cee58b6e874f776ff409
> > include/linux/string.h: add the option of fortified string.h
> > functions
> > date:   4 weeks ago
> > config: x86_64-randconfig-v0-08092220 (attached as .config)
> > compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
> > reproduce:
> > git checkout 6974f0c4555e285ab217cee58b6e874f776ff409
> > # save the attached .config to linux build tree
> > make ARCH=x86_64
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >In file included from include/linux/bitmap.h:8,
> > from include/linux/cpumask.h:11,
> > from arch/x86/include/asm/cpumask.h:4,
> > from arch/x86/include/asm/msr.h:10,
> > from arch/x86/include/asm/processor.h:20,
> > from arch/x86/include/asm/cpufeature.h:4,
> > from arch/x86/include/asm/thread_info.h:52,
> > from include/linux/thread_info.h:37,
> > from arch/x86/include/asm/preempt.h:6,
> > from include/linux/preempt.h:80,
> > from include/linux/spinlock.h:50,
> > from include/linux/seqlock.h:35,
> > from include/linux/time.h:5,
> > from include/linux/stat.h:18,
> > from include/linux/module.h:10,
> > from drivers/tty/serial/8250/8250_fintek.c:11:
> >include/linux/string.h: In function 'strcpy':
> >include/linux/string.h:209: warning: '__f' is static but
> > declared in inline function 'strcpy' which is not static
> >include/linux/string.h:211: warning: '__f' is static but
> > declared in inline function 'strcpy' which is not static
> 
> 
> This clearly comes from __trace_if() when CONFIG_PROFILE_ALL_BRANCHES
> is enabled. I did not see the warning with gcc-7.1.1, and I guess this
> only
> happens on older compilers like the gcc-4.4 that was used here.
> 
> What is the reason for __FORTIFY_INLINE to be "extern __always_inline"
> rather than "static __always_inline"? If they cannot just be 'static',
> maybe
> this can be changed to depend on the compiler version.
> 
>Arnd

It's important to get the semantics of using extern. It means if you do
something like , it resolves to the address of the direct symbol
instead of generating a useless thunk for that object file. It might
also be required for Clang compatibility, I don't remember.

It could have a compiler version dependency or maybe one specifically
tied to old compiler && CONFIG_PROFILE_ALL_BRANCHES / other options that
conflict with it like that.


Re: drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used uninitialized in this function

2017-08-09 Thread Daniel Micay
On Wed, 2017-08-09 at 17:32 +0200, Arnd Bergmann wrote:
> On Wed, Aug 9, 2017 at 5:07 PM, kbuild test robot
>  wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin
> > ux.git master
> > head:   bfa738cf3dfae2111626650f86135f93c5ff0a22
> > commit: 6974f0c4555e285ab217cee58b6e874f776ff409
> > include/linux/string.h: add the option of fortified string.h
> > functions
> > date:   4 weeks ago
> > config: x86_64-randconfig-v0-08092220 (attached as .config)
> > compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
> > reproduce:
> > git checkout 6974f0c4555e285ab217cee58b6e874f776ff409
> > # save the attached .config to linux build tree
> > make ARCH=x86_64
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >In file included from include/linux/bitmap.h:8,
> > from include/linux/cpumask.h:11,
> > from arch/x86/include/asm/cpumask.h:4,
> > from arch/x86/include/asm/msr.h:10,
> > from arch/x86/include/asm/processor.h:20,
> > from arch/x86/include/asm/cpufeature.h:4,
> > from arch/x86/include/asm/thread_info.h:52,
> > from include/linux/thread_info.h:37,
> > from arch/x86/include/asm/preempt.h:6,
> > from include/linux/preempt.h:80,
> > from include/linux/spinlock.h:50,
> > from include/linux/seqlock.h:35,
> > from include/linux/time.h:5,
> > from include/linux/stat.h:18,
> > from include/linux/module.h:10,
> > from drivers/tty/serial/8250/8250_fintek.c:11:
> >include/linux/string.h: In function 'strcpy':
> >include/linux/string.h:209: warning: '__f' is static but
> > declared in inline function 'strcpy' which is not static
> >include/linux/string.h:211: warning: '__f' is static but
> > declared in inline function 'strcpy' which is not static
> 
> 
> This clearly comes from __trace_if() when CONFIG_PROFILE_ALL_BRANCHES
> is enabled. I did not see the warning with gcc-7.1.1, and I guess this
> only
> happens on older compilers like the gcc-4.4 that was used here.
> 
> What is the reason for __FORTIFY_INLINE to be "extern __always_inline"
> rather than "static __always_inline"? If they cannot just be 'static',
> maybe
> this can be changed to depend on the compiler version.
> 
>Arnd

It's important to get the semantics of using extern. It means if you do
something like , it resolves to the address of the direct symbol
instead of generating a useless thunk for that object file. It might
also be required for Clang compatibility, I don't remember.

It could have a compiler version dependency or maybe one specifically
tied to old compiler && CONFIG_PROFILE_ALL_BRANCHES / other options that
conflict with it like that.


Re: drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used uninitialized in this function

2017-08-09 Thread Arnd Bergmann
On Wed, Aug 9, 2017 at 5:07 PM, kbuild test robot
 wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   bfa738cf3dfae2111626650f86135f93c5ff0a22
> commit: 6974f0c4555e285ab217cee58b6e874f776ff409 include/linux/string.h: add 
> the option of fortified string.h functions
> date:   4 weeks ago
> config: x86_64-randconfig-v0-08092220 (attached as .config)
> compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
> reproduce:
> git checkout 6974f0c4555e285ab217cee58b6e874f776ff409
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All warnings (new ones prefixed by >>):
>
>In file included from include/linux/bitmap.h:8,
> from include/linux/cpumask.h:11,
> from arch/x86/include/asm/cpumask.h:4,
> from arch/x86/include/asm/msr.h:10,
> from arch/x86/include/asm/processor.h:20,
> from arch/x86/include/asm/cpufeature.h:4,
> from arch/x86/include/asm/thread_info.h:52,
> from include/linux/thread_info.h:37,
> from arch/x86/include/asm/preempt.h:6,
> from include/linux/preempt.h:80,
> from include/linux/spinlock.h:50,
> from include/linux/seqlock.h:35,
> from include/linux/time.h:5,
> from include/linux/stat.h:18,
> from include/linux/module.h:10,
> from drivers/tty/serial/8250/8250_fintek.c:11:
>include/linux/string.h: In function 'strcpy':
>include/linux/string.h:209: warning: '__f' is static but declared in 
> inline function 'strcpy' which is not static
>include/linux/string.h:211: warning: '__f' is static but declared in 
> inline function 'strcpy' which is not static


This clearly comes from __trace_if() when CONFIG_PROFILE_ALL_BRANCHES
is enabled. I did not see the warning with gcc-7.1.1, and I guess this only
happens on older compilers like the gcc-4.4 that was used here.

What is the reason for __FORTIFY_INLINE to be "extern __always_inline"
rather than "static __always_inline"? If they cannot just be 'static', maybe
this can be changed to depend on the compiler version.

   Arnd


Re: drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used uninitialized in this function

2017-08-09 Thread Arnd Bergmann
On Wed, Aug 9, 2017 at 5:07 PM, kbuild test robot
 wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   bfa738cf3dfae2111626650f86135f93c5ff0a22
> commit: 6974f0c4555e285ab217cee58b6e874f776ff409 include/linux/string.h: add 
> the option of fortified string.h functions
> date:   4 weeks ago
> config: x86_64-randconfig-v0-08092220 (attached as .config)
> compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
> reproduce:
> git checkout 6974f0c4555e285ab217cee58b6e874f776ff409
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All warnings (new ones prefixed by >>):
>
>In file included from include/linux/bitmap.h:8,
> from include/linux/cpumask.h:11,
> from arch/x86/include/asm/cpumask.h:4,
> from arch/x86/include/asm/msr.h:10,
> from arch/x86/include/asm/processor.h:20,
> from arch/x86/include/asm/cpufeature.h:4,
> from arch/x86/include/asm/thread_info.h:52,
> from include/linux/thread_info.h:37,
> from arch/x86/include/asm/preempt.h:6,
> from include/linux/preempt.h:80,
> from include/linux/spinlock.h:50,
> from include/linux/seqlock.h:35,
> from include/linux/time.h:5,
> from include/linux/stat.h:18,
> from include/linux/module.h:10,
> from drivers/tty/serial/8250/8250_fintek.c:11:
>include/linux/string.h: In function 'strcpy':
>include/linux/string.h:209: warning: '__f' is static but declared in 
> inline function 'strcpy' which is not static
>include/linux/string.h:211: warning: '__f' is static but declared in 
> inline function 'strcpy' which is not static


This clearly comes from __trace_if() when CONFIG_PROFILE_ALL_BRANCHES
is enabled. I did not see the warning with gcc-7.1.1, and I guess this only
happens on older compilers like the gcc-4.4 that was used here.

What is the reason for __FORTIFY_INLINE to be "extern __always_inline"
rather than "static __always_inline"? If they cannot just be 'static', maybe
this can be changed to depend on the compiler version.

   Arnd


drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used uninitialized in this function

2017-08-09 Thread kbuild test robot
inline function 'memmove' which is not static
   include/linux/string.h: In function 'memscan':
   include/linux/string.h:341: warning: '__f' is static but declared in 
inline function 'memscan' which is not static
   include/linux/string.h:343: warning: '__f' is static but declared in 
inline function 'memscan' which is not static
   include/linux/string.h: In function 'memcmp':
   include/linux/string.h:352: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h:353: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h:355: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h:358: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h: In function 'memchr':
   include/linux/string.h:366: warning: '__f' is static but declared in 
inline function 'memchr' which is not static
   include/linux/string.h:368: warning: '__f' is static but declared in 
inline function 'memchr' which is not static
   include/linux/string.h: In function 'memchr_inv':
   include/linux/string.h:377: warning: '__f' is static but declared in 
inline function 'memchr_inv' which is not static
   include/linux/string.h:379: warning: '__f' is static but declared in 
inline function 'memchr_inv' which is not static
   include/linux/string.h: In function 'kmemdup':
   include/linux/string.h:388: warning: '__f' is static but declared in 
inline function 'kmemdup' which is not static
   include/linux/string.h:390: warning: '__f' is static but declared in 
inline function 'kmemdup' which is not static
   drivers/tty/serial/8250/8250_fintek.c: In function 'fintek_8250_probe':
>> drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used 
>> uninitialized in this function
   drivers/tty/serial/8250/8250_fintek.c:297: warning: 'min' may be used 
uninitialized in this function
   drivers/tty/serial/8250/8250_fintek.c:297: note: 'min' was declared here
   drivers/tty/serial/8250/8250_fintek.c:297: warning: 'max' may be used 
uninitialized in this function
   drivers/tty/serial/8250/8250_fintek.c:297: note: 'max' was declared here

vim +/probe_data +364 drivers/tty/serial/8250/8250_fintek.c

1e26c472 Ji-Ze Hong (Peter Hong  2016-10-04  360) 
fa01e2ca Ricardo Ribalda Delgado 2016-04-27  361  int fintek_8250_probe(struct 
uart_8250_port *uart)
28e3fb6c Ricardo Ribalda Delgado 2014-07-31  362  {
92a5f11a Ricardo Ribalda Delgado 2015-06-16  363struct fintek_8250 
*pdata;
fa01e2ca Ricardo Ribalda Delgado 2016-04-27 @364struct fintek_8250 
probe_data;

:: The code at line 364 was first introduced by commit
:: fa01e2ca9f531b4a5693469a196eb1574b8d7d8a serial: 8250: Integrate Fintek 
into 8250_base

:: TO: Ricardo Ribalda Delgado <ricardo.riba...@gmail.com>
:: CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used uninitialized in this function

2017-08-09 Thread kbuild test robot
inline function 'memmove' which is not static
   include/linux/string.h: In function 'memscan':
   include/linux/string.h:341: warning: '__f' is static but declared in 
inline function 'memscan' which is not static
   include/linux/string.h:343: warning: '__f' is static but declared in 
inline function 'memscan' which is not static
   include/linux/string.h: In function 'memcmp':
   include/linux/string.h:352: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h:353: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h:355: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h:358: warning: '__f' is static but declared in 
inline function 'memcmp' which is not static
   include/linux/string.h: In function 'memchr':
   include/linux/string.h:366: warning: '__f' is static but declared in 
inline function 'memchr' which is not static
   include/linux/string.h:368: warning: '__f' is static but declared in 
inline function 'memchr' which is not static
   include/linux/string.h: In function 'memchr_inv':
   include/linux/string.h:377: warning: '__f' is static but declared in 
inline function 'memchr_inv' which is not static
   include/linux/string.h:379: warning: '__f' is static but declared in 
inline function 'memchr_inv' which is not static
   include/linux/string.h: In function 'kmemdup':
   include/linux/string.h:388: warning: '__f' is static but declared in 
inline function 'kmemdup' which is not static
   include/linux/string.h:390: warning: '__f' is static but declared in 
inline function 'kmemdup' which is not static
   drivers/tty/serial/8250/8250_fintek.c: In function 'fintek_8250_probe':
>> drivers/tty/serial/8250/8250_fintek.c:364: warning: 'probe_data' is used 
>> uninitialized in this function
   drivers/tty/serial/8250/8250_fintek.c:297: warning: 'min' may be used 
uninitialized in this function
   drivers/tty/serial/8250/8250_fintek.c:297: note: 'min' was declared here
   drivers/tty/serial/8250/8250_fintek.c:297: warning: 'max' may be used 
uninitialized in this function
   drivers/tty/serial/8250/8250_fintek.c:297: note: 'max' was declared here

vim +/probe_data +364 drivers/tty/serial/8250/8250_fintek.c

1e26c472 Ji-Ze Hong (Peter Hong  2016-10-04  360) 
fa01e2ca Ricardo Ribalda Delgado 2016-04-27  361  int fintek_8250_probe(struct 
uart_8250_port *uart)
28e3fb6c Ricardo Ribalda Delgado 2014-07-31  362  {
92a5f11a Ricardo Ribalda Delgado 2015-06-16  363struct fintek_8250 
*pdata;
fa01e2ca Ricardo Ribalda Delgado 2016-04-27 @364struct fintek_8250 
probe_data;

:: The code at line 364 was first introduced by commit
:: fa01e2ca9f531b4a5693469a196eb1574b8d7d8a serial: 8250: Integrate Fintek 
into 8250_base

:: TO: Ricardo Ribalda Delgado 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip