From: Jakob Hauser <jahau@rocketmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Linus Walleij <linus.walleij@linaro.org>,
Hans de Goede <hdegoede@redhat.com>,
linux-iio <linux-iio@vger.kernel.org>,
devicetree <devicetree@vger.kernel.org>,
phone-devel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v3 8/8] iio: magnetometer: yas530: Add YAS537 variant
Date: Tue, 21 Jun 2022 03:10:39 +0200 [thread overview]
Message-ID: <9b9c7a09-c71a-0881-5571-12cf814fdaa1@rocketmail.com> (raw)
In-Reply-To: <CAHp75VdvNMu=U8me4J4pD3AUCxaVaVC6fk-SZUsgTHt5ya+kkA@mail.gmail.com>
Hi Andy,
On 18.06.22 12:57, Andy Shevchenko wrote:
>
> On Sat, Jun 18, 2022 at 2:15 AM Jakob Hauser <jahau@rocketmail.com> wrote:
>>
>> -/* These variant IDs are known from code dumps */
>
> Not sure why this change
> a) is here (means maybe you need to move the comment somewhere else?);
> b) done at all (means maybe this comment is still actual?).
The device IDs of YAS537 and YAS539 were placed there as placeholders
for future additions. The comment kind of explained why they are there
without being used within the driver. Now, with YAS537 being added, it
becomes clear that there is only YAS539 left to complete the family, the
comment is not necessary.
...
>> + switch (yas5xx->devid) {
>> + case YAS530_DEVICE_ID:
>> + case YAS532_DEVICE_ID:
>> + if (reg == YAS530_532_ACTUATE_INIT_COIL ||
>> + reg == YAS530_532_MEASURE)
>> + return true;
>> + break;
>> + case YAS537_DEVICE_ID:
>> + if (reg == YAS537_MEASURE)
>> + return true;
>> + break;
>> + default:
>> + dev_err(yas5xx->dev, "unknown device type\n");
>> + break;
>
>> + /* fall through */
>
> What does this mean?
>
> It seems here you may actually to return directly.
I wanted to avoid:
default:
dev_err(yas5xx->dev, "unknown device type\n");
return false;
}
return false;
I'll just remove the "fall through" comment and keep it like this:
default:
dev_err(yas5xx->dev, "unknown device type\n");
break;
}
return false;
...
>> + /* Writing SRST register, the exact meaning is unknown */
>
> Wild guess: Software ReSeT (SRST). Would explain why it should be done
> before calibration.
I'll remove the "the exact meaning is unknown" part.
...
>> + case YAS537_VERSION_0:
>
>> +
>
> Redundant blank line.
Within switch statements no empty lines for visual structuring allowed
at all?
...
>> - strncpy(yas5xx->name, "yas530", sizeof(yas5xx->name));
>
> Okay, strncpy() -> strscpy() perhaps in the separate patch.
Yes, this needs to go into a separate patch, it's implemented like this
in the current driver.
...
Kind regards,
Jakob
next prev parent reply other threads:[~2022-06-21 1:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1655509425.git.jahau.ref@rocketmail.com>
2022-06-18 0:13 ` [PATCH v3 0/8] Add support for magnetometer Yamaha YAS537 Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 1/8] iio: magnetometer: yas530: Change data type of hard_offsets to signed Jakob Hauser
2022-06-18 14:18 ` Jonathan Cameron
2022-06-21 0:36 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 2/8] iio: magnetometer: yas530: Change range of data in volatile register Jakob Hauser
2022-06-18 14:21 ` Jonathan Cameron
2022-06-21 0:39 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 3/8] iio: magnetometer: yas530: Correct scaling of magnetic axes Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 4/8] iio: magnetometer: yas530: Correct temperature handling Jakob Hauser
2022-06-18 14:53 ` Jonathan Cameron
2022-06-21 0:48 ` Jakob Hauser
2022-06-25 14:14 ` Jonathan Cameron
2022-06-18 0:13 ` [PATCH v3 5/8] iio: magnetometer: yas530: Change data type of calibration coefficients Jakob Hauser
2022-06-18 14:56 ` Jonathan Cameron
2022-06-21 0:51 ` Jakob Hauser
2022-06-22 8:49 ` Linus Walleij
2022-06-26 7:51 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 6/8] iio: magnetometer: yas530: Rename functions and registers Jakob Hauser
2022-06-18 15:00 ` Jonathan Cameron
2022-06-21 0:53 ` Jakob Hauser
2022-06-21 8:51 ` Andy Shevchenko
2022-06-25 14:16 ` Jonathan Cameron
2022-06-26 8:39 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 7/8] iio: magnetometer: yas530: Apply minor cleanups Jakob Hauser
2022-06-18 9:53 ` Andy Shevchenko
2022-06-21 0:57 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 8/8] iio: magnetometer: yas530: Add YAS537 variant Jakob Hauser
2022-06-18 10:57 ` Andy Shevchenko
2022-06-21 1:10 ` Jakob Hauser [this message]
2022-06-18 15:28 ` Jonathan Cameron
2022-06-19 10:32 ` Andy Shevchenko
2022-06-19 10:58 ` Jonathan Cameron
2022-06-21 1:29 ` Jakob Hauser
2022-06-25 14:22 ` Jonathan Cameron
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=9b9c7a09-c71a-0881-5571-12cf814fdaa1@rocketmail.com \
--to=jahau@rocketmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=hdegoede@redhat.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=phone-devel@vger.kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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;
as well as URLs for NNTP newsgroup(s).