From: Lars-Peter Clausen <lars@metafoo.de>
To: Corentin Chary <corentin.chary@gmail.com>
Cc: "Martin Liška" <marxin.liska@gmail.com>,
"Marek Vašut" <marex@denx.de>,
"Jonathan Cameron" <jic23@cam.ac.uk>,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
linux-iio@vger.kernel.org, "Zhang, Rui" <rui.zhang@intel.com>,
joeyli <jlee@suse.com>, "Len Brown" <len.brown@intel.com>,
pavel@denx.de, "Jon Brenner" <jbrenner@taosinc.com>,
"Peter Meerwald" <pmeerw@pmeerw.net>
Subject: Re: [PATCH] ACPI ALS driver for iio introduced.
Date: Thu, 29 Nov 2012 11:18:18 +0100 [thread overview]
Message-ID: <50B7366A.9040800@metafoo.de> (raw)
In-Reply-To: <CAHR064gj3CUUZyuGiw6WhLjGQrhq-eAOKr-=+UmpW2Ry3mce8g@mail.gmail.com>
On 11/29/2012 09:02 AM, Corentin Chary wrote:
> On Thu, Nov 29, 2012 at 2:46 AM, <marxin.liska@gmail.com> wrote:
>> From: marxin <marxin.liska@gmail.com>
>>
>> ---
>> drivers/iio/industrialio-buffer.c | 4 +-
>> drivers/staging/iio/light/Kconfig | 6 +
>> drivers/staging/iio/light/Makefile | 1 +
>> drivers/staging/iio/light/acpi-als.c | 486 ++++++++++++++++++++++++++++++++++
>> 4 files changed, 495 insertions(+), 2 deletions(-)
>> create mode 100644 drivers/staging/iio/light/acpi-als.c
>>
>> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
>> index aaadd32..b8b377c 100644
>> --- a/drivers/iio/industrialio-buffer.c
>> +++ b/drivers/iio/industrialio-buffer.c
>> @@ -119,8 +119,8 @@ static ssize_t iio_scan_el_show(struct device *dev,
>> int ret;
>> struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>>
>> - ret = test_bit(to_iio_dev_attr(attr)->address,
>> - indio_dev->buffer->scan_mask);
>> + ret = !!(test_bit(to_iio_dev_attr(attr)->address,
>> + indio_dev->buffer->scan_mask));
>
> It's strange that you have to do that.
> Can you give use the exact values that make test_bit return something
> else that 1 or 0 ?
> Maybe there is a bug to fix in test_bit here.
Even if this was a bug in IIO this should be in a separate patch.
>
>>
>> return sprintf(buf, "%d\n", ret);
>> }
[...]
WARNING: multiple messages have this Message-ID (diff)
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Corentin Chary <corentin.chary-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Martin Liška"
<marxin.liska-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Marek Vašut" <marex-ynQEQJNshbs@public.gmane.org>,
"Jonathan Cameron"
<jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>,
"platform-driver-x86-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<platform-driver-x86-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Zhang,
Rui" <rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
joeyli <jlee-IBi9RG/b67k@public.gmane.org>,
"Len Brown" <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
pavel-ynQEQJNshbs@public.gmane.org,
"Jon Brenner" <jbrenner-yYKgigLBUwlBDgjK7y7TUQ@public.gmane.org>,
"Peter Meerwald" <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
Subject: Re: [PATCH] ACPI ALS driver for iio introduced.
Date: Thu, 29 Nov 2012 11:18:18 +0100 [thread overview]
Message-ID: <50B7366A.9040800@metafoo.de> (raw)
In-Reply-To: <CAHR064gj3CUUZyuGiw6WhLjGQrhq-eAOKr-=+UmpW2Ry3mce8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 11/29/2012 09:02 AM, Corentin Chary wrote:
> On Thu, Nov 29, 2012 at 2:46 AM, <marxin.liska-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> From: marxin <marxin.liska-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>> ---
>> drivers/iio/industrialio-buffer.c | 4 +-
>> drivers/staging/iio/light/Kconfig | 6 +
>> drivers/staging/iio/light/Makefile | 1 +
>> drivers/staging/iio/light/acpi-als.c | 486 ++++++++++++++++++++++++++++++++++
>> 4 files changed, 495 insertions(+), 2 deletions(-)
>> create mode 100644 drivers/staging/iio/light/acpi-als.c
>>
>> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
>> index aaadd32..b8b377c 100644
>> --- a/drivers/iio/industrialio-buffer.c
>> +++ b/drivers/iio/industrialio-buffer.c
>> @@ -119,8 +119,8 @@ static ssize_t iio_scan_el_show(struct device *dev,
>> int ret;
>> struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>>
>> - ret = test_bit(to_iio_dev_attr(attr)->address,
>> - indio_dev->buffer->scan_mask);
>> + ret = !!(test_bit(to_iio_dev_attr(attr)->address,
>> + indio_dev->buffer->scan_mask));
>
> It's strange that you have to do that.
> Can you give use the exact values that make test_bit return something
> else that 1 or 0 ?
> Maybe there is a bug to fix in test_bit here.
Even if this was a bug in IIO this should be in a separate patch.
>
>>
>> return sprintf(buf, "%d\n", ret);
>> }
[...]
next prev parent reply other threads:[~2012-11-29 10:18 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-08 20:03 ACPI ambient light sensor Martin Liška
2012-07-08 20:28 ` Marek Vasut
2012-07-08 20:28 ` Marek Vasut
2012-07-09 13:29 ` Jonathan Cameron
2012-07-09 13:29 ` Jonathan Cameron
2012-09-11 7:48 ` Martin Liška
2012-09-11 8:27 ` Marek Vasut
2012-09-11 8:27 ` Marek Vasut
2012-09-11 8:35 ` Peter Meerwald
2012-09-11 9:21 ` Marek Vasut
2012-09-11 9:21 ` Marek Vasut
2012-10-21 17:02 ` Martin Liška
2012-10-21 17:32 ` Marek Vasut
2012-10-21 17:32 ` Marek Vasut
2012-10-21 18:05 ` Jonathan Cameron
2012-10-21 18:05 ` Jonathan Cameron
2012-10-27 16:39 ` Martin Liška
2012-10-27 17:08 ` Jonathan Cameron
2012-10-27 18:00 ` Corentin Chary
2012-10-27 18:00 ` Corentin Chary
2012-11-29 2:46 ` ACPI ALS patch marxin.liska
2012-11-29 2:46 ` [PATCH] ACPI ALS driver for iio introduced marxin.liska
2012-11-29 8:02 ` Corentin Chary
2012-11-29 10:18 ` Lars-Peter Clausen [this message]
2012-11-29 10:18 ` Lars-Peter Clausen
[not found] ` <CAObPJ3NM7mn+pXJ801hC2Dn7t9kqp4X_FuD8TSmJ6-eH7UP8pA@mail.gmail.com>
2012-12-02 11:20 ` Corentin Chary
2012-11-29 10:15 ` Lars-Peter Clausen
2012-11-29 10:15 ` Lars-Peter Clausen
2012-12-01 16:46 ` Martin Liška
2012-12-01 16:46 ` Martin Liška
2012-12-02 13:24 ` Jonathan Cameron
2012-12-02 13:24 ` Jonathan Cameron
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=50B7366A.9040800@metafoo.de \
--to=lars@metafoo.de \
--cc=corentin.chary@gmail.com \
--cc=jbrenner@taosinc.com \
--cc=jic23@cam.ac.uk \
--cc=jlee@suse.com \
--cc=len.brown@intel.com \
--cc=linux-iio@vger.kernel.org \
--cc=marex@denx.de \
--cc=marxin.liska@gmail.com \
--cc=pavel@denx.de \
--cc=platform-driver-x86@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=rui.zhang@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 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.