Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Jonathan Santos <Jonathan.Santos@analog.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, lars@metafoo.de,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	marcelo.schmitt1@gmail.com, jonath4nns@gmail.com
Subject: Re: [PATCH v3 4/4] iio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family
Date: Sun, 7 Sep 2025 11:56:38 +0100	[thread overview]
Message-ID: <20250907115638.308729ef@jic23-huawei> (raw)
In-Reply-To: <aLsclc2WHsbR1jfa@smile.fi.intel.com>


> > +static void ad7768_fill_scale_tbl(struct iio_dev *dev)
> > +{
> > +	struct ad7768_state *st = iio_priv(dev);
> > +	const struct iio_scan_type *scan_type;
> > +	int val, val2, tmp0, tmp1, i;
> > +	struct u64_fract fract;
> > +	unsigned long n, d;
> > +	u64 tmp2;
> > +
> > +	scan_type = iio_get_current_scan_type(dev, &dev->channels[0]);  
> 
> Is it usual patter in IIO? Otherwise it can be written as
> 
> 	scan_type = iio_get_current_scan_type(dev, dev->channels);

From a semantic / readability point of view I'd keep it referencing
the first element.  We are querying the scan type of one specific
channel, rather than the array that is behind dev->channels.

> 
> > +	if (scan_type->sign == 's')
> > +		val2 = scan_type->realbits - 1;
> > +	else
> > +		val2 = scan_type->realbits;  

      parent reply	other threads:[~2025-09-07 10:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05  9:48 [PATCH v3 0/4] Add support for ADAQ776x-1 ADC Family Jonathan Santos
2025-09-05  9:49 ` [PATCH v3 1/4] dt-bindings: iio: adc: ad7768-1: add new supported parts Jonathan Santos
2025-09-05 17:06   ` David Lechner
2025-09-05  9:49 ` [PATCH v3 2/4] iio: adc: ad7768-1: introduce chip info for future multidevice support Jonathan Santos
2025-09-05 16:51   ` Andy Shevchenko
2025-09-05 17:06   ` David Lechner
2025-09-05  9:49 ` [PATCH v3 3/4] math.h: Add 64-bit fractional numbers types Jonathan Santos
2025-09-05 16:45   ` Andy Shevchenko
2025-09-05  9:49 ` [PATCH v3 4/4] iio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family Jonathan Santos
2025-09-05 17:08   ` David Lechner
2025-09-05 17:23   ` Andy Shevchenko
2025-09-05 17:25     ` Andy Shevchenko
2025-09-07 10:56     ` Jonathan Cameron [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=20250907115638.308729ef@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Santos@analog.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jonath4nns@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.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