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 Apr 2021 08:28:45 +0000
From:   Dexuan Cui <decui@...rosoft.com>
To:     Leon Romanovsky <leon@...nel.org>
CC:     Andrew Lunn <andrew@...n.ch>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        Wei Liu <liuwe@...rosoft.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>
Subject: RE: [PATCH net-next] net: mana: Add a driver for Microsoft Azure
 Network Adapter (MANA)

> From: Leon Romanovsky <leon@...nel.org>
> Sent: Wednesday, April 7, 2021 1:15 AM
> > ...
> > int gdma_test_eq(struct gdma_context *gc, struct gdma_queue *eq)
> > {
> >         struct gdma_generate_test_event_req req = { 0 };
> >         struct gdma_general_resp resp = { 0 };
> 
> BTW, you don't need to write { 0 }, the {} is enough.
 
Thanks for the suggestion! I'll use {0} in v2. 

BTW, looks like both are widely used in the kernel. Maybe someone
should update scripts/checkpatch.pl to add a warning agaist { 0 } in
new code, if {0} is preferred. :-)

dexuan@...alhost:~/linux$ grep "= { 0 };" kernel/ -nr | wc -l
4
dexuan@...alhost:~/linux$  grep "= {0};" kernel/ -nr | wc -l
4

dexuan@...alhost:~/linux$ grep "= { 0 };" Documentation/  -nr
Documentation/networking/page_pool.rst:117:    struct page_pool_params pp_params = { 0 };

dexuan@...alhost:~/linux$ grep "= { 0 };" drivers/ -nr | wc -l
1085
dexuan@...alhost:~/linux$ grep "= {0};" drivers/ -nr | wc -l
1321

dexuan@...alhost:~/linux$ grep "= { 0 };" drivers/net/ -nr | wc -l
408
dexuan@...alhost:~/linux$  grep "= {0};" drivers/net/ -nr | wc -l
708

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ