Return-Path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:32913 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbfFYTqE (ORCPT ); Tue, 25 Jun 2019 15:46:04 -0400 From: "Jonathan Lemon" Subject: Re: [PATCH] xsk: Properly terminate assignment in xskq_produce_flush_desc Date: Tue, 25 Jun 2019 12:46:02 -0700 Message-ID: <34F07894-FDE7-44F8-B7F2-E2003D550AD2@gmail.com> In-Reply-To: <20190625182352.13918-1-natechancellor@gmail.com> References: <20190625182352.13918-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Sender: xdp-newbies-owner@vger.kernel.org List-ID: To: Nathan Chancellor Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, xdp-newbies@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Huckleberry On 25 Jun 2019, at 11:23, Nathan Chancellor wrote: > Clang warns: > > In file included from net/xdp/xsk_queue.c:10: > net/xdp/xsk_queue.h:292:2: warning: expression result unused > [-Wunused-value] > WRITE_ONCE(q->ring->producer, q->prod_tail); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:284:6: note: expanded from macro 'WRITE_ONCE' > __u.__val; \ > ~~~ ^~~~~ > 1 warning generated. > > The q->prod_tail assignment has a comma at the end, not a semi-colon. > Fix that so clang no longer warns and everything works as expected. > > Fixes: c497176cb2e4 ("xsk: add Rx receive functions and poll support") > Link: https://github.com/ClangBuiltLinux/linux/issues/544 > Signed-off-by: Nathan Chancellor Nice find. Acked-by: Jonathan Lemon > --- > net/xdp/xsk_queue.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h > index 88b9ae24658d..cba4a640d5e8 100644 > --- a/net/xdp/xsk_queue.h > +++ b/net/xdp/xsk_queue.h > @@ -288,7 +288,7 @@ static inline void xskq_produce_flush_desc(struct > xsk_queue *q) > /* Order producer and data */ > smp_wmb(); /* B, matches C */ > > - q->prod_tail = q->prod_head, > + q->prod_tail = q->prod_head; > WRITE_ONCE(q->ring->producer, q->prod_tail); > } > > -- > 2.22.0