Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3920631pxb; Sun, 24 Oct 2021 14:58:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdU9j769/6P2k+YewbGQOPAZASQNEjc62byCfbxsPOIQH4DSUhTzuWmTnSgv4vmlvOPdPq X-Received: by 2002:a05:6a00:23c8:b0:44c:d139:f3a4 with SMTP id g8-20020a056a0023c800b0044cd139f3a4mr14011873pfc.31.1635112681974; Sun, 24 Oct 2021 14:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635112681; cv=none; d=google.com; s=arc-20160816; b=fiLPOKrDEIKaK2GGMsxwdc/1XrYyB+3XZx++ZFBWv5Yb1GsmIU7uw8K754NURjuonv eYhSZrPSUAFNiIK1JGUxD5JnfiKhWrhVcc13WAKNOuU17B9F73RSIC5WjG3QYyBd/dvx g2p44v3r0J0II/vE0Sghe/Ph0/zKFZSMvxG+KKTnqTEcjb4Ds5Id1HaqgxcVLjD7rIvD 7lt5SSOCE/odpyyc+JESgifNyAHRsVJvvXzjKOImRJ1OfbHL/h5Knn/j8BCUtmlSG40M xL3uf/58gvNHbguv0Tcg0JuPMuDMoBSPCDfGIvhhmdEg26KrZ7V44FdPYPWh85GrAqIQ F/1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PV9abyTH6Wyb8UH7dhhcwMNBnIMTN6Tc5SDs2oOzonA=; b=Z7OUZXDlLfWqge/beKrtFukkC/6RPAxetk8OW7rntdGzvQyIqIkdrStIADnyuokzvG 9bvRlPtvdobbG5g4QsAGxg7Tazk+34QBOOZpvHEga6PDFaHou1xj3fL/Fc+esV3UrBEQ y/SR0vOsadoEuiCpFp8FH2OPT/acOOji+xdNaP9W0ORR2JEN+0INpNiqXx6qH3SNU69i x6eqA5pubRjWHt3MfYbyftpaEpZuZiK2hkisjI1ZJDJlrQype99Z0e0W52vjHEFrBMQv mTmqAzxpYTPrj1cNZbF2Yv96qZbFGrcFquCwg9ZD48mBKVe5xPrSooDhbbzHCdNG+IUK Ze8A== 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 n16si3532127plf.362.2021.10.24.14.57.49; Sun, 24 Oct 2021 14:58:01 -0700 (PDT) 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 S231563AbhJXU1t (ORCPT + 99 others); Sun, 24 Oct 2021 16:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbhJXU1t (ORCPT ); Sun, 24 Oct 2021 16:27:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8079C061764 for ; Sun, 24 Oct 2021 13:25:27 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mek3Z-0004WZ-8J; Sun, 24 Oct 2021 22:25:25 +0200 Received: from pengutronix.de (unknown [195.138.59.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id B674869C4BD; Sun, 24 Oct 2021 18:30:38 +0000 (UTC) Date: Sun, 24 Oct 2021 20:30:07 +0200 From: Marc Kleine-Budde To: Vincent Mailhol Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode() Message-ID: <20211024183007.u5pvfnlawhf36lfn@pengutronix.de> References: <20211009131304.19729-1-mailhol.vincent@wanadoo.fr> <20211009131304.19729-2-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="j2t56hliosb7bl7z" Content-Disposition: inline In-Reply-To: <20211009131304.19729-2-mailhol.vincent@wanadoo.fr> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --j2t56hliosb7bl7z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 09.10.2021 22:13:02, Vincent Mailhol wrote: > The statically enabled features of a CAN controller can be retrieved > using below formula: >=20 > | u32 ctrlmode_static =3D priv->ctrlmode & ~priv->ctrlmode_supported; >=20 > As such, there is no need to store this information. This patch remove > the field ctrlmode_static of struct can_priv and provides, in > replacement, the inline function can_get_static_ctrlmode() which > returns the same value. >=20 > A condition sine qua non for this to work is that the controller > static modes should never be set in can_priv::ctrlmode_supported. This > is already the case for existing drivers, however, we added a warning > message in can_set_static_ctrlmode() to check that. Please make the can_set_static_ctrlmode to return an error in case of a problem. Adjust the drivers using the function is this patch, too. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --j2t56hliosb7bl7z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmF1piwACgkQqclaivrt 76kLnggAoub6uxZSjw+RAuu+7oCV8QIq8RMmqNioSlIxS+ioE8a8cA/UOwuIE9Er wYCqsiSeF45Hdw+UHM7Vo97STc4P+SiKNcvvEUfcrXK0bdt2rcHeG9TvcargTm4a RJ99/EdATlozz5r0uHElYu3jpOX9retnf8OIAVfYgqpLKhmMDE+hnI0p30TWPxqy g65v2IZjWtkWZwuhBUbcSVn+YfgMrorzPkKCTzt01twrV4x/9o0BiqDIjK+WXzP+ 5T89refE08e1sclogONO5hUaVN1aQSYm6Kni2NAJciuYhzqyLG4nJVBBBZHZxH7W fWwvIKN4BMwvNYE5rq89gcMmFDjeDQ== =K7iG -----END PGP SIGNATURE----- --j2t56hliosb7bl7z--