Re: [PATCH V2] auxdisplay: use correct string length

2018-02-13 Thread Arnd Bergmann
On Tue, Feb 13, 2018 at 8:23 AM, Willy Tarreau wrote: > On Tue, Feb 13, 2018 at 09:19:21AM +0800, Xiongfeng Wang wrote: >> This may suppress the gcc warning. > > In fact there are two big problems with gcc warnings : > - writing -Wno-something-unknown triggers an error on versions

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-13 Thread Arnd Bergmann
On Tue, Feb 13, 2018 at 8:23 AM, Willy Tarreau wrote: > On Tue, Feb 13, 2018 at 09:19:21AM +0800, Xiongfeng Wang wrote: >> This may suppress the gcc warning. > > In fact there are two big problems with gcc warnings : > - writing -Wno-something-unknown triggers an error on versions where >

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Willy Tarreau
On Tue, Feb 13, 2018 at 09:19:21AM +0800, Xiongfeng Wang wrote: > >> diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c > >> index ea7869c..d288900 100644 > >> --- a/drivers/auxdisplay/panel.c > >> +++ b/drivers/auxdisplay/panel.c > >> @@ -1506,10 +1506,10 @@ static struct

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Willy Tarreau
On Tue, Feb 13, 2018 at 09:19:21AM +0800, Xiongfeng Wang wrote: > >> diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c > >> index ea7869c..d288900 100644 > >> --- a/drivers/auxdisplay/panel.c > >> +++ b/drivers/auxdisplay/panel.c > >> @@ -1506,10 +1506,10 @@ static struct

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Xiongfeng Wang
On 2018/2/12 20:53, Miguel Ojeda wrote: > On Tue, Jan 16, 2018 at 10:38 AM, Xiongfeng Wang > wrote: >> From: Xiongfeng Wang >> >> gcc-8 reports >> >> drivers/auxdisplay/panel.c: In function 'panel_attach': >> ./include/linux/string.h:245:9:

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Xiongfeng Wang
On 2018/2/12 20:53, Miguel Ojeda wrote: > On Tue, Jan 16, 2018 at 10:38 AM, Xiongfeng Wang > wrote: >> From: Xiongfeng Wang >> >> gcc-8 reports >> >> drivers/auxdisplay/panel.c: In function 'panel_attach': >> ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified >> bound 12

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Miguel Ojeda
On Mon, Feb 12, 2018 at 6:11 PM, Willy Tarreau wrote: > On Mon, Feb 12, 2018 at 01:53:57PM +0100, Miguel Ojeda wrote: >> > diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c >> > index ea7869c..d288900 100644 >> > --- a/drivers/auxdisplay/panel.c >> > +++

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Miguel Ojeda
On Mon, Feb 12, 2018 at 6:11 PM, Willy Tarreau wrote: > On Mon, Feb 12, 2018 at 01:53:57PM +0100, Miguel Ojeda wrote: >> > diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c >> > index ea7869c..d288900 100644 >> > --- a/drivers/auxdisplay/panel.c >> > +++

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Willy Tarreau
On Mon, Feb 12, 2018 at 01:53:57PM +0100, Miguel Ojeda wrote: > > diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c > > index ea7869c..d288900 100644 > > --- a/drivers/auxdisplay/panel.c > > +++ b/drivers/auxdisplay/panel.c > > @@ -1506,10 +1506,10 @@ static struct logical_input

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Willy Tarreau
On Mon, Feb 12, 2018 at 01:53:57PM +0100, Miguel Ojeda wrote: > > diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c > > index ea7869c..d288900 100644 > > --- a/drivers/auxdisplay/panel.c > > +++ b/drivers/auxdisplay/panel.c > > @@ -1506,10 +1506,10 @@ static struct logical_input

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Miguel Ojeda
On Tue, Jan 16, 2018 at 10:38 AM, Xiongfeng Wang wrote: > From: Xiongfeng Wang > > gcc-8 reports > > drivers/auxdisplay/panel.c: In function 'panel_attach': > ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified > bound 12

Re: [PATCH V2] auxdisplay: use correct string length

2018-02-12 Thread Miguel Ojeda
On Tue, Jan 16, 2018 at 10:38 AM, Xiongfeng Wang wrote: > From: Xiongfeng Wang > > gcc-8 reports > > drivers/auxdisplay/panel.c: In function 'panel_attach': > ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified > bound 12 equals destination size [-Wstringop-truncation] > > We

[PATCH V2] auxdisplay: use correct string length

2018-01-16 Thread Xiongfeng Wang
From: Xiongfeng Wang gcc-8 reports drivers/auxdisplay/panel.c: In function 'panel_attach': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 12 equals destination size [-Wstringop-truncation] We need one less byte or call strlcpy() to make

[PATCH V2] auxdisplay: use correct string length

2018-01-16 Thread Xiongfeng Wang
From: Xiongfeng Wang gcc-8 reports drivers/auxdisplay/panel.c: In function 'panel_attach': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 12 equals destination size [-Wstringop-truncation] We need one less byte or call strlcpy() to make it a nul-terminated string.