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 520A2C48BC4 for ; Thu, 15 Feb 2024 17:52:01 +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=pWHo3ozc9mAprKAM9UvyxdvP1y4LkvufPVH+jYNQVqY=; b=B0WUehsxSwsz/e Uq+heXe+wno1z6TbzwkGXxPm3gugJpyXZWREvM8/122uRBpNShnW/d4kl6luacWm0N48qVpubcOYw QidmthHG5x+nEEy9gDCXwJltLUL7TsNnCG3nRoey5HMCfU+4SOyikRI2wO7PR1+GtkNeoXltPCfp4 mfugbjlHH8nPyEKyqiWZlYb5JnoxkNM2ZhKHU+r4a2QE63hY/lUnfEQbmyLbPNBleFK+3uOwc9eOC 5/IYNGeIcGfcJffJQzH+6I3j96IJEeAsP9617ZF9x+4H/haj0YPSZ2ltO07gH69otF7BHsZBeNHeG MiqXEaGejwOBwZIdvalw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rafto-0000000HFvA-0MS5; Thu, 15 Feb 2024 17:51:52 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raftd-0000000HFt2-1s7c for linux-arm-kernel@lists.infradead.org; Thu, 15 Feb 2024 17:51:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708019496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GG6Ulxh+r2vwDrd1myPyHalaQeRg4IYOcP2tfu6yPes=; b=QQdQ1WMeJI9SPRyYPtGFFwhbi9gv5jn5FfjLj08+880+kHEyPJw7aLHyuq+zf9xSevcTcQ 5IazelkOpQviVjf/BDG0/bFJGlQcE2wrx/LSA8+uq+/g2pN6XcKfJWb4Y4UnqucOW7IcQl X9bNT7yx0wr6ppkRdf3Yos8J1IyoxlY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-670-WaAN2ccvO1q6c7KHKvc2Xg-1; Thu, 15 Feb 2024 12:51:32 -0500 X-MC-Unique: WaAN2ccvO1q6c7KHKvc2Xg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7C20185A780; Thu, 15 Feb 2024 17:51:31 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.56]) by smtp.corp.redhat.com (Postfix) with SMTP id 3AFE3492BC6; Thu, 15 Feb 2024 17:51:28 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 15 Feb 2024 18:50:14 +0100 (CET) Date: Thu, 15 Feb 2024 18:50:11 +0100 From: Oleg Nesterov To: Geert Uytterhoeven Cc: Russell King , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ARM: ptrace: Use bitfield helpers Message-ID: <20240215174945.GA29299@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240215_095146_621548_4577D08F X-CRM114-Status: GOOD ( 10.22 ) 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 Sorry for the noise, can't resist... I am replying only because I wasn't aware of bitfield.h and useful helpers there. Thank you ;) On 02/15, Geert Uytterhoeven wrote: > > #ifndef __ASSEMBLY__ > +#include > #include > > struct pt_regs { > @@ -35,8 +36,8 @@ struct svc_pt_regs { > > #ifndef CONFIG_CPU_V7M > #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 | \ > + FIELD_GET(PSR_T_BIT, (regs)->ARM_cpsr)) Reviewed-by: Oleg Nesterov _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel