Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3145748pxu; Sat, 19 Dec 2020 13:54:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2JvLJBlrguqhkdfwMkkO2XxDOrkt9gQquQ5OVpmdO2Wcypf3JDLJ9oPctzp9hc5YocFPV X-Received: by 2002:a17:906:4e45:: with SMTP id g5mr9810910ejw.391.1608414849780; Sat, 19 Dec 2020 13:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608414849; cv=none; d=google.com; s=arc-20160816; b=KXoWG4i3hbewZPAih1q6hPMJM+a7B+AxIe1pZbgwcz641GEK96b8uZQ+DxgEL8eHH3 6WV8iKkpi3sJIJv6YNWCjKyZ2UezaybQlR1iWdIzCiQnk5ODRWnEzM3Qy7Pj2a/gKWgP jLheg3VbNXqzj+2SbhAF/7nj5PEQPNNyHIO/M3ZDmhRx1bH4aLR6nJs9ZZm4Rn9L/eY/ LEc9an8y0eKm6WvGfAePZjvORk97wvAJ9E1hMhZDsc93TzJrO5OrvBtBCmXUViF1H0uK oS7ZvYRbUF0OrlXuOMtOq1+uZX84PLWbaOKZlgvIhRjY8ELNQvj+IsZUrsd58P2tpUyM GRGA== 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=/P+u7Ferj0DPZVKP31lloLccVNjejYKPogiAPnFU1iI=; b=ruJbIJw0fm4h8yZE4wpl/1xYCJ51ONoTccNwc5danC1Hv+gB/pXNSeWyYb2MS1/uNt ri2kvBQ+w7nrb8LmISyUuntxvsFtwiAqa9La9mOr2LuDw2VQhwsRitKXvpKSHl6huhYn JQ4Wf/NU9sAh8bTTRKX8/dHeOFRfgqfewRTJ3gbTIaZcGo4SrRexjly8zyROmApB4AHF EfvXySGbrIZCLmrVn+bp+sW1GMnpWiC5ct7O4DUnRJHwnOxvsAk9aZ2c0/6+/8rLfoBv yX6IHr3PdwLFTritp8nsN5oTW3lYr0dQ/1J7pTe2jz32v//I5x/GsvKn7MFZ55fnQUfa iTmA== 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 c11si8288480edu.341.2020.12.19.13.53.47; Sat, 19 Dec 2020 13:54:09 -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 S1727944AbgLSVwY (ORCPT + 99 others); Sat, 19 Dec 2020 16:52:24 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:55082 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgLSVwX (ORCPT ); Sat, 19 Dec 2020 16:52:23 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id DB3B71C0B77; Sat, 19 Dec 2020 22:51:39 +0100 (CET) Date: Sat, 19 Dec 2020 22:51:39 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Martin Blumenstingl , 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: <20201219215139.GA29536@amd> References: <20201219125344.671832095@linuxfoundation.org> <20201219125345.376925474@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20201219125345.376925474@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Martin Blumenstingl >=20 > [ Upstream commit 82ca4c922b8992013a238d65cf4e60cc33e12f36 ] >=20 > The m250_sel mux clock uses bit 4 in the PRG_ETH0 register. Fix this by > shifting the PRG_ETH0_CLK_M250_SEL_MASK accordingly as the "mask" in > struct clk_mux expects the mask relative to the "shift" field in the > same struct. >=20 > While here, get rid of the PRG_ETH0_CLK_M250_SEL_SHIFT macro and use > __ffs() to determine it from the existing PRG_ETH0_CLK_M250_SEL_MASK > macro. 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_MASK); It replaces constant with computation done at runtime; compiler can't optimize it as __ffs is implemented with asm(). Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl/edesACgkQMOfwapXb+vLNhACeNKD0qJvCjQyfRTkrm7ragROq cS0An10DURGbZBZzo+5tsladCnjNC4n3 =b7bN -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--