Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Gabriel Shahrouzi <gshahrouzi@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: gshahrozui@gmail.com, skhan@linuxfoundation.org,
	kernelmentees@lists.linuxfoundation.org
Subject: Re: [PATCH] iio: adc: Correct conditional logic for store mode
Date: Mon, 14 Apr 2025 10:02:44 -0500	[thread overview]
Message-ID: <25db1c97-001b-4b9c-bc57-879fcd0abb14@baylibre.com> (raw)
In-Reply-To: <0b1b428d-9ad0-4581-a13a-88f4ffd6c4e3@baylibre.com>

On 4/14/25 9:59 AM, David Lechner wrote:
> On 4/14/25 9:09 AM, Gabriel Shahrouzi wrote:
>> The mode setting logic in ad7816_store_mode was reversed due to
>> incorrect handling of the strcmp return value. strcmp returns 0 on
>> match, so the `if (strcmp(buf, "full"))` block executed when the
>> input was not "full".
>>
>> This resulted in "full" setting the mode to AD7816_PD (power-down) and
>> other inputs setting it to AD7816_FULL.
>>
>> Fix this by checking it against 0 to correctly check for "full" and
>> "power-down", mapping them to AD7816_FULL and AD7816_PD respectively.
>>
> 
> Sounds like we need a Fixes: tag here that reference the commit
> that introduced the bug.
> 
>> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
>> ---

There is also a typo in your email address in the cc: gshahrozui@gmail.com 

  reply	other threads:[~2025-04-14 15:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 14:09 [PATCH] iio: adc: Correct conditional logic for store mode Gabriel Shahrouzi
2025-04-14 14:59 ` David Lechner
2025-04-14 15:02   ` David Lechner [this message]
2025-04-14 15:35     ` Gabriel Shahrouzi
  -- strict thread matches above, loose matches on Subject: below --
2025-04-14 15:29 Gabriel Shahrouzi
2025-04-14 15:39 Gabriel Shahrouzi

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=25db1c97-001b-4b9c-bc57-879fcd0abb14@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gshahrouzi@gmail.com \
    --cc=gshahrozui@gmail.com \
    --cc=jic23@kernel.org \
    --cc=kernelmentees@lists.linuxfoundation.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=skhan@linuxfoundation.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