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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A803C433EF for ; Mon, 22 Nov 2021 16:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zDzOAtXpUf/chupIkuOlSgHiv12RqMpgPZ8y6E3/EhU=; b=mB3PQIveDZmIsR YeYrmrY/El6FUSlJ28b7km/ULnhLPeDDQqDyRLl/p5dli1/ow9xDhU+q20gIsCIFXsAH6AE8QBuDh KffO7JkGUybs+KESxIW+zegNaq06ZdT/eehvrcAKzHAlQ0afZxY1eh5tEnDhPs6cEEthhXNAB3tEL O9P+wipBnCowI9/3iDBQpM8PrQ7EGW4A7fQDpu0IFSlAyKgDDoZicrQJ2G4mx4eijjJGBoJ/A5jNR Iu6y04+rrjsRPIJaCuScRi+obY3nRE0FO8i9a8UNpJcT3vik+EnGDTkZVj1JSGCIg9hbRH150PzCo zC9qNaLJmOLvfpwegNgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpC1B-00H8JG-55; Mon, 22 Nov 2021 16:18:09 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpC17-00H8Iu-L3 for linux-arm-kernel@lists.infradead.org; Mon, 22 Nov 2021 16:18:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=24LjR7gSAjMhRN/vywVP1+SlgTQtcn8P8tFurSL+i2o=; b=LPbs3R9yHEGt5XVWTVcNGe9NSb SsTfagyVS204f1CijpQwuVjOmklRJOHVeASb7QPcEIzTkzHFTrFCVcUatC94rwY63vFBKxAzQjS/4 HciZnMMPOvKyn9IPyXoFigDgJzxcaSgc8162QdYDSpByRmD74lp1o9a+UuhA30GK+QWdsvU12m7Z+ PGjCtvwBiURAJ1lmFLuWPxmOfC28lD5BrInXMPZ/7lLbus4CCt5G5Pk44UuQa9COQYPdr68yDrxuK bKkSoSqOQP3bmb61mPI88qrgm5GVVz0SROWRNj4yYDfs0PT92N7w+dNkHCuz2Q9EAdYh6EmQkzfr7 SH0zNF0Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55792) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mpC11-0006u7-3J; Mon, 22 Nov 2021 16:17:59 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpC0y-0007pI-Vn; Mon, 22 Nov 2021 16:17:56 +0000 Date: Mon, 22 Nov 2021 16:17:56 +0000 From: "Russell King (Oracle)" To: Geert Uytterhoeven Cc: Oleg Nesterov , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: ptrace: Use bitfield helpers Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211122_081805_716842_0064E116 X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 22, 2021 at 04:53:41PM +0100, Geert Uytterhoeven wrote: > The isa_mode() macro extracts two fields, and recombines them into a > single value. The shift value of the J-bit may look off-by-one to the > casual reader, as it is the net result of the extraction and > recombination steps. I'd recommend avoiding the suggestion that the explicit "- 1" could be misinterpreted as an off-by-one error. > #define isa_mode(regs) \ > - ((((regs)->ARM_cpsr & PSR_J_BIT) >> (__ffs(PSR_J_BIT) - 1)) | \ > - (((regs)->ARM_cpsr & PSR_T_BIT) >> (__ffs(PSR_T_BIT)))) > + ((FIELD_GET(PSR_J_BIT, (regs)->ARM_cpsr) << 1) | \ I'd suggest getting rid of the extra unnecessary parens there. Too many parens leads to a decrease in readability. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel