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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEA25C433DF for ; Wed, 12 Aug 2020 16:03:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89A5E20675 for ; Wed, 12 Aug 2020 16:03:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rIcbTsI/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="H9w2mY6f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89A5E20675 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/+JQnq9lJGfKNkyPdFxyz4+PmzMJ7hJod1u35BdEGVY=; b=rIcbTsI/+wxn+07hWa52npV0p HcI8QptURGhfzMsCdpBnc9sP++oC3h9gQMNvaDrNlt4j4objWjBZxk4ygjt2gzug/8lAHPOo5fni+ GzgkSY+Oal3cdGND8eesX67hl92n6dROHeBUhMu9P2nYU7YyJ1dkSQP/ZAFC2Dv7QW+wN4Jvzz17M XeEVVRe/UxViX1j+8AtqnVyU3LRzsKR2smaTt1UPomu6YEdHHqUzTLlGZ2PNJ/J1in6R0YsmVjLxg PD+m1JEQ8R9kLHhtJetkiTXN+SgHua33nTho0pPNQeXEbI7RZp2uqFmAa2TzYBLgQ9Xk4np6AzrfR aPv19SfuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5tB4-0005GD-Ly; Wed, 12 Aug 2020 16:00:34 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5tB1-0005FD-TA for linux-arm-kernel@lists.infradead.org; Wed, 12 Aug 2020 16:00:33 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 07CG0T8O050082; Wed, 12 Aug 2020 11:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1597248029; bh=02ZEbPG60T+9TFX2JsaFFkktquPFZf1Si0VmO18RfTI=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=H9w2mY6fm2wsqTgq5ZDyXKbESuoPz5xCTPTw7JcD1v+0frmNswa+/P16xRDrueRTq BxxFRwmDae62UFwrI9pzsW/wOURR2wYtkG3oZNYI7RGKvUfxmRGQXdkeCabpSxLYXz u0UE60yVj57QY2U2dVV0MljMtnwdtj0hAe30Rsus= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 07CG0Tlf109184 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Aug 2020 11:00:29 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 12 Aug 2020 11:00:29 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 12 Aug 2020 11:00:29 -0500 Received: from [10.250.38.37] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 07CG0Sa2007723; Wed, 12 Aug 2020 11:00:29 -0500 Subject: Re: [PATCH v32 2/6] leds: lp50xx: Add the LP50XX family of the RGB LED driver To: Pavel Machek References: <20200722153146.8767-1-dmurphy@ti.com> <20200722153146.8767-3-dmurphy@ti.com> <20200811105413.r2m2f7bubuz55rrt@duo.ucw.cz> <935119fa-6d1f-8e99-51f9-87966b4d03ad@ti.com> <20200811220109.GA9105@amd> <3ce38a31-a4f0-4cd7-ad09-6bdad27e6756@ti.com> <20200811222602.GA10181@amd> From: Dan Murphy Message-ID: <5efcba1b-995e-b6fd-9004-fbafaae5b8a3@ti.com> Date: Wed, 12 Aug 2020 11:00:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200811222602.GA10181@amd> Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200812_120032_138505_6660E35F X-CRM114-Status: GOOD ( 15.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, marek.behun@nic.cz, jacek.anaszewski@gmail.com, linux-leds@vger.kernel.org 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 Pavel On 8/11/20 5:26 PM, Pavel Machek wrote: > Hi! > >>>> Well it depends on where we want to create the default cache values. >>>> >>>> Either we run through a for..loop during driver probe and delay device= start >>>> up or we keep the simple arrays and increase the driver total size. >>> for loop will be better. >>> >>> Plus, REGCACHE_RBTREE is very likely overkill. >> Well if I eliminate the reg_cache then I can eliminate the defaults too. > I'm not asking for that. But please investigate REGCACHE_FLAT. > > Pavel After looking at this a loop makes no sense here.=A0 The regmap call back = values are determined at build time not during runtime. Adding a loop here makes the code more complex just to reduce the = overall LoC.=A0 In adding the loop the reg_default array will have to be = re-allocated and copied at run time and then be expanded to include the = additional values. And the regmap defaults call backs will need to be updated to reflect = the new values.=A0 And these are part of a const struct because the = devm_regmap_init declares the config as a const. =A0=A0=A0 .reg_defaults =3D lp5012_reg_defs, =A0=A0=A0 .num_reg_defaults =3D ARRAY_SIZE(lp5012_reg_defs), So I am not sure that adding a loop here just to eliminate some LoC is = adding any value here.=A0 I can remove the #defines for the unused runtime = registers and hard code the additional register addresses in the default = array.=A0 That will at least eliminate some LoC and reduce the object size. I have no issue with using the REGCACHE_FLAT so I will make that change. Dan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel