Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2692598imj; Mon, 11 Feb 2019 07:06:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IZk2Dwk+R8797QePOD5cFM9lA3tCQco9ey6zgBIA9EtYNGwIWO2Qech6dTan5h65ibJUDC+ X-Received: by 2002:a17:902:b697:: with SMTP id c23mr8114557pls.23.1549897585389; Mon, 11 Feb 2019 07:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897585; cv=none; d=google.com; s=arc-20160816; b=k3pr6Ua2sYC4FPcFPfJUUnrmiBOcgBHva+G7hXCnw9c57mpXG0j8/42bTR4+QQdK8n oMKbVibpsvVHB9rDqjIlP/fAty8a+ckWE1Eh+pboqv98OEUMafmVkCwn+wBziMDvOKM2 EZEPFicv294+8GBclYzicuonx3rMc1QhN3HtNzWHuIN/Z7VSGB3fi/wY2wiw3fkY+OuP xic2s9SW5FEmRyBHGFCMrj/hP/pr87CaWPGCMISCcwREYlKk1RDlQVtiY4MxB8nPCN+i bS9R8wZNHujV18cxs1KhYq9CMtB2xj0onLzFFRNT7X3McP4ZLmogKx3u5vNJhzlklqHM 94TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h2CjHuyrsF3OBNINACoQs1Cz+ZohoZXNmp2yr9MbrK0=; b=GxUxHDeyduPzq0NcEj6Hop2/JjmbzIXMOCYVTLTKFm/EnO3fhQS/yk9ZQYMpg4Pj3F tXR+S15KsLa6lfFHvPA7Ttw0yMy3oIrwo1qYUNMHA2w9rpiU2gNIRtnWAAC9mk6NsQ5w iW1e6NAA22n5sCTFOfwCqZatU8KVgPUWM0ud5CsZgE+3dwnxeX2rwskJmrgUyANfBvea bu1fP3JTIc02gyLnHBGFc0CEkZO6FtjGR1osJtDKyE/4ccvP316BGrjsCHI52UOXtoLM BnYOJ7hNRko1Q2/pTjkdrf7+SQLLehkriCB/0bfCmXJPwgRDOyi6FzuK6yu9WbtaxFvp hBAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RqQzNzAN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si86354plt.295.2019.02.11.07.06.09; Mon, 11 Feb 2019 07:06:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RqQzNzAN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390676AbfBKPDp (ORCPT + 99 others); Mon, 11 Feb 2019 10:03:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:52464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390074AbfBKPDo (ORCPT ); Mon, 11 Feb 2019 10:03:44 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF0BD222B0; Mon, 11 Feb 2019 15:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897423; bh=MR5cf+U0Zq+iUxkIHeCRuK0pK9RXyBQeG/pUAGpRlI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RqQzNzAN1AfebOp9P1A3jhWrkHoPMP2CYYKUGcyZFG1soEE+1LHN9bU7adxQueqEs JirpYqghs1M0uzsCgcKbA2wBYBUXYn+brVBObKLZ5GlwMYz7HCqe02HDUY3F03Qd3B msuUUYshuaVEsTqaP7r/KFD//nLL1h3gUJSVAA9U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Jiri Olsa , Alexander Shishkin , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 4.14 199/205] perf tests evsel-tp-sched: Fix bitwise operator Date: Mon, 11 Feb 2019 15:19:57 +0100 Message-Id: <20190211141841.432114826@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gustavo A. R. Silva commit 489338a717a0dfbbd5a3fabccf172b78f0ac9015 upstream. Notice that the use of the bitwise OR operator '|' always leads to true in this particular case, which seems a bit suspicious due to the context in which this expression is being used. Fix this by using bitwise AND operator '&' instead. This bug was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: stable@vger.kernel.org Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields") Link: http://lkml.kernel.org/r/20190122233439.GA5868@embeddedor Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/tests/evsel-tp-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -17,7 +17,7 @@ static int perf_evsel__test_field(struct return -1; } - is_signed = !!(field->flags | FIELD_IS_SIGNED); + is_signed = !!(field->flags & FIELD_IS_SIGNED); if (should_be_signed && !is_signed) { pr_debug("%s: \"%s\" signedness(%d) is wrong, should be %d\n", evsel->name, name, is_signed, should_be_signed);