RE: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-10 Thread David Laight
> Thanks for your explanation and review. I haven't realized using strncpy() on > NUL-terminated strings > is deprecated > and just trying to avoid the compile warnings. The website you provide helps > me a lot. Thank you very > much! Never try to remove compile-time warnings without understandi

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread luobin (L)
On 2020/8/8 20:50, David Laight wrote: > From: luobin (L) >> Sent: 08 August 2020 04:37 >> >> On 2020/8/7 17:32, David Laight wrote: >>> From: Luo bin Sent: 07 August 2020 03:09 fix the compile warnings of 'strncpy' output truncated before terminating nul copying N bytes from a

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread luobin (L)
On 2020/8/8 14:44, Kees Cook wrote: > On Fri, Aug 07, 2020 at 08:42:43PM -0700, David Miller wrote: >> From: "luobin (L)" >> Date: Sat, 8 Aug 2020 11:36:42 +0800 >> >>> On 2020/8/7 17:32, David Laight wrote: > diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c > b/drivers/net/e

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread luobin (L)
On 2020/8/8 11:42, David Miller wrote: > From: "luobin (L)" > Date: Sat, 8 Aug 2020 11:36:42 +0800 > >> On 2020/8/7 17:32, David Laight wrote: diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c index c6adc776f3c8..1ec8

RE: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread David Laight
From: luobin (L) > Sent: 08 August 2020 04:37 > > On 2020/8/7 17:32, David Laight wrote: > > From: Luo bin > >> Sent: 07 August 2020 03:09 > >> > >> fix the compile warnings of 'strncpy' output truncated before > >> terminating nul copying N bytes from a string of the same length > >> > >> Signed-

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-07 Thread Kees Cook
On Fri, Aug 07, 2020 at 08:42:43PM -0700, David Miller wrote: > From: "luobin (L)" > Date: Sat, 8 Aug 2020 11:36:42 +0800 > > > On 2020/8/7 17:32, David Laight wrote: > >>> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c > >>> b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c > >

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-07 Thread David Miller
From: "luobin (L)" Date: Sat, 8 Aug 2020 11:36:42 +0800 > On 2020/8/7 17:32, David Laight wrote: >>> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c >>> b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c >>> index c6adc776f3c8..1ec88ebf81d6 100644 >>> --- a/drivers/net/ethernet/hu

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-07 Thread luobin (L)
On 2020/8/7 17:32, David Laight wrote: > From: Luo bin >> Sent: 07 August 2020 03:09 >> >> fix the compile warnings of 'strncpy' output truncated before >> terminating nul copying N bytes from a string of the same length >> >> Signed-off-by: Luo bin >> Reported-by: kernel test robot >> --- >> V0~

RE: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-07 Thread David Laight
From: Luo bin > Sent: 07 August 2020 03:09 > > fix the compile warnings of 'strncpy' output truncated before > terminating nul copying N bytes from a string of the same length > > Signed-off-by: Luo bin > Reported-by: kernel test robot > --- > V0~V1: > - use the strlen()+1 pattern consistently

[PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-06 Thread Luo bin
fix the compile warnings of 'strncpy' output truncated before terminating nul copying N bytes from a string of the same length Signed-off-by: Luo bin Reported-by: kernel test robot --- V0~V1: - use the strlen()+1 pattern consistently drivers/net/ethernet/huawei/hinic/hinic_devlink.c | 8 --