[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230316115234.393bca5d@kernel.org>
Date: Thu, 16 Mar 2023 11:52:34 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Andrew Halaney <ahalaney@...hat.com>
Cc: linux-kernel@...r.kernel.org, agross@...nel.org,
andersson@...nel.org, konrad.dybcio@...aro.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
vkoul@...nel.org, bhupesh.sharma@...aro.org,
mturquette@...libre.com, sboyd@...nel.org, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com,
mcoquelin.stm32@...il.com, richardcochran@...il.com,
linux@...linux.org.uk, veekhee@...le.com,
tee.min.tan@...ux.intel.com, mohammad.athari.ismail@...el.com,
jonathanh@...dia.com, ruppala@...dia.com, bmasney@...hat.com,
andrey.konovalov@...aro.org, linux-arm-msm@...r.kernel.org,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-clk@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, ncai@...cinc.com,
jsuraj@....qualcomm.com, hisunil@...cinc.com
Subject: Re: [PATCH net-next 08/11] net: stmmac: Add EMAC3 variant of dwmac4
On Thu, 16 Mar 2023 13:36:09 -0500 Andrew Halaney wrote:
> static void emac3_config_cbs(struct mac_device_info *hw, u32 send_slope,
> u32 idle_slope, u32 high_credit,
> u32 low_credit, u32 queue)
>
> I agree, that's quite gnarly to read. the emac3_config_cbs is the
> callback, so it's already at 6 arguments, so there's nothing I can
> trim there. I could create some struct for readability, populate that,
> then call the do_config_cbs() func with it from emac3_config_cbs.
> Is that the sort of thing you want to see?
Yes, a structure is much better, because it can be initialized member
by member,
struct bla my_bla = { .this = 1, .that = 2, .and = 3, another = 4, };
That's much easier to read. A poor man's version of Python's keyword
arguments, if you will.
Powered by blists - more mailing lists