Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-22 Thread Nikolay Aleksandrov
On 22/07/18 09:27, David Miller wrote: > From: Nikolay Aleksandrov > Date: Fri, 20 Jul 2018 17:48:25 +0300 > >> +spin_lock_bh(>br->lock); >> +ret = brport_attr->store_raw(p, (char *)buf); >> +spin_unlock_bh(>br->lock); > > Please respect the const here. > >

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-22 Thread David Miller
From: Nikolay Aleksandrov Date: Fri, 20 Jul 2018 17:48:25 +0300 > + spin_lock_bh(>br->lock); > + ret = brport_attr->store_raw(p, (char *)buf); > + spin_unlock_bh(>br->lock); Please respect the const here. Have the methods do a kstrncup(); ... kfree();

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Stephen Hemminger
On Fri, 20 Jul 2018 20:47:26 +0300 Nikolay Aleksandrov wrote: > On July 20, 2018 8:26:36 PM GMT+03:00, Nikolay Aleksandrov > wrote: > >On July 20, 2018 8:20:44 PM GMT+03:00, Stephen Hemminger > > wrote: > >>On Fri, 20 Jul 2018 20:14:43 +0300 > >>Nikolay Aleksandrov wrote: > >> > >>>

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Nikolay Aleksandrov
On July 20, 2018 8:26:36 PM GMT+03:00, Nikolay Aleksandrov wrote: >On July 20, 2018 8:20:44 PM GMT+03:00, Stephen Hemminger > wrote: >>On Fri, 20 Jul 2018 20:14:43 +0300 >>Nikolay Aleksandrov wrote: >> >>> >Casting away the const on the buf variable is going to cause >>warnings >>> >and should

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Nikolay Aleksandrov
On July 20, 2018 8:20:44 PM GMT+03:00, Stephen Hemminger wrote: >On Fri, 20 Jul 2018 20:14:43 +0300 >Nikolay Aleksandrov wrote: > >> >Casting away the const on the buf variable is going to cause >warnings >> >and should not be necessary. >> > >> >> It doesn't when it's casted like that, the

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Stephen Hemminger
On Fri, 20 Jul 2018 20:14:43 +0300 Nikolay Aleksandrov wrote: > >Casting away the const on the buf variable is going to cause warnings > >and should not be necessary. > > > > It doesn't when it's casted like that, the new line is changed to null byte > so we need to drop > the const. Then

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Nikolay Aleksandrov
On July 20, 2018 6:57:25 PM GMT+03:00, Stephen Hemminger wrote: >On Fri, 20 Jul 2018 17:48:25 +0300 >Nikolay Aleksandrov wrote: > >> This patch adds a new alternative store callback for port sysfs >options >> which takes a raw value (buf) and can use it directly. It is needed >for the >> backup

Re: [Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Stephen Hemminger
On Fri, 20 Jul 2018 17:48:25 +0300 Nikolay Aleksandrov wrote: > This patch adds a new alternative store callback for port sysfs options > which takes a raw value (buf) and can use it directly. It is needed for the > backup port sysfs support since we have to pass the device by its name. > >

[Bridge] [PATCH net-next 1/2] net: bridge: add support for raw sysfs port options

2018-07-20 Thread Nikolay Aleksandrov
This patch adds a new alternative store callback for port sysfs options which takes a raw value (buf) and can use it directly. It is needed for the backup port sysfs support since we have to pass the device by its name. Signed-off-by: Nikolay Aleksandrov --- There are a few checkpatch warnings