public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Siddharth Menon <simeddon@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev, gregkh@linuxfoundation.org,
	jic23@kernel.org, Michael.Hennerich@analog.com, lars@metafoo.de
Subject: Re: [PATCH v5] iio: frequency: ad9832: Use FIELD_PREP macro to set bit fields
Date: Thu, 3 Apr 2025 13:07:09 -0300	[thread overview]
Message-ID: <Z-6yLe1GyNsFJlph@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <CAGd6pzPe71oY=+cy3WqKPyZ150q3pOM3LrPE0_ENeKgd+OvnfQ@mail.gmail.com>

On 04/02, Siddharth Menon wrote:
> On Sun, 30 Mar 2025 at 21:13, Marcelo Schmitt
> <marcelo.schmitt1@gmail.com> wrote:
> > The previous implementation would set ctrl_fp if val == 1 and unset it if val == 0.
> > This patch seems to be doing the reverse (setting ctrl_fp if val == 0, and
> > unsetting it if val != 0). Was the previous implementation potentially buggy?
> 
> My apologies, I seem to have made a mistake here.

No worries. It's okay to change/update device drivers to make them better (e.g.
implement new features, fix bugs). If the proposed change was fixing something,
then it could be put into a separate patch with a Fixes tag. Though, I had
another look at the datasheet and my understanding is that the freq bit (bit 11)
should be set if the user writes 1 to out_altvoltageX_frequencysymbol (ABI
documented in drivers/staging/iio/Documentation/sysfs-bus-iio-dds).
By the way, I now think my suggestion of doing
st->ctrl_fp |= FIELD_PREP(AD9832_FREQ, !!val) was not a good idea since that
wouldn't follow the proposed ABI.
Anyway, it's okay to propose more changes/patches if you want. Just separate the
patches according to their logical change if you make more changes to the driver.

Regards,
Marcelo

      reply	other threads:[~2025-04-03 16:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-30 13:49 [PATCH v5] iio: frequency: ad9832: Use FIELD_PREP macro to set bit fields Siddharth Menon
2025-03-30 14:20 ` Jonathan Cameron
2025-04-08 19:55   ` Siddharth Menon
2025-04-12 10:33     ` Jonathan Cameron
2025-03-30 15:44 ` Marcelo Schmitt
2025-04-01 22:15   ` Siddharth Menon
2025-04-03 16:07     ` Marcelo Schmitt [this message]

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=Z-6yLe1GyNsFJlph@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=simeddon@gmail.com \
    /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