[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MW2PR2101MB08923F19D070996429979E38BF759@MW2PR2101MB0892.namprd21.prod.outlook.com>
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