From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B75E0C433C1 for ; Fri, 19 Mar 2021 17:38:16 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E79C6197B for ; Fri, 19 Mar 2021 17:38:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E79C6197B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wLBZzEU3wdjSITd9p7tRHt5YN76kddidgWwqNMP5wg8=; b=PTx7VRCIkkJkxodvIDqfHl7yn vwFuJORsfJ+s1XqgoGpJou+Lz8IwqedDz3ePQfCy+5wylgWjmJOLDJImpSPMSq+GKr6KefEvqvLdd yaee1T378Eqgw8ggVAaVuD1HfAAsVsbC4bmvKs5sy6Qt4aMax9nV40ytNnwvwQtJb6PBpolWwiiWB 3xLZu109Nqm2lNfmBnKLxpYb2Rz8Y0IEIBOjH3Lud3QOVveOqCjyIgo0RscLvERkpXwZfxWBIn+qV INlSCflEqEHqTQHbJiY3QETPwbzgmVTw6bwtJcrQQroHm+TJWLTPFxjkPgBUHuU6sF3yQIK+nyc0v wHEZ2RvVg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNJ3F-007rCC-2X; Fri, 19 Mar 2021 17:36:45 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNJ3A-007rBc-DC for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 17:36:42 +0000 Received: by mail-lf1-x129.google.com with SMTP id u10so11205656lff.1 for ; Fri, 19 Mar 2021 10:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lWvA/48XFK9LthHD8XWNH2G9h2Q/D7pf8r0WoDKA8qA=; b=IGuDs/Zr+b25y0bNBTt89tfNke9eRddRNMewy7U95g7th9S/Ube+V8HeS7HRH1ssHd 24gsXGfOkoWUvKX2nRHLDmcf9pUiRp67t7sYgjJrDgL5rX8vpgtamYN7JL897KrPOU2e S+YoTFQbs8oISzLPA04LSmnZn92bfv9+ArloQEk2jrn8Ix7YUst/4IXRB+fnc/LHmIIn UFZlJgxZ+D/tS5bdU8q7WKMJzKbN6uggdAF/Koke0Oz81WzurlTbLOD2aXPmPQL1HI2G 16wNwGZ2gOsN2gogJnU4GM6+yy+8hyyojtypkOcDdaqxC8cQjTQPT7Nf6OSsyjW4PDHK Ir4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lWvA/48XFK9LthHD8XWNH2G9h2Q/D7pf8r0WoDKA8qA=; b=nPxWJ/pX5tAJj9Qqd2UlSVCK3iuNYeP2p0DCqxvn+cFSiKt+JWb5i5OPpXucMZx9FD jHcKdB4pLWDxGaDcX9IDyihuMjqeC6C072xqlygUMYgm2LIJ3qtGlgXaU73zT5F4o5hP s5+AVnTya1EECL8nO/vc8HmR2usmYSOUSF61T5Z4rok+BoeG6WCd2h7nLKKUNfokRFpq 24bH44yPzDF5j3znplJi2abzEh4deQNZNr5/f7ElId1/h53vqBDulz95mpbzrx39cEyZ NreimaWe1XNSR20etS375S/fZUrhf5Pj3jidQBvx+cOw9bTHJ79sJGFytIfxE7OX5L37 gVSA== X-Gm-Message-State: AOAM530cyFRAGlHXVIBimdW6sYvR7W16ctUWMAH5AxC74wtSSlCTo9Ap NP1/Je1Q3IHSqQXjQGcCrHVcwy8zdbXuLQkX+FEWfg== X-Google-Smtp-Source: ABdhPJx3zEb7CeYeuyhxiQ8AWXAXc1DgEz/3FDITjeBbOZCgrgRsghMkf77Us76TwoHGRVhhHThXcK6TQampN2HhJ10= X-Received: by 2002:a19:430e:: with SMTP id q14mr1533339lfa.374.1616175399402; Fri, 19 Mar 2021 10:36:39 -0700 (PDT) MIME-Version: 1.0 References: <20210319165334.29213-1-andre.przywara@arm.com> <20210319165334.29213-11-andre.przywara@arm.com> In-Reply-To: <20210319165334.29213-11-andre.przywara@arm.com> From: Nick Desaulniers Date: Fri, 19 Mar 2021 10:36:28 -0700 Message-ID: Subject: Re: [PATCH 10/11] kselftest/arm64: mte: Fix clang warning To: Andre Przywara Cc: Will Deacon , Catalin Marinas , Shuah Khan , Amit Daniel Kachhap , Mark Brown , Vincenzo Frascino , Linux ARM , "open list:KERNEL SELFTEST FRAMEWORK" , Nathan Chancellor , clang-built-linux X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_173640_647359_10D34EA0 X-CRM114-Status: GOOD ( 19.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 19, 2021 at 9:53 AM Andre Przywara wrote: > > if (!prctl(...) == 0) is not only cumbersome to read, it also upsets > clang and triggers a warning: > ------------ > mte_common_util.c:287:6: warning: logical not is only applied to the > left hand side of this comparison [-Wlogical-not-parentheses] > .... > > Fix that by just comparing against "not 0" instead. > > Signed-off-by: Andre Przywara > --- > tools/testing/selftests/arm64/mte/mte_common_util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/arm64/mte/mte_common_util.c b/tools/testing/selftests/arm64/mte/mte_common_util.c > index aa8a8a6b8b6d..040abdca079d 100644 > --- a/tools/testing/selftests/arm64/mte/mte_common_util.c > +++ b/tools/testing/selftests/arm64/mte/mte_common_util.c > @@ -284,7 +284,7 @@ int mte_switch_mode(int mte_option, unsigned long incl_mask) > > en |= (incl_mask << PR_MTE_TAG_SHIFT); > /* Enable address tagging ABI, mte error reporting mode and tag inclusion mask. */ > - if (!prctl(PR_SET_TAGGED_ADDR_CTRL, en, 0, 0, 0) == 0) { > + if (prctl(PR_SET_TAGGED_ADDR_CTRL, en, 0, 0, 0) != 0) { How about `if (prctl(...)) {`? > ksft_print_msg("FAIL:prctl PR_SET_TAGGED_ADDR_CTRL for mte mode\n"); > return -EINVAL; > } > -- > 2.17.5 > -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel