Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp609822ybz; Wed, 15 Apr 2020 15:05:36 -0700 (PDT) X-Google-Smtp-Source: APiQypJLmSNBywZVx1BhTHUIvVgRVxiQrJTbjJ735N2029eAbuKNzoa+sd/H9IqRtSgcMdJcGM/Z X-Received: by 2002:aa7:ce82:: with SMTP id y2mr27300774edv.11.1586988335978; Wed, 15 Apr 2020 15:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988335; cv=none; d=google.com; s=arc-20160816; b=wghfPyfDJqLqrr5GSbSSNdPdO0dKd4jXX8fxNWEax128KfYShrEDIoX6w08DEt/l5k mXlYKpebXFVvGCUUGCEl+aUIk0MvltQfyKUUT0xvbQvikwXoPOE4FNXK+W5NV45xE/mH knSUbx6KAM3eQcvpMHUeKh/RS1Hol9xO942GgYcz/d72gquHfK3oOT7iyG1zfY7dfCZ+ 7dFfmrtcEmgR737T2YpI5jK/R+bCubVsPHGVoFaPupyEI0MoEhbL2SRhIuZKY2pCTAxn TShU1/hoSypxcnWB5jgv0JLQ42De3U4/O0UzAKK+M7Keeczo4PIizJcycyYL0Bid7dNM ZOzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=e7iROWIOjyGkXJyF8kUmFMTQPK9cqamhxGS+lIBzdY0=; b=ty2nLwqsuB3Zkk5GmxcJtvf2RPkuXdP/yrzSBh1Q2ll3dKzGXLue0rtdOVxksPOGpF MxRZ/aBR7ayz1i62BisZGN1sAzG28Dw5uiprSwAyV2aXE2XcGK1Hj2hJSQ5EV/fq+3Fq NzfjbzxvQkfA/j+u6CgsBRy/6sUNUlRIbJ+Adm2fTow9efwNk1+ZhAn/Oz0FDH3tfbMp lzhgGJICKvVYsVrfuhfXXCKxkvZQubOe3ZCI2L0FW2oIkGexxapZhlILyOb8tAqABd2y eh8gEYGknt4zEUA6NbcuASKDJ8uTAK1AlU7h9NQtX7+Gu2xMVDsj3CCTBuZltvhRExYD N6AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si12801261edp.102.2020.04.15.15.05.12; Wed, 15 Apr 2020 15:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbgDOEI6 (ORCPT + 99 others); Wed, 15 Apr 2020 00:08:58 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:49494 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726438AbgDOEIy (ORCPT ); Wed, 15 Apr 2020 00:08:54 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 006F68FE7EA597A0F157; Wed, 15 Apr 2020 12:08:49 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Wed, 15 Apr 2020 12:08:41 +0800 From: Zou Wei To: , , , , , , , , , , , , , , , CC: Zou Wei Subject: [PATCH -next] selftests/seccomp: Use bitwise instead of arithmetic operator for flags Date: Wed, 15 Apr 2020 12:15:01 +0800 Message-ID: <1586924101-65940-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This silences the following coccinelle warning: "WARNING: sum of probable bitmasks, consider |" tools/testing/selftests/seccomp/seccomp_bpf.c:3131:17-18: WARNING: sum of probable bitmasks, consider | tools/testing/selftests/seccomp/seccomp_bpf.c:3133:18-19: WARNING: sum of probable bitmasks, consider | tools/testing/selftests/seccomp/seccomp_bpf.c:3134:18-19: WARNING: sum of probable bitmasks, consider | tools/testing/selftests/seccomp/seccomp_bpf.c:3135:18-19: WARNING: sum of probable bitmasks, consider | Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Reported-by: Hulk Robot Signed-off-by: Zou Wei --- tools/testing/selftests/seccomp/seccomp_bpf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 89fb3e0..1b4cdf3 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -3128,11 +3128,11 @@ TEST(get_metadata) static int user_trap_syscall(int nr, unsigned int flags) { struct sock_filter filter[] = { - BPF_STMT(BPF_LD+BPF_W+BPF_ABS, + BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), - BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, nr, 0, 1), - BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_USER_NOTIF), - BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW), + BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, nr, 0, 1), + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_USER_NOTIF), + BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), }; struct sock_fprog prog = { -- 2.6.2