From: Jonathan Cameron <jic23@kernel.org>
To: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>,
"Song, Hongyan" <hongyan.song@intel.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: hid-sensor-attributes: Check sample_frequency/hysteresis write data legitimacy
Date: Sat, 5 Nov 2016 16:32:14 +0000 [thread overview]
Message-ID: <3b9b5b27-31ee-dfb7-deef-a93e83399324@kernel.org> (raw)
In-Reply-To: <1478282145.14557.14.camel@intel.com>
On 04/11/16 17:55, Pandruvada, Srinivas wrote:
> On Thu, 2016-11-03 at 00:45 +0000, Song Hongyan wrote:
>>
>> Neither sample frequency value nor hysteresis value can be set to be
>> a
>> negative number, check and return "Invalid argument" if they are
>> negative.
>>
>> If not do this change, sample_frequency will be set into some unknown
>> value, read hysteresis value after write negative number will return
>> "Invalid argument".
>>
>> Signed-off-by: Song Hongyan <hongyan.song@intel.com>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>From the description I'm reading this as a minor issue and not a
regression (it never worked right). As such with Linus getting
irritated about fixes for stuff that has been long broken I'm
going to take this the slow route (i.e. next merge window).
Applied to the togreg branch of iio.git. Will be initially pushed out
as testing for the autobuilders to play with it.
Thanks,
Jonathan
>
>>
>> ---
>> drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> index dc33c1d..4509f8475 100644
>> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> @@ -201,7 +201,7 @@ int hid_sensor_write_samp_freq_value(struct
>> hid_sensor_common *st,
>> int ret;
>>
>> if (val1 < 0 || val2 < 0)
>> - ret = -EINVAL;
>> + return -EINVAL;
>>
>> value = val1 * pow_10(6) + val2;
>> if (value) {
>> @@ -250,6 +250,9 @@ int hid_sensor_write_raw_hyst_value(struct
>> hid_sensor_common *st,
>> s32 value;
>> int ret;
>>
>> + if (val1 < 0 || val2 < 0)
>> + return -EINVAL;
>> +
>> value = convert_to_vtf_format(st->sensitivity.size,
>> st->sensitivity.unit_expo,
>> val1, val2);N�����r��y���b�X��ǧv�^�){.n�+����{��*"��^n�r���z�\x1a��h����&��\x1e�G���h�\x03(�階�ݢj"��\x1a�^[m�����z�ޖ���f���h���~�mml==
next prev parent reply other threads:[~2016-11-05 16:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 0:45 [PATCH] iio: hid-sensor-attributes: Check sample_frequency/hysteresis write data legitimacy Song Hongyan
2016-11-04 17:55 ` Pandruvada, Srinivas
2016-11-05 16:32 ` Jonathan Cameron [this message]
2016-11-05 16:36 ` Pandruvada, Srinivas
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=3b9b5b27-31ee-dfb7-deef-a93e83399324@kernel.org \
--to=jic23@kernel.org \
--cc=hongyan.song@intel.com \
--cc=linux-iio@vger.kernel.org \
--cc=srinivas.pandruvada@intel.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;
as well as URLs for NNTP newsgroup(s).