Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4028899ybd; Tue, 25 Jun 2019 12:44:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyXvYhTJ2lucn55dOcUAtdHuRlBZ0I6CXkLqbRZJVwAZVKfgpN3PE/YuwuMQOZjuDCvZH8 X-Received: by 2002:a17:902:6b07:: with SMTP id o7mr447267plk.180.1561491882728; Tue, 25 Jun 2019 12:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561491882; cv=none; d=google.com; s=arc-20160816; b=ZSXXf+3HSelsxwyvNRGou4Qhf3ofjZr0JNpvrmfFkOzYzOkz8AQmlLtzamw/WebDP3 DMGgf4mqY/3sZvFfnh9sqzGKdUStwEPx+4RUCHggUA4aKUDs1NLd85+Uhuej1NvVxo2Y vSP5lJePFEaG26fw03g9VfNXcBOPuvZb0+flDctaodAJnQ+cMFYijQbxn7ZztG+GjYJp ZqY7rBXykoTkqM+rjWkIlpoRrb3E9cs53rx6N1qf0cqfOa5UirCkNEW1ZZ2C55jbf9ng 50AnaF/Jh8jHK41zy891YBwNNheFuXFvqdeLdOTS7wtqX5KHkveOVV1AorabLqSXr/zh opQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rzyidifbKQyPCMdTBcL2yG4RU2y2irZ4p7l+bdetWeg=; b=WALd1J3DiI29CN543ESvCb6EpqMc3FscGFkXDaAAWZ8yQ+90ClBLfl1F/iJJ1OrLFg zNmQBM32h11jnd0R7KWPomsEX6LM0i6pOIC1rEgHOdoUtciiMW/hvhU18EpMvlm4E2+q Ok7lXwE3ABuajy3f0RnqY5dHVEd8NNrJlGxN5FhpbbjBKJlrFfIw15abEogwleuT07NA wJu8HjxZHNioCf3FUeyBp8FbUS/nxjr9VtBgi2MTULEGXPrdFAd1wAl1NSflhPriwxnR 6htdII6/To8mcntZZfohTRpx2P3zJMzfqQUGfkazivBHrSwArPS6+twdSmKxhXQI+98A mfsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l0X8y69G; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32si995642pld.438.2019.06.25.12.44.27; Tue, 25 Jun 2019 12:44:42 -0700 (PDT) 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=l0X8y69G; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729158AbfFYRVU (ORCPT + 99 others); Tue, 25 Jun 2019 13:21:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:47022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfFYRVU (ORCPT ); Tue, 25 Jun 2019 13:21:20 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 F311A20883; Tue, 25 Jun 2019 17:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561483279; bh=y3gHH2+O9Ql5mg2OLCYxLt0FlNiFmTJg7bWVV64XY6A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l0X8y69GjzACRoWboU+YWIzW7at90jv3ub3xnAcXiI2AY8/5/o+s3FRVzpgcgow0s qZmJE2x8/1tEeCUA18QS4W+Yz1mC+61cO3nOBUjQHVQcXFkkCUKwIEfAS1tx+d6aG5 CA/HKhKBrcyp62GzhIdzWDjDAQIaPUIBh0JBfMOI= Date: Tue, 25 Jun 2019 18:21:07 +0100 From: Will Deacon To: Phong Tran Cc: acme@kernel.org, alexander.shishkin@linux.intel.com, alexander.sverdlin@gmail.com, allison@lohutok.net, andrew@lunn.ch, ast@kernel.org, bgolaszewski@baylibre.com, bpf@vger.kernel.org, daniel@iogearbox.net, daniel@zonque.org, dmg@turingmachine.org, festevam@gmail.com, gerg@uclinux.org, gregkh@linuxfoundation.org, gregory.clement@bootlin.com, haojian.zhuang@gmail.com, hsweeten@visionengravers.com, illusionist.neo@gmail.com, info@metux.net, jason@lakedaemon.net, jolsa@redhat.com, kafai@fb.com, kernel@pengutronix.de, kgene@kernel.org, krzk@kernel.org, kstewart@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux@armlinux.org.uk, liviu.dudau@arm.com, lkundrak@v3.sk, lorenzo.pieralisi@arm.com, mark.rutland@arm.com, mingo@redhat.com, namhyung@kernel.org, netdev@vger.kernel.org, nsekhar@ti.com, peterz@infradead.org, robert.jarzmik@free.fr, s.hauer@pengutronix.de, sebastian.hesselbarth@gmail.com, shawnguo@kernel.org, songliubraving@fb.com, sudeep.holla@arm.com, swinslow@gmail.com, tglx@linutronix.de, tony@atomide.com, yhs@fb.com Subject: Re: [PATCH V3 01/15] arm: perf: cleanup cppcheck shifting error Message-ID: <20190625172106.26xxbeiwpn4avykh@willie-the-truck> References: <20190624135105.15579-1-tranmanphong@gmail.com> <20190625040356.27473-1-tranmanphong@gmail.com> <20190625040356.27473-2-tranmanphong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190625040356.27473-2-tranmanphong@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 11:03:42AM +0700, Phong Tran wrote: > There is error from cppcheck tool > "Shifting signed 32-bit value by 31 bits is undefined behaviour errors" > change to use BIT() marco for improvement. s/marco/macro/ As Peter pointed out, this "error" is also a false positive also for the kernel. > Signed-off-by: Phong Tran > --- > arch/arm/kernel/perf_event_v7.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c > index a4fb0f8b8f84..2924d7910b10 100644 > --- a/arch/arm/kernel/perf_event_v7.c > +++ b/arch/arm/kernel/perf_event_v7.c > @@ -697,9 +697,9 @@ static struct attribute_group armv7_pmuv2_events_attr_group = { > /* > * Event filters for PMUv2 > */ > -#define ARMV7_EXCLUDE_PL1 (1 << 31) > -#define ARMV7_EXCLUDE_USER (1 << 30) > -#define ARMV7_INCLUDE_HYP (1 << 27) > +#define ARMV7_EXCLUDE_PL1 BIT(31) > +#define ARMV7_EXCLUDE_USER BIT(30) > +#define ARMV7_INCLUDE_HYP BIT(27) Acked-by: Will Deacon You can drop this into Russell's patch system[1]. Will [1] https://www.arm.linux.org.uk/developer/patches/