lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 7 Sep 2016 02:00:07 +0000
From:   <Ronnie.Kunin@...rochip.com>
To:     <joe@...ches.com>, <Woojung.Huh@...rochip.com>,
        <netdev@...r.kernel.org>, <linux-usb@...r.kernel.org>
CC:     <f.fainelli@...il.com>, <UNGLinuxDriver@...rochip.com>,
        <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 0/2] lan78xx: Remove trailing underscores from macros

Microchip's internal convention is for register (offset) definitions to be capitalized (i.e.: MY_REGISTER). Our convention for bits (position) definitions within a register is to carry as a prefix the name of the register and suffix it with the bit name and adding a trailing underscore (i.e. MY_REGISTER_MY_BIT_). The trailing underscore is what easily lets us distinguish a bit from a register definition when reading code. We have been using this convention for many years and has worked very well for us across all projects (by now hundreds).

>Is there anything other than a one-time cost
>to apply these?  Is the same code used for
>other platforms?
Yes, a single header file with the definition of registers and bits is shared (either as a standalone file or with its contents pasted into a native environment "carrier" header file) across all drivers (and other non driver software projects as well) for the same device. So a change like this indeed has a high cost for Microchip and we'd rather not do this unless it is an absolutely mandated requirement. 

Thanks,
Ronnie
________________________________________
From: Joe Perches [joe@...ches.com]
Sent: Tuesday, September 06, 2016 9:18 PM
To: Woojung Huh - C21699; netdev@...r.kernel.org; linux-usb@...r.kernel.org
Cc: f.fainelli@...il.com; UNGLinuxDriver; linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] lan78xx: Remove trailing underscores from macros

On Tue, 2016-09-06 at 23:19 +0000, Woojung.Huh@...rochip.com wrote:
> > Joe Perches (2):
> >   lan78xx: Remove locally defined trailing underscores from defines and uses
> >   microchipphy.h and uses: Remove trailing underscores from defines and
> > uses
> >
> >  drivers/net/phy/microchip.c  |    4 +-
> >  drivers/net/usb/lan78xx.c    |  368 +++++++--------
> >  drivers/net/usb/lan78xx.h    | 1068 +++++++++++++++++++++-----------------
> > ----
> >  include/linux/microchipphy.h |   72 +--
> >  4 files changed, 756 insertions(+), 756 deletions(-)
>
>
> Because there is no specific rule how to name defines, I'm not sure it is worth to change 1000+ lines.
> It may be better to set guideline for new submissions.
>
> Welcome any comments.

Generally, more conforming to norms is better.
These FOO_ uses are non-conforming.

Is there anything other than a one-time cost
to apply these?  Is the same code used for
other platforms?

Powered by blists - more mailing lists