[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8729016553E3654398EA69218DA29EEF0E431D3A@cnshjmbx02>
Date: Tue, 22 Nov 2016 04:30:50 +0000
From: YUAN Linyu <Linyu.Yuan@...atel-sbell.com.cn>
To: Cong Wang <xiyou.wangcong@...il.com>
CC: David Miller <davem@...emloft.net>,
"cugyly@....com" <cugyly@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH] net: ioctl SIOCSIFADDR minor cleanup
I think there are newbie include me still use ifconfig utility.
So when I check this code, it can be optimized.
> -----Original Message-----
> From: netdev-owner@...r.kernel.org [mailto:netdev-owner@...r.kernel.org]
> On Behalf Of Cong Wang
> Sent: Tuesday, November 22, 2016 12:20 PM
> To: YUAN Linyu
> Cc: David Miller; cugyly@....com; netdev@...r.kernel.org
> Subject: Re: [PATCH] net: ioctl SIOCSIFADDR minor cleanup
>
> On Tue, Nov 15, 2016 at 7:57 PM, YUAN Linyu
> <Linyu.Yuan@...atel-sbell.com.cn> wrote:
> > No, this patch will not change dev->name,
> > It's care about ifa->ifa_label.
> >> - if (colon)
> >> - memcpy(ifa->ifa_label, ifr.ifr_name,
> IFNAMSIZ);
> >> - else
> >> - memcpy(ifa->ifa_label, dev->name,
> IFNAMSIZ);
> > When ifr.ifr_name have no colon, dev->name must equal to ifr.ifr_name.
> > So we change to
> >> - else
> >> - memcpy(ifa->ifa_label, ifr.ifr_name,
> IFNAMSIZ);
> > Then if and else do same thing. Just one line is enough,
> > memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
> >
>
> I don't understand why you try to optimize a slow path and some kind of
> obsolete code.
Powered by blists - more mailing lists