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] [day] [month] [year] [list]
Message-ID: <20220715081520.GX2338@kadam>
Date:   Fri, 15 Jul 2022 11:15:20 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Steve French <smfrench@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors <kernel-janitors@...r.kernel.org>,
        Yu Zhe <yuzhe@...china.com>
Subject: Re: Is casting a void ptr to something else considered bad kernel
 coding style

On Thu, Jul 14, 2022 at 05:00:19PM -0500, Steve French wrote:
> For examples like this where a pointer which is (void *) is cast to
> something else, is this considered bad coding style in kernel C
> programming?
> 
> It may be that leaving the (unnecessary) cast in, although it is not
> required for C, makes the code clearer in some cases.
> 
> Any opinions on changes to remove casts of void pointers for kernel
> code (which I have recently seen suggested)?
> 

Pointless casts are bad, but the churn is bad too...

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ