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:   Thu, 15 Jun 2017 18:10:34 +0300
From:   Jani Nikula <jani.nikula@...ux.intel.com>
To:     Dawid Kurek <dawikur@...il.com>
Cc:     Daniel Vetter <daniel.vetter@...el.com>,
        Sean Paul <seanpaul@...omium.org>,
        David Airlie <airlied@...ux.ie>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm: Reduce scope of 'state' variable

On Thu, 15 Jun 2017, Dawid Kurek <dawikur@...il.com> wrote:
> On 15/06/17, Jani Nikula wrote:
>> Separate declaration and initialization would lead to a cleaner patch
>> and result.
>
> I saw combining declaration and initialization is quite common, i.e. in
> drm_atomic file. Personally, I also prefer those in one statement. But yes, it
> looks cleaner here, in two lines.

I'd say the rule of thumb is that combined declaration and
initialization is fine if the initialization is trivial, in particular
can never fail. If you need to check the return value, like in this
case, I'd prefer separate initialization.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ