Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3176945pxu; Sat, 19 Dec 2020 15:16:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSL4tjcUutBAoPkf7PjkGgNbeF9f/BPOGq0N/vBSdcLlR8AbMMkztniGLqJSZKY4dJvttT X-Received: by 2002:a17:906:56ca:: with SMTP id an10mr9876129ejc.498.1608419779705; Sat, 19 Dec 2020 15:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608419779; cv=none; d=google.com; s=arc-20160816; b=UBrgqZ7ozFYvmG+Cz4vpQsKDmbwxiSCGvyWVE9W7iC6oYW+sahqRuGFOy+j8cgGBmY TsgptmNNNydAvH2VUdJYEa4h1P4A8XNqLV/9CpAKgwJs63U55vsVMBF11TChoXBwzZqY tjIwzhC8xBXI2bk58SyOlvsVcZcnLe+tZrsTxb398ucp7SIKbkWHfdrBlNvROhHIwZfU zOyUA7vcnApPyN0s6nssCZ4TJx9hiB/8CIUgku31KkJ1H6fOPsWORs+cJyGpyo1YACDt Y9zxjhZm0UepAYf1xAg622GUZELqaibnLzC1jr+ul7hCezANMtJFEU+B74cp6sdBrwgX CHQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=952r/TwLTft9QcwpprK5BYX6OAYMNEruDtHsm6l0lYk=; b=KzHUhW0nd9CVc9Aw0Hg5danF447gM6kDqwcEPFn9kbSXyovtpJRfKl4+6kgv/wl1WD pC3iwbVzvyQjjqBFGgKbirM9skOGofOLlZaPHFTEbi30aWGqRGNHXmbQ6Y1QzQ8OfPFg 8VlNiQrUIa+/eTXLpbrg13rzh+UG1nO4MtmHrHxyW1GIJnAg8kEfmACnGNU2AjC/BxN2 uenAwdwlvAdB1YbY+hNnP779vahTJt6y6b5YOjKpCvrWZIsYvQvftvW/lScse2cdQ5wc phx2YPRu8EI+HAAfH8k+VctomVtCRzhY/NUSFCul0qf8hprgedbU7B5g9I3LEjdScswn /c6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si7011887ejr.448.2020.12.19.15.15.57; Sat, 19 Dec 2020 15:16:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726527AbgLSXOK (ORCPT + 99 others); Sat, 19 Dec 2020 18:14:10 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:34488 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgLSXOK (ORCPT ); Sat, 19 Dec 2020 18:14:10 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 4F9D01C0B77; Sun, 20 Dec 2020 00:13:13 +0100 (CET) Date: Sun, 20 Dec 2020 00:13:13 +0100 From: Pavel Machek To: Martin Blumenstingl Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jerome Brunet , Jakub Kicinski Subject: Re: [PATCH 5.9 14/49] net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux Message-ID: <20201219231312.GA4206@duo.ucw.cz> References: <20201219125344.671832095@linuxfoundation.org> <20201219125345.376925474@linuxfoundation.org> <20201219215139.GA29536@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat 2020-12-19 23:38:25, Martin Blumenstingl wrote: > Hi Pavel, >=20 > On Sat, Dec 19, 2020 at 10:51 PM Pavel Machek wrote: > [...] > > I can't say I like this one: > > > > > > > clk_configs->m250_mux.reg =3D dwmac->regs + PRG_ETH0; > > > - clk_configs->m250_mux.shift =3D PRG_ETH0_CLK_M250_SEL_SHIFT; > > > - clk_configs->m250_mux.mask =3D PRG_ETH0_CLK_M250_SEL_MASK; > > > + clk_configs->m250_mux.shift =3D __ffs(PRG_ETH0_CLK_M250_SEL_MAS= K); > > > > It replaces constant with computation done at runtime; compiler can't > > optimize it as __ffs is implemented with asm(). > what do you suggest to use instead? > personally I don't see a problem because this is only called once at > driver probe time. I believe canonical solution is version before this patch, just with fixed values.... I mean yes, computation at runtime is not end of the world, but it is both slower and needs more code space... Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX96JCAAKCRAw5/Bqldv6 8kG3AJ9TFnaLlImgKAwuTjJSWWARH7RfeACgjwWXTvcOmAm6t7PKUvgihNopFLA= =89oe -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z--