Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp491656pxb; Mon, 25 Oct 2021 12:17:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwAp4IMWe41FAuM/sKj3SQQLw33gPCmLaD/mWA6pEEyNJwLSUArY+ltBO60pdhwO2M+6CL X-Received: by 2002:a05:6a00:140c:b0:44b:e251:fe13 with SMTP id l12-20020a056a00140c00b0044be251fe13mr21013802pfu.10.1635189460908; Mon, 25 Oct 2021 12:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635189460; cv=none; d=google.com; s=arc-20160816; b=Lt0/yLoS40IKu49hrN+hxYm2iBnplhmuCVHbOSSkDfd9PfxpXGAsROq0t44vDj9qiE VDsyMBSDWu/6AQo/DrZRmzld2mhKY+/vqVS7TCb+qSqvqWKLtfip5GJPXgewyIufQuj7 Tsdh1NBkPLi3Tzu+551OuX0+itoMHBRLuVe/1AuaocH/mCg9/11FGQmynMhI2NVD5sGK ZBPri5Mqf5dONpwwJttoW9VYVfjnxtX17260VMHKgqlEsBVHf7snf+IdwOO6gVux9U4G 78t3uygJw1bi/jhCqu1e9azpC1vwsSHBP0EUFHUwFd+rrFhtg+GUHomYOYrXmBkZ9059 WSZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=xurY2HkKQefW5wazVFKDEKCrJReEOrDN/Xgbo8eYbMs=; b=wBayro9T/2RFc1WFlCVsTR2kWTAtm2DAxeerK06am9PN0BGdpYqktdY6tWyUICOb/n w80PKN42A7rgo+oKh4dWhr2QcV7psuXMaouwmT7sz5zvmTKRAOBXcJi58Ok+7QQR/G0A vmotT3HBaZ1dpr/b2x1mxRt9ibBAATxV9Ayq5dSPyM1LrmxQi9TyUogN1g8GFMJeO8uQ FFGZ7NlAlhakLF/BNrSZqyYRL9B6NiU7afofYIMWMmJe7VdPNWDpfyP5FrhOvVZ8PVtg SVhIQKE/dYK+lqXU26toKWHnfpXP4BAdUVhVY1d9vCVekgu8ICYJxBFpv4pyDAp8fSvz xClg== 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 o8si22443456plk.384.2021.10.25.12.17.27; Mon, 25 Oct 2021 12:17:40 -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 S233372AbhJYRZK convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Oct 2021 13:25:10 -0400 Received: from mail-yb1-f169.google.com ([209.85.219.169]:37566 "EHLO mail-yb1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231220AbhJYRZK (ORCPT ); Mon, 25 Oct 2021 13:25:10 -0400 Received: by mail-yb1-f169.google.com with SMTP id d204so12433300ybb.4; Mon, 25 Oct 2021 10:22:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sSSeHmsaBBlZpqQyuRz9odgeuyaHFZ1YcP2UvLwb0kU=; b=ykVbArbUalx8iOt31JnJSOrT4s+J1/l8KWkJuvXeE7sFBcUgMqlGAw42TXgenyknnE 2mbuqicvWh9kAPj35Ufypr2MMypRpXzpOSvafzob68W/LzOWcB1WsRQ+dHVSE/iBSeLF J1LsIh18f7QVtEZnYuomYQL/Z2Edec7ng3vcnlpjDsIO2AgeozehFSVtLutw20FsL+XB 5CD91nAfCRfNhfsJkc3kWXwLo9+ANWLZIgYB5U5O+JzJxRSYnN3V0PNbmtWrLHQAIEtH o/fnnsj4D9Yu9u45bO2JRikLyAIaSG99wvkcTSYFqA8JQlQpeqA+cifAUqmc3PtHdLj6 x9iA== X-Gm-Message-State: AOAM532XFjwvsi0I9q1pQgd0SHyX+v/SFkKiMLVUUbTDu8tgn1Yxx9zU qBrl4rjrrq5UdQ/1+vH/upSAWVinPparaSsXP2Kk5cA7vnI= X-Received: by 2002:a25:3412:: with SMTP id b18mr17851186yba.131.1635182567037; Mon, 25 Oct 2021 10:22:47 -0700 (PDT) MIME-Version: 1.0 References: <20211009131304.19729-1-mailhol.vincent@wanadoo.fr> <20211009131304.19729-2-mailhol.vincent@wanadoo.fr> <20211024183007.u5pvfnlawhf36lfn@pengutronix.de> In-Reply-To: <20211024183007.u5pvfnlawhf36lfn@pengutronix.de> From: Vincent MAILHOL Date: Tue, 26 Oct 2021 02:22:36 +0900 Message-ID: Subject: Re: [PATCH v2 1/3] can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode() To: Marc Kleine-Budde Cc: linux-can , netdev , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, Welcome back on the mailing list, hope you had some nice holidays! And also thanks a lot for your support over the last few months on my other series to introduce the TDC netlink interface :) Le lun. 25 oct. 2021 à 03:30, Marc Kleine-Budde a écrit : > > On 09.10.2021 22:13:02, Vincent Mailhol wrote: > > The statically enabled features of a CAN controller can be retrieved > > using below formula: > > > > | u32 ctrlmode_static = priv->ctrlmode & ~priv->ctrlmode_supported; > > > > 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. > > > > 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. I didn't do so initially because this is more a static configuration issue that should only occur during development. Nonetheless, what you suggest is really simple. I will just split the patch in two: one of the setter and one for the getter and address your comments. Yours sincerely, Vincent Mailhol