Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3159753rwl; Sun, 2 Apr 2023 01:27:47 -0700 (PDT) X-Google-Smtp-Source: AK7set9W9eDSASGgKRkhb4glsVf/8eSYQCUTssSBVcI0D/ZVj+ew9pOUBdXat7cZV/3+6ftreGMX X-Received: by 2002:a05:6a20:c28a:b0:c7:770a:557f with SMTP id bs10-20020a056a20c28a00b000c7770a557fmr25789874pzb.50.1680424067322; Sun, 02 Apr 2023 01:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680424067; cv=none; d=google.com; s=arc-20160816; b=uE3AKbSmKsi2SbbUXTWpRZjPDF+mYcs4tLeLY4GQeDVFHtL6TTu/cJPgAWxtpfYaAU VY8xL7dodOSgUMAcXIwh/6+SpqNk+E0QUgz9UGCXVTT9G7o+QisMcKhvtNsNLwlPFqYe T6Ra3U2+UyaiXWFOGok/KNpx4xsZvgAnZr9SCKNZgJ87FnMzzRx+eFOlJ+G51T2WWANF vXfpVfj0fp+7468qF24anSZganQCuqYFh2/d+62EEmd7i/dPmYbmoDOXZEAdSvVSyzyH bOGYl7GgKBsqZOghm9dwAIMzrx9gakqz0Vv0i19WuwFIDr0j0QB5HjTeLgLje/AZrGAK HFvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=6XwLD7cIu5aoSItXTdT+yPXhBhaPL9FVVLT1472E7DE=; b=GpoxehU/bMWR5yUpop3KwdpBMatg3EuxvzLKTxJ233HvrqIn9OaZUCAmTyPCYaBlzJ nIFe9hY4qPL2IJntopzHRw8RDcVMy/MDWl6aPFkBaTf/4VZaLdu1VrL+lLHqusqVdRJQ D3dT8+P4yLoV+ZxUjORezQC+MdNuflnfyFpjlUKwL7D0Z99HRfq6Ya4O5fnFsYhEJR1h /UKiK2Lmcq/FjIyqmq7yvQRYoCtkYDx7XhJHAFRrGSExdo5MShGvGoFHv3idb1oGmDAw z1tD1UjEETRHlpwKI6YBX8H6sUuW3sN2w/rwgi5WrMU2GzZW0xDCfoi9KTUyQWpLJ5u1 CqpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a65584b000000b005091105ca8fsi6265740pgr.14.2023.04.02.01.27.36; Sun, 02 Apr 2023 01:27:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229492AbjDBIXF (ORCPT + 99 others); Sun, 2 Apr 2023 04:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjDBIXD (ORCPT ); Sun, 2 Apr 2023 04:23:03 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E995A10264 for ; Sun, 2 Apr 2023 01:23:01 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id iszLpCRz4xuxqiszLpYwjS; Sun, 02 Apr 2023 10:22:59 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 02 Apr 2023 10:22:59 +0200 X-ME-IP: 86.243.2.178 Message-ID: <0a5fa878-b7c3-b5a3-8ffa-b3a2dcdc400d@wanadoo.fr> Date: Sun, 2 Apr 2023 10:22:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] clk: Reorder fields in 'struct clk_fractional_divider' To: Stephen Boyd , Michael Turquette Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-clk@vger.kernel.org References: <2e74c4c93f4bcc6a7af0c3ef5a8edd23.sboyd@kernel.org> Content-Language: fr, en-US From: Christophe JAILLET In-Reply-To: <2e74c4c93f4bcc6a7af0c3ef5a8edd23.sboyd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 29/03/2023 à 20:46, Stephen Boyd a écrit : > Quoting Christophe JAILLET (2023-02-17 07:55:55) >> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h >> index cf1adfeaf257..8cec844f5dde 100644 >> --- a/include/linux/clk-provider.h >> +++ b/include/linux/clk-provider.h >> @@ -1134,13 +1134,13 @@ struct clk_hw *clk_hw_register_fixed_factor_parent_hw(struct device *dev, >> struct clk_fractional_divider { >> struct clk_hw hw; >> void __iomem *reg; >> + u8 flags; >> u8 mshift; >> u8 mwidth; >> u32 mmask; > > This member ... > >> u8 nshift; >> u8 nwidth; >> u32 nmask; > > and this member can be calculated. Doing that would save more bytes when > combined with this patch. Can you make this into a patch series? Hi, with your proposed change, there is no more need to move flags. All u8 are grouped and the struct is optimal. I'll send a v2, but not sure it really worth it. When dynamically allocated, even when the struct is 56 bytes, 64 are still allocated. And there are only 2 users of struct clk_fractional_divider embedded in another struct that will be shrinked with your change. On the other side, having theses masks pre-computed could save a few cycles, at nearly no memory usage impact. I'll let you decide if v1 or v2 is the preferred way to go. CJ > >> - u8 flags; >> void (*approximation)(struct clk_hw *hw, >> unsigned long rate, unsigned long *parent_rate, >> unsigned long *m, unsigned long *n); >