linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ena: fix gcc-4.8 missing-braces warning
@ 2020-04-28 21:51 Arnd Bergmann
  2020-04-30  7:18 ` Jubran, Samih
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-04-28 21:51 UTC (permalink / raw)
  To: Netanel Belgazal, Arthur Kiyanovski, David S. Miller,
	Alexei Starovoitov, Daniel Borkmann, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend, Sameeh Jubran
  Cc: Arnd Bergmann, Guy Tzalik, Saeed Bishara, Zorik Machulsky,
	netdev, linux-kernel, bpf

Older compilers warn about initializers with incorrect curly
braces:

drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_xdp_xmit_buff':
drivers/net/ethernet/amazon/ena/ena_netdev.c:311:2: error: expected ',' or ';' before 'struct'
  struct ena_tx_buffer *tx_info;
  ^~~~~~
drivers/net/ethernet/amazon/ena/ena_netdev.c:321:2: error: 'tx_info' undeclared (first use in this function)
  tx_info = &xdp_ring->tx_buffer_info[req_id];
  ^~~~~~~
drivers/net/ethernet/amazon/ena/ena_netdev.c:321:2: note: each undeclared identifier is reported only once for each function it appears in

Use the GNU empty initializer extension to avoid this.

Fixes: 31aa9857f173 ("net: ena: enable negotiating larger Rx ring size")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 2cc765df8da3..ad385652ca24 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -307,7 +307,7 @@ static int ena_xdp_xmit_buff(struct net_device *dev,
 			     struct ena_rx_buffer *rx_info)
 {
 	struct ena_adapter *adapter = netdev_priv(dev);
-	struct ena_com_tx_ctx ena_tx_ctx = {0};
+	struct ena_com_tx_ctx ena_tx_ctx = { };
 	struct ena_tx_buffer *tx_info;
 	struct ena_ring *xdp_ring;
 	u16 next_to_use, req_id;
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] net: ena: fix gcc-4.8 missing-braces warning
  2020-04-28 21:51 [PATCH] net: ena: fix gcc-4.8 missing-braces warning Arnd Bergmann
@ 2020-04-30  7:18 ` Jubran, Samih
  0 siblings, 0 replies; 2+ messages in thread
From: Jubran, Samih @ 2020-04-30  7:18 UTC (permalink / raw)
  To: Arnd Bergmann, Belgazal, Netanel, Kiyanovski, Arthur,
	David S. Miller, Alexei Starovoitov, Daniel Borkmann,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend
  Cc: Tzalik, Guy, Bshara, Saeed, Machulsky, Zorik, netdev, linux-kernel, bpf


> -----Original Message-----
> From: Arnd Bergmann <arnd@arndb.de>
> Sent: Wednesday, April 29, 2020 12:51 AM
> To: Belgazal, Netanel <netanel@amazon.com>; Kiyanovski, Arthur
> <akiyano@amazon.com>; David S. Miller <davem@davemloft.net>; Alexei
> Starovoitov <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>;
> Jakub Kicinski <kuba@kernel.org>; Jesper Dangaard Brouer
> <hawk@kernel.org>; John Fastabend <john.fastabend@gmail.com>; Jubran,
> Samih <sameehj@amazon.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; Tzalik, Guy <gtzalik@amazon.com>;
> Bshara, Saeed <saeedb@amazon.com>; Machulsky, Zorik
> <zorik@amazon.com>; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; bpf@vger.kernel.org
> Subject: [EXTERNAL] [PATCH] net: ena: fix gcc-4.8 missing-braces warning
> 
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you can confirm the sender and know the
> content is safe.
> 
> 
> 
> Older compilers warn about initializers with incorrect curly
> braces:
> 
> drivers/net/ethernet/amazon/ena/ena_netdev.c: In function
> 'ena_xdp_xmit_buff':
> drivers/net/ethernet/amazon/ena/ena_netdev.c:311:2: error: expected ','
> or ';' before 'struct'
>   struct ena_tx_buffer *tx_info;
>   ^~~~~~
> drivers/net/ethernet/amazon/ena/ena_netdev.c:321:2: error: 'tx_info'
> undeclared (first use in this function)
>   tx_info = &xdp_ring->tx_buffer_info[req_id];
>   ^~~~~~~
> drivers/net/ethernet/amazon/ena/ena_netdev.c:321:2: note: each
> undeclared identifier is reported only once for each function it appears in
> 
> Use the GNU empty initializer extension to avoid this.
> 
> Fixes: 31aa9857f173 ("net: ena: enable negotiating larger Rx ring size")
Please use the correct fixes, it should be XDP TX commit.
Otherwise looks good,
Thanks!
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index 2cc765df8da3..ad385652ca24 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -307,7 +307,7 @@ static int ena_xdp_xmit_buff(struct net_device *dev,
>                              struct ena_rx_buffer *rx_info)  {
>         struct ena_adapter *adapter = netdev_priv(dev);
> -       struct ena_com_tx_ctx ena_tx_ctx = {0};
> +       struct ena_com_tx_ctx ena_tx_ctx = { };
>         struct ena_tx_buffer *tx_info;
>         struct ena_ring *xdp_ring;
>         u16 next_to_use, req_id;
> --
> 2.26.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-30  7:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 21:51 [PATCH] net: ena: fix gcc-4.8 missing-braces warning Arnd Bergmann
2020-04-30  7:18 ` Jubran, Samih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).