From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
To: Bjorn Andersson <andersson@kernel.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Cc: <andi.shyti@kernel.org>, <linux-arm-msm@vger.kernel.org>,
<linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<quic_srichara@quicinc.com>, <quic_varada@quicinc.com>
Subject: Re: [PATCH v2 1/1] i2c: qcom-geni: Support systems with 32MHz serial engine clock
Date: Sun, 29 Sep 2024 12:02:03 +0530 [thread overview]
Message-ID: <12048540-9d29-48e8-8442-e0f736067d9f@quicinc.com> (raw)
In-Reply-To: <wfm2xgyf67erkl57d4ztnj7t7cezkeohne2bcz42crtjwmjp5j@wfakrtwjizkq>
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.
next prev parent reply other threads:[~2024-09-29 6:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 3:43 Manikanta Mylavarapu
2024-09-26 6:14 ` Mukesh Kumar Savaliya
2024-09-26 7:43 ` Manikanta Mylavarapu
2024-09-26 12:44 ` Bjorn Andersson
2024-09-26 10:28 ` Vladimir Zapolskiy
2024-09-26 12:48 ` Bjorn Andersson
2024-09-29 6:32 ` Manikanta Mylavarapu [this message]
2024-09-29 6:36 ` Manikanta Mylavarapu
2024-09-30 14:45 ` Manikanta Mylavarapu
2024-10-03 7:51 ` Vladimir Zapolskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12048540-9d29-48e8-8442-e0f736067d9f@quicinc.com \
--to=quic_mmanikan@quicinc.com \
--cc=andersson@kernel.org \
--cc=andi.shyti@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_srichara@quicinc.com \
--cc=quic_varada@quicinc.com \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®