From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: [PATCH bpf-next 09/14] bpf: add parenthesis around argument of BPF_LDST_BYTES() Date: Wed, 28 Mar 2018 17:48:33 -0700 Message-ID: <20180329004839.4506-10-jakub.kicinski@netronome.com> References: <20180329004839.4506-1-jakub.kicinski@netronome.com> Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, Jan Gossens , Jakub Kicinski To: alexei.starovoitov@gmail.com, daniel@iogearbox.net Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:37396 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752016AbeC2Atf (ORCPT ); Wed, 28 Mar 2018 20:49:35 -0400 Received: by mail-pf0-f194.google.com with SMTP id t16so2031768pfh.4 for ; Wed, 28 Mar 2018 17:49:35 -0700 (PDT) In-Reply-To: <20180329004839.4506-1-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: BPF_LDST_BYTES() does not put it's argument in parenthesis when referencing it. This makes it impossible to pass pointers obtained by address-of operator (e.g. BPF_LDST_BYTES(&insn)). Add the parenthesis. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet --- include/linux/filter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index 109d05ccea9a..c2f167db8bd5 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -372,7 +372,7 @@ struct xdp_rxq_info; #define BPF_LDST_BYTES(insn) \ ({ \ - const int __size = bpf_size_to_bytes(BPF_SIZE(insn->code)); \ + const int __size = bpf_size_to_bytes(BPF_SIZE((insn)->code)); \ WARN_ON(__size < 0); \ __size; \ }) -- 2.16.2