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.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 4679AC433E0 for ; Tue, 5 Jan 2021 14:07:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 0A2CA22AAA for ; Tue, 5 Jan 2021 14:07:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A2CA22AAA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pAblxlqYCCM4e8+XJnx4cOqEFDPJ2p0nuay5YmvW6cw=; b=oUeVsyXEZqK2okgMl62IFPMEY H2io0bFNgchpneTjrnhGQ6lIdc/Bztyh+g5uPKOkV0Wjtyl8DQern/lwJz5Py51tJMOBcpcPIL1pt CeTpBYEGEZZB+RTTCAEU9KKlinRQmbk8Bdnjzdd9WSC4vehTUarFpZx3nQexhzl/yGYwHhrNWk1pf bcOwZek4m89k/RCfJmnGXrgITvmWU8D1cAcHQLQTumx2dJhyjmr7rhOxZIwCA42VmmlHuTRSd5Ori BxflRr5Xg/mm4YK4oRhpye3IcNYLZ5SHKhwDSG9LjMt0ckYkiMI64yhJBtfEdybkCc80ESK61MgXu 3mbtLIp/Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwmxC-0002xp-GP; Tue, 05 Jan 2021 14:04:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwmww-0002ph-Sd for linux-arm-kernel@lists.infradead.org; Tue, 05 Jan 2021 14:04:40 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 D3B2422AAE; Tue, 5 Jan 2021 14:04:37 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kwmwt-005RZD-Ps; Tue, 05 Jan 2021 14:04:35 +0000 MIME-Version: 1.0 Date: Tue, 05 Jan 2021 14:04:35 +0000 From: Marc Zyngier To: Alexandru Elisei Subject: Re: [PATCH] KVM: arm64: Remove spurious semicolon in reg_to_encoding() In-Reply-To: <7a5b86e3-a470-a2e0-71b9-177c6c15ecfd@arm.com> References: <20201231150936.4013764-1-maz@kernel.org> <7a5b86e3-a470-a2e0-71b9-177c6c15ecfd@arm.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210105_090439_082352_57E25CC2 X-CRM114-Status: GOOD ( 18.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-01-05 13:54, Alexandru Elisei wrote: > Hi Marc, > > On 12/31/20 3:09 PM, Marc Zyngier wrote: >> Although not a problem right now, it flared up while working >> on some other aspects of the code-base. Remove the useless >> semicolon. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/kvm/sys_regs.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c >> index d46e7f706cb0..42ccc27fb684 100644 >> --- a/arch/arm64/kvm/sys_regs.c >> +++ b/arch/arm64/kvm/sys_regs.c >> @@ -923,7 +923,7 @@ static bool access_pmuserenr(struct kvm_vcpu >> *vcpu, struct sys_reg_params *p, >> >> #define reg_to_encoding(x) \ >> sys_reg((u32)(x)->Op0, (u32)(x)->Op1, \ >> - (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2); >> + (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2) > > Macro's shouldn't really end with a semicolon, otherwise code might > break > unexpectedly: > > Reviewed-by: Alexandru Elisei > > I skimmed over the code and the macro is used like a function. Do you > think it's > worth turning it into a function to gain type checking for the > argument (which is > expected to be sys_reg_desc) and for the return value? Not quite. This macro takes indifferently a sys_reg_desc or a sys_reg_params, making it impossible to turn into a function. Is it disgusting and makes you want to pull your eyes out? Yes. The whole params/desc duality dates back to the early 32bit code, and I blame Rusty Russell for it. Just saying... ;-) That's one of things I always wanted to refactor... Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel