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]
Message-ID: <1475269365.1880.6.camel@perches.com>
Date:   Fri, 30 Sep 2016 14:02:45 -0700
From:   Joe Perches <joe@...ches.com>
To:     Guenter Roeck <groeck@...gle.com>
Cc:     Jun Li <jun.li@....com>, Guenter Roeck <groeck@...omium.org>,
        Felipe Balbi <felipe.balbi@...ux.intel.com>,
        Chandra Sekhar Anagani <chandra.sekhar.anagani@...el.com>,
        Bruce Ashfield <bruce.ashfield@...driver.com>,
        Bin Gao <bin.gao@...el.com>,
        Pranav Tipnis <pranav.tipnis@...el.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: Re: [RFC PATCH v3 1/2] usb: typec: USB Type-C Port Manager (tcpm)

On Fri, 2016-09-30 at 13:57 -0700, Guenter Roeck wrote:
> Code now looks as follows.
> 
> #define PDO_VAR_MIN_VOLT(mv) ((((mv) / 50) & PDO_VAR_MIN_VOLT_MASK) << \
>                               PDO_VAR_MIN_VOLT_SHIFT)
> #define PDO_VAR_MAX_VOLT(mv) ((((mv) / 50) & PDO_VAR_MAX_VOLT_MASK) << \
>                               PDO_VAR_MAX_VOLT_SHIFT)
> #define PDO_VAR_MAX_CURR(ma) ((((ma) / 10) & PDO_VAR_MAX_CURR_MASK) << \
>                               PDO_VAR_MAX_CURR_SHIFT)

When #defines are continued, I generally find it nicer to have the
entire definition on a separate line

#define PDO_VAR_MIN_VOLT(mv)						\
	((((mv) / 50) & PDO_VAR_MIN_VOLT_MASK) << PDO_VAR_MIN_VOLT_SHIFT)

> Though maybe I should just ignore line length limits or use shorter defines.

When it makes sense, yes please.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ