Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3317040pxb; Fri, 5 Nov 2021 13:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxvu9Rb7CbGagKxewlzp6cDoB6dSU5/sZN8onl/hIGuQrLkN9LpniAb/RV+FJciA9ZsxCT X-Received: by 2002:a92:cd86:: with SMTP id r6mr24861139ilb.149.1636144335267; Fri, 05 Nov 2021 13:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636144335; cv=none; d=google.com; s=arc-20160816; b=fTDy0YJ2uO/I7io9gEDXe5CzxSIF/jVLaqvtUsPr3Nbu5WFMYxlAwJKmRPE4kvafFZ W0PEaNDsjGXZA7gqG+rIlr4zbDrDIcvn+ScyLp/w8DnhQG4p43XvM7R8lx34KdDbUSLO oHk+r0Re64fnFaebhac8c6a6Zpt25M6qibTt1Cy9C/4SA9UsL0Z8mEMkgdS7M8itUpNd /beE2Z1CPLSxDr3S6RD3pHO9uUxZqNPIo/M5uxuvkb/C+E8JcnBtdufsTHCvYgxPQh8i nTcAXQ5OdOK0H4Y7L1Nf2q63i1Va+JAkVQGGcbLbYGPEHpzYfcYTE8T0jMxna4Ds9/TD zCUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vuayPgK0AFa+ecEYX+ZQ8vgmFv5JEOwxSTm6d2kZs78=; b=nsfwIRiNOh1wktDkF6LQd4bL38OkTwF3YMoAjLbt2xPxVrYHi4KSkFm3sGKgh/McEg VywdzNK/PSN/hvWwueb4K9ApkMnP+BEc0s3riIsY3q01+ij1aWbss1Tj/y/UUj73fbUx vg7KygrICm0PZL5K6Jl/RrUpCanZwUoBnEb5GDZDe8yK8y6rxlFa1Gq9PswgF4CqKy2j LxJNQdZOtH3+6DpgpT7zqfdiRblUELbdDwlaBs5hHqgHj6RI94qD7LPuXX8FiHeXIkYN pH0GnaG/x60bSgqc4wJbFQ6/LddfHdB35txYMqqJT3KfisXzC8TUUs7Un+pMzMp6z/oH qZcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RnLKexsr; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si9881022ilh.136.2021.11.05.13.32.02; Fri, 05 Nov 2021 13:32:15 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=RnLKexsr; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231221AbhKEUUI (ORCPT + 99 others); Fri, 5 Nov 2021 16:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233113AbhKEUUH (ORCPT ); Fri, 5 Nov 2021 16:20:07 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AEBBC061205 for ; Fri, 5 Nov 2021 13:17:27 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 1so16858934ljv.2 for ; Fri, 05 Nov 2021 13:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vuayPgK0AFa+ecEYX+ZQ8vgmFv5JEOwxSTm6d2kZs78=; b=RnLKexsrCAjWUIWwBZJfog7vhfH5WjN0Y7/YF3zs2wOqmrQE9nWihazTTbqcXtgNEP RNPZtzuvVpldX7fSo1DnFucJJy1OYubefmnOlOt62AtxzoQyyuWnY71JVUAnromuH+6B N9fAHe3RZqI/7+KL0cN3xwUnWjmvCjq0uiXvBd01XwM5XDotom9RHn19Q3GfLb/Fz1Xj gOIBEpcBsM2uNBBCVwGUov8nM49RQuzGEFZDgDlRddmnis4ves7gWRZyct12HUIsbO5G OFgp9Opri3GuuIE9wu8qeSYA5SeB7XS7Q+62+kZaBUEXN8LB9OD9gHn5BtjBTXCkuwtx 2/kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vuayPgK0AFa+ecEYX+ZQ8vgmFv5JEOwxSTm6d2kZs78=; b=EZQvFA6Zfj5D/g8TP206FM7naJYiFFEaWq+UCyPNcfDhliAsGcsyzgCTMmP8CcKKu2 1FycpyPysc3fXTOtfnFe5j22QSPZJ77I5Z1Jh10GlImlpuRh5nTP3c2UwkA05UiDFu3R wH3yKqhPW/Ijhl17Q0LYxjxoq2mEyTWG8k8w1ivvI3Wiif/K9tHjClok2a+hyr5MMxmR WB+QLi879ubpxUvRQ/Z4O8o02oolcMIdRqiO55WArBnlY1dwCRhEd1NdIUxx0OQrGF7O jp0KCqV9DtqDtchxSh+FAnwjLT7WosUaBGTLZZIkXxXG6ZlIuXdxiIVug9dPynTz0U2N bHVQ== X-Gm-Message-State: AOAM532a0kjRAtFOZsm6/+YZs85cDsNoLrzJFOTOG8kg9p4JLR7kmDZs vtMA4eHnjgUxoyH9K+D0UwMshNiuUuClqhrSsFTaDN8ocmo= X-Received: by 2002:a2e:9192:: with SMTP id f18mr5264789ljg.220.1636143445722; Fri, 05 Nov 2021 13:17:25 -0700 (PDT) MIME-Version: 1.0 References: <20211105162756.3314148-1-anders.roxell@linaro.org> In-Reply-To: <20211105162756.3314148-1-anders.roxell@linaro.org> From: Nick Desaulniers Date: Fri, 5 Nov 2021 13:17:14 -0700 Message-ID: Subject: Re: [PATCH] selftests: vDSO: parse: warning: fix assignment as a condition To: Anders Roxell Cc: shuah@kernel.org, nathan@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 5, 2021 at 9:28 AM Anders Roxell wrote: > > When building selftests/vDSO with clang the following warning shows up: > > clang -std=gnu99 -Wno-pointer-sign vdso_test_gettimeofday.c parse_vdso.c -o /home/anders/.cache/tuxmake/builds/current/kselftest/vDSO/vdso_test_gettimeofday > parse_vdso.c:65:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] > if (g = h & 0xf0000000) > ~~^~~~~~~~~~~~~~~~ > > Rework to a parentheses before doing the check. > > Signed-off-by: Anders Roxell Thanks for the patch! Reviewed-by: Nick Desaulniers > --- > tools/testing/selftests/vDSO/parse_vdso.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c > index 413f75620a35..b47b721a4ea4 100644 > --- a/tools/testing/selftests/vDSO/parse_vdso.c > +++ b/tools/testing/selftests/vDSO/parse_vdso.c > @@ -62,7 +62,7 @@ static unsigned long elf_hash(const unsigned char *name) > while (*name) > { > h = (h << 4) + *name++; > - if (g = h & 0xf0000000) > + if ((g = (h & 0xf0000000))) > h ^= g >> 24; > h &= ~g; > } > -- > 2.33.0 > -- Thanks, ~Nick Desaulniers