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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70726C433F5 for ; Tue, 21 Dec 2021 14:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238363AbhLUOMV (ORCPT ); Tue, 21 Dec 2021 09:12:21 -0500 Received: from www381.your-server.de ([78.46.137.84]:60726 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232757AbhLUOMU (ORCPT ); Tue, 21 Dec 2021 09:12:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=8p7ecK45hVMn5gLDPgo9VsNqGb2KdV/HRhC09pdrmXQ=; b=auQvbmMR1lTu3+4B8lLJSfCCri jztKfEm+WOTER+y7KhwgBnlpRm2QYYXRlqr1SkrvZ7TFaZILqUl3Gokrjj/L1yjQUkWvGTCT5rhkw NMugzh36V7+wYIIucohNF+O22YE2RZkk2RZB+vd3A648gPXQSNwZw1+6ZTE+g2+EIsVQaEKlL8s7A 3BDXMLIcpaEgLntQPQBqGN0bd7kDy9RZnkOvlpS2XQ0g28xywVGyudp9lxDjQnPrTlpKGl1B9QAAy iPd7Rr3ZbwWkZf1201pumlFkbn5Hqx5rY1TjHZK7mYNsX3OfullOvzRDiUIzepbsNY8PxlmAIa/gV QiVKHiCA==; Received: from [78.46.152.42] (helo=sslproxy04.your-server.de) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mzfs7-000CA8-6D; Tue, 21 Dec 2021 15:12:07 +0100 Received: from [2001:a61:2bc8:8501:9e5c:8eff:fe01:8578] by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzfs6-000PVb-PF; Tue, 21 Dec 2021 15:12:06 +0100 Subject: Re: [PATCH 0/8] counter: Remove struct counter_device::priv To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Cc: Alexandre Torgue , David Lechner , Fabrice Gasnier , Jarkko Nikula , Kamel Bouhara , Maxime Coquelin , Oleksij Rempel , Patrick Havelange , Syed Nayyar Waris , William Breathitt Gray , linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20211221104546.214066-1-u.kleine-koenig@pengutronix.de> <20211221113542.rl4aburbzzrgs3km@pengutronix.de> <65009237-7e61-21aa-60cd-b7f7e0bb2f91@metafoo.de> <20211221132258.472t537373vto7bz@pengutronix.de> From: Lars-Peter Clausen Message-ID: <9d5788ab-4576-08c3-e347-9348aba3804a@metafoo.de> Date: Tue, 21 Dec 2021 15:12:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211221132258.472t537373vto7bz@pengutronix.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.3/26395/Tue Dec 21 10:18:41 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/21/21 2:22 PM, Uwe Kleine-König wrote: > On Tue, Dec 21, 2021 at 01:04:50PM +0100, Lars-Peter Clausen wrote: >> On 12/21/21 12:35 PM, Uwe Kleine-König wrote: >>> On Tue, Dec 21, 2021 at 12:12:12PM +0100, Lars-Peter Clausen wrote: >>>> On 12/21/21 11:45 AM, Uwe Kleine-König wrote: >>>>> similar to patch >>>>> https://lore.kernel.org/r/4bde7cbd9e43a5909208102094444219d3154466.1640072891.git.vilhelm.gray@gmail.com >>>>> the usage of struct counter_device::priv can be replaced by >>>>> container_of which improves type safety and code size. >>>>> >>>>> This series depends on above patch, converts the remaining drivers and >>>>> finally drops struct counter_device::priv. >>>> Not sure if this is such a good idea. struct counter_device should not be >>>> embedded in the drivers state struct in the first place. >>> Just to mention it: My patch series didn't change this, this was already >>> broken before. >> I know, but this series has to be reverted when the framework is fixed. > All drivers have to be touched. With my patch series you have to modify > one function in each driver, without my patch you have touch nearly > every function. > I'm not so sure. I don't see how you have to modify every function. You'd keep using priv to get a pointer to the state struct. That said having a centralized function in each driver to get the state struct from the counter device doesn't hurt either. 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 32152C433F5 for ; Tue, 21 Dec 2021 14:14:39 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GORz/09C6RVTgz762nQ/CWgHJs2/vdUot/UiRzdC0OY=; b=aSUF4mKMor86DW66mMJYNO/Rhr 5WMzwjax3WAHjrK6WTVISKeRucmLLkIb1LlrOft93BqE+A5jyd0UjoktGrLi9eRFDS9tkDCPtLdWZ dHVF+KofGCEtzSNLKFziqEoFE7697qf9639aZBUYQ0F4WZJ4OmNNQ7MgdD8yrhIx2TKSkfPH6aYXK wZQxwYLqZRQKIdqybZtEsqHWg3RHUhY8Rf/bRmvfNgDYmWixZbKX57MU2R0EUZ332S/FBO0rqsz5L lmICVQH5o4G2qosl38ZUr79F7Oh9O54wK/0NyCnpOxba+jJx+1zknGJ7V2AuL2/E9KXQES45C+baQ x0vHhuqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzfsK-00754B-Qq; Tue, 21 Dec 2021 14:12:20 +0000 Received: from www381.your-server.de ([78.46.137.84]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzfsH-00753b-76 for linux-arm-kernel@lists.infradead.org; Tue, 21 Dec 2021 14:12:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=8p7ecK45hVMn5gLDPgo9VsNqGb2KdV/HRhC09pdrmXQ=; b=auQvbmMR1lTu3+4B8lLJSfCCri jztKfEm+WOTER+y7KhwgBnlpRm2QYYXRlqr1SkrvZ7TFaZILqUl3Gokrjj/L1yjQUkWvGTCT5rhkw NMugzh36V7+wYIIucohNF+O22YE2RZkk2RZB+vd3A648gPXQSNwZw1+6ZTE+g2+EIsVQaEKlL8s7A 3BDXMLIcpaEgLntQPQBqGN0bd7kDy9RZnkOvlpS2XQ0g28xywVGyudp9lxDjQnPrTlpKGl1B9QAAy iPd7Rr3ZbwWkZf1201pumlFkbn5Hqx5rY1TjHZK7mYNsX3OfullOvzRDiUIzepbsNY8PxlmAIa/gV QiVKHiCA==; Received: from [78.46.152.42] (helo=sslproxy04.your-server.de) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mzfs7-000CA8-6D; Tue, 21 Dec 2021 15:12:07 +0100 Received: from [2001:a61:2bc8:8501:9e5c:8eff:fe01:8578] by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzfs6-000PVb-PF; Tue, 21 Dec 2021 15:12:06 +0100 Subject: Re: [PATCH 0/8] counter: Remove struct counter_device::priv To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Cc: Alexandre Torgue , David Lechner , Fabrice Gasnier , Jarkko Nikula , Kamel Bouhara , Maxime Coquelin , Oleksij Rempel , Patrick Havelange , Syed Nayyar Waris , William Breathitt Gray , linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20211221104546.214066-1-u.kleine-koenig@pengutronix.de> <20211221113542.rl4aburbzzrgs3km@pengutronix.de> <65009237-7e61-21aa-60cd-b7f7e0bb2f91@metafoo.de> <20211221132258.472t537373vto7bz@pengutronix.de> From: Lars-Peter Clausen Message-ID: <9d5788ab-4576-08c3-e347-9348aba3804a@metafoo.de> Date: Tue, 21 Dec 2021 15:12:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211221132258.472t537373vto7bz@pengutronix.de> Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.3/26395/Tue Dec 21 10:18:41 2021) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_061217_279157_4B54D244 X-CRM114-Status: GOOD ( 17.43 ) 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="windows-1252"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 12/21/21 2:22 PM, Uwe Kleine-K=F6nig wrote: > On Tue, Dec 21, 2021 at 01:04:50PM +0100, Lars-Peter Clausen wrote: >> On 12/21/21 12:35 PM, Uwe Kleine-K=F6nig wrote: >>> On Tue, Dec 21, 2021 at 12:12:12PM +0100, Lars-Peter Clausen wrote: >>>> On 12/21/21 11:45 AM, Uwe Kleine-K=F6nig wrote: >>>>> similar to patch >>>>> https://lore.kernel.org/r/4bde7cbd9e43a5909208102094444219d3154466.16= 40072891.git.vilhelm.gray@gmail.com >>>>> the usage of struct counter_device::priv can be replaced by >>>>> container_of which improves type safety and code size. >>>>> >>>>> This series depends on above patch, converts the remaining drivers and >>>>> finally drops struct counter_device::priv. >>>> Not sure if this is such a good idea. struct counter_device should not= be >>>> embedded in the drivers state struct in the first place. >>> Just to mention it: My patch series didn't change this, this was already >>> broken before. >> I know, but this series has to be reverted when the framework is fixed. > All drivers have to be touched. With my patch series you have to modify > one function in each driver, without my patch you have touch nearly > every function. > I'm not so sure. I don't see how you have to modify every function. = You'd keep using priv to get a pointer to the state struct. That said having a centralized function in each driver to get the state = struct from the counter device doesn't hurt either. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel