All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: William Breathitt Gray <william.gray@linaro.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/5] iio: addac: stx104: Improve indentation in stx104_write_raw()
Date: Wed, 5 Apr 2023 11:50:08 +0300	[thread overview]
Message-ID: <ZC02QAYZodp/cgi5@smile.fi.intel.com> (raw)
In-Reply-To: <ac00afab032039350d23cfc9752f8e9225537fd0.1680564468.git.william.gray@linaro.org>

On Tue, Apr 04, 2023 at 10:12:00AM -0400, William Breathitt Gray wrote:
> By bailing out early if chan->output is false for the IIO_CHAN_INFO_RAW,
> indentation can be decreased by a tab and code readability improved.

...

> +		/* DAC can only accept up to a 16-bit value */
> +		if ((unsigned int)val > 65535)
> +			return -EINVAL;

While the patch is good per se, I don't like two things (which are also in the
original code):
- explicit casting (can it be avoided?)
- would be good to have U16_MAX or ?.. instead of hard coded number

Can it be addressed with (additional) patches?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-04-05  8:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 14:11 [PATCH v4 0/5] Migrate STX104 to the regmap API William Breathitt Gray
2023-04-04 14:11 ` [PATCH v4 1/5] iio: addac: stx104: Fix race condition for stx104_write_raw() William Breathitt Gray
2023-04-04 14:11 ` [PATCH v4 2/5] iio: addac: stx104: Fix race condition when converting analog-to-digital William Breathitt Gray
2023-04-04 14:12 ` [PATCH v4 3/5] iio: addac: stx104: Improve indentation in stx104_write_raw() William Breathitt Gray
2023-04-05  8:50   ` Andy Shevchenko [this message]
2023-04-05 16:11     ` William Breathitt Gray
2023-04-04 14:12 ` [PATCH v4 4/5] iio: addac: stx104: Migrate to the regmap API William Breathitt Gray
2023-04-04 14:12 ` [PATCH v4 5/5] iio: addac: stx104: Use regmap_read_poll_timeout() for conversion poll William Breathitt Gray
2023-04-05  8:54   ` Andy Shevchenko

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=ZC02QAYZodp/cgi5@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=william.gray@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.