[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12048540-9d29-48e8-8442-e0f736067d9f@quicinc.com>
Date: Sun, 29 Sep 2024 12:02:03 +0530
From: Manikanta Mylavarapu <quic_mmanikan@...cinc.com>
To: Bjorn Andersson <andersson@...nel.org>,
Vladimir Zapolskiy
<vladimir.zapolskiy@...aro.org>
CC: <andi.shyti@...nel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<quic_srichara@...cinc.com>, <quic_varada@...cinc.com>
Subject: Re: [PATCH v2 1/1] i2c: qcom-geni: Support systems with 32MHz serial
engine clock
On 9/26/2024 6:18 PM, Bjorn Andersson wrote:
> On Thu, Sep 26, 2024 at 01:28:37PM GMT, Vladimir Zapolskiy wrote:
>> On 9/26/24 06:43, Manikanta Mylavarapu wrote:
>>> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> [..]
>>> +
>>> static int geni_i2c_clk_map_idx(struct geni_i2c_dev *gi2c)
>>> {
>>> int i;
>>> - const struct geni_i2c_clk_fld *itr = geni_i2c_clk_map;
>>> + const struct geni_i2c_clk_fld *itr;
>>> +
>>> + if (clk_get_rate(gi2c->se.clk) == 32 * HZ_PER_MHZ)
>>> + itr = geni_i2c_clk_map_32mhz;
>>> + else
>>> + itr = geni_i2c_clk_map_19p2mhz;
>>> - for (i = 0; i < ARRAY_SIZE(geni_i2c_clk_map); i++, itr++) {
>>> + for (i = 0; i < ARRAY_SIZE(geni_i2c_clk_map_19p2mhz); i++, itr++) {
>>
>> Struct/data organization here is so weak, that here it's implicitly assumed
>> that sizes of two arrays are equal. It could be kept as is of course, just
>> pointing to it.
>>
>
> Thanks for pointing this out, Vladimir.
>
> I'd prefer we fix it by adding a sentinel value to the arrays - because
> this was only spotted due to the rename, the next guy will not be so
> lucky.
>
> Regards,
> Bjorn
>
Okay, sure.
Thanks & Regards,
Manikanta.
Powered by blists - more mailing lists