From: Michael Hennerich <michael.hennerich@analog.com>
To: Dan Bogdan Nechita <dan.bogdan.nechita@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes
Date: Thu, 19 Nov 2015 09:22:59 +0100 [thread overview]
Message-ID: <564D86E3.4030509@analog.com> (raw)
In-Reply-To: <1447863375-2195-1-git-send-email-dan.bogdan.nechita@gmail.com>
On 11/18/2015 05:16 PM, Dan Bogdan Nechita wrote:
> Currently writing the attributes with "echo" will result in comparing:
> "enabled\n" with "enabled\0" and attribute is always set to false.
>
> Use the sysfs_streq() instead because it treats both NUL and
> new-line-then-NUL as equivalent string terminations.
>
> Signed-off-by: Dan Bogdan Nechita <dan.bogdan.nechita@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> drivers/misc/ad525x_dpot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
> index 15e8807..4230e6a 100644
> --- a/drivers/misc/ad525x_dpot.c
> +++ b/drivers/misc/ad525x_dpot.c
> @@ -452,7 +452,7 @@ static ssize_t sysfs_set_reg(struct device *dev,
> int err;
>
> if (reg & DPOT_ADDR_OTP_EN) {
> - if (!strncmp(buf, "enabled", sizeof("enabled")))
> + if (sysfs_streq(buf, "enabled"))
> set_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask);
> else
> clear_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask);
>
next prev parent reply other threads:[~2015-11-19 10:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 16:16 [PATCH] misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes Dan Bogdan Nechita
2015-11-19 8:22 ` Michael Hennerich [this message]
2016-02-22 8:58 ` Michael Hennerich
2016-02-22 19:45 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2016-02-23 9:48 Dan Bogdan Nechita
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=564D86E3.4030509@analog.com \
--to=michael.hennerich@analog.com \
--cc=arnd@arndb.de \
--cc=dan.bogdan.nechita@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).