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:   Sat, 5 Nov 2016 16:38:44 +0000
From:   Eric Engestrom <eric@...estrom.ch>
To:     Christian König <christian.koenig@....com>
Cc:     linux-kernel@...r.kernel.org,
        Ville Syrjälä <ville.syrjala@...ux.intel.com>,
        Alex Deucher <alexander.deucher@....com>,
        David Airlie <airlied@...ux.ie>,
        Xinliang Liu <z.liuxinliang@...ilicon.com>,
        Daniel Vetter <daniel.vetter@...el.com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        VMware Graphics <linux-graphics-maintainer@...are.com>,
        Sinclair Yeh <syeh@...are.com>,
        Thomas Hellstrom <thellstrom@...are.com>,
        Tom St Denis <tom.stdenis@....com>,
        Michel Dänzer <michel.daenzer@....com>,
        Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
        Emily Deng <Emily.Deng@....com>,
        Chunming Zhou <David1.Zhou@....com>,
        Flora Cui <Flora.Cui@....com>,
        Vitaly Prosyak <vitaly.prosyak@....com>,
        Ken Wang <Qingqing.Wang@....com>,
        Colin Ian King <colin.king@...onical.com>,
        Alexandre Demers <alexandre.f.demers@...il.com>,
        Junwei Zhang <Jerry.Zhang@....com>,
        Xinwei Kong <kong.kongxinwei@...ilicon.com>,
        Chris Wilson <chris@...is-wilson.co.uk>,
        Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
        Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
        dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org
Subject: Re: [PATCH] drm: move allocation out of drm_get_format_name()

On Saturday, 2016-11-05 13:11:36 +0100, Christian König wrote:
> Am 05.11.2016 um 02:33 schrieb Eric Engestrom:
> > +typedef char drm_format_name_buf[32];
> 
> Please don't use a typedef for this, just define the maximum size of
> characters the function might write somewhere.
> 
> See the kernel coding style as well:
> > In general, a pointer, or a struct that has elements that can reasonably
> > be directly accessed should **never** be a typedef.
> 

I would normally agree as I tend to hate typedefs ($DAYJOB {ab,mis}uses
them way too much), and your way was what I wrote at first, but Rob Clark's
typedef idea makes it much harder for someone to allocate a buffer of
the wrong size, which IMO is good thing here.

I can rewrite the typedef out if you think it's better.

Cheers,
  Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ