From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87CC07E767 for ; Mon, 29 Apr 2024 20:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714422898; cv=none; b=cr2W/glxUQwz+ZqsiOFVh3RvTT8IEla/AmxWKZrcDyLKPS7Ixd/PY7bP5TKeer6AfksTLR+F4xlTmox4sqaKTSHCjAaVYcPsa7u/M4y5sf88RSnZLZ35aaJagVDRozxphGDFr8cdUijGqK7/C0PMHS+kK/m29S22tmuyWahszZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714422898; c=relaxed/simple; bh=FJgJcexbKP8Vs2qsQoifsZ/CG9oPAv6wyYJlV8ROmx8=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=sVsCwHqcV+LDQzaNMUUBy3R3stts1roqagDAfXsfzPtEfZF1/WS76fbgy60dppxbyM+i1kBWLpnioF2Uv3NFUpDzImzRa9DL4LokVsvIifDBwyesLW5lFEBv20zLEOZ2F1H9Rueb5wKdoLqCbmUt9kwjT/kYTPvA+GpvnG8HxhU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2xz5nksS; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2xz5nksS" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-61bb09d8fecso58066787b3.0 for ; Mon, 29 Apr 2024 13:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714422895; x=1715027695; darn=lists.linux.dev; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=9mL2eooEb/7s/U1rMU577fBDSrTqCDNk48ffx+zYIGY=; b=2xz5nksSMWtcE557E8h3Y35hcK+cuxw9LjXvBoZ834iH1jVsL+/A0jz9PuWi/6YJdk rFzwB46ZX90GIDNgjxZ4KagM1FxPNEveKTM5/5P9uwUx8Gf3wVSFyiJBBoaH3A/LOjV9 wybJk+oaTt/SQwQPphCSkfQ31b891ewdLX9WBPEvOwXOnxTjNzhrAlIHDVRE0kgSAHkL uo19rAFIKPh/ugnbwJdqLkRiTC7/oioTeM07gmX5AWumqLsF4UaxIfr7+Njlw5vLhBdF 137aL1yJcOF1uZMqJDjvG191iCIVOJxwOWK+wHX+2mzy7GjbFhVyDN1Tr1rrOnBQ8WnV bsEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714422895; x=1715027695; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9mL2eooEb/7s/U1rMU577fBDSrTqCDNk48ffx+zYIGY=; b=S6ZUSA6hn6P+tDPYk6zcGcr7gIHMYeiJcQI9fQmDcOzV7d70Kswpg6K2YalmfAYhMD kPGKSwGqU+2prOFyIW4D0ljPegT9m1ZywC4ahW1VTnIL8P2uVn7Ieq8qCi+dHc0gLwcM RYsoN5V7Ymzcl/5K1AClpz+QNYkev/Wn2Pbd5B0nGVLcPn9O1PPL9qeKy2Mt//iwcQce +N6n4tcEe1AfCSJvCiQSWLkQWsDRxfSWnLQSeuiss3vfdp9DR5EU1X9ktc3HDJHJaDD7 jB5XT14OhfjcnMB5xjsY7CB/qdHM6CitfFNtO5HBcwehL16yvOjxOy57OA4bpNkiUYAE 1+zA== X-Forwarded-Encrypted: i=1; AJvYcCUw19nXqBkK5WbpAsilUfyQluRCttW3WrU6MXZgL0dQkBayD+X06Gfz63rkU2mTFzxlcqo5f0aarBjS5BkvCrwcp2+FhQ== X-Gm-Message-State: AOJu0YzOMwAKGdNJuLHk6uty0uWsiEAdfZIbvFdlGIywsikK3TOBZYlk IJstwOF2WIzpMI+IOJZv7POndu9AoSL/3MzXWJ8LJFTTR+loxoD6tGhglms1l/uPKATTJbEq0BO 8nA== X-Google-Smtp-Source: AGHT+IEg/h9s1d+Swx9EJYfMUgBN/ifTzPWb8HrDxhF+oosvBsPlL28UkAI466cJzdn/BGYHBGso4LvRogE= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a81:a142:0:b0:61b:a123:1c53 with SMTP id y63-20020a81a142000000b0061ba1231c53mr168083ywg.4.1714422895519; Mon, 29 Apr 2024 13:34:55 -0700 (PDT) Date: Mon, 29 Apr 2024 20:34:36 +0000 Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Message-ID: <20240429203441.143607-1-edliaw@google.com> Subject: [PATCH] selftests/vDSO: Fix assignment in condition without parentheses From: Edward Liaw To: linux-kernel@vger.kernel.org, Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , "H. Peter Anvin" , Andy Lutomirski Cc: linux-kselftest@vger.kernel.org, kernel-team@android.com, Edward Liaw , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Fixes clang compiler warnings by adding parentheses: parse_vdso.c:65:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] if (g = h & 0xf0000000) ~~^~~~~~~~~~~~~~~~ parse_vdso.c:65:9: note: place parentheses around the assignment to silence this warning if (g = h & 0xf0000000) ^ ( ) parse_vdso.c:65:9: note: use '==' to turn this assignment into an equality comparison if (g = h & 0xf0000000) ^ == Fixes: 98eedc3a9dbf ("Document the vDSO and add a reference parser") Signed-off-by: Edward Liaw --- 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..b9cf771006da 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.44.0.769.g3c40516874-goog