Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1310992 > unrolled thread
| Started by | Alexander Koch <mail@alexanderkoch.net> |
|---|---|
| First post | 2016-01-16 17:20 +0100 |
| Last post | 2016-01-24 16:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 2/3] iio: light: opt3001: trivial type refactoring Alexander Koch <mail@alexanderkoch.net> - 2016-01-16 17:20 +0100
Re: [PATCH v2 2/3] iio: light: opt3001: trivial type refactoring Jonathan Cameron <jic23@kernel.org> - 2016-01-24 16:10 +0100
| From | Alexander Koch <mail@alexanderkoch.net> |
|---|---|
| Date | 2016-01-16 17:20 +0100 |
| Subject | [PATCH v2 2/3] iio: light: opt3001: trivial type refactoring |
| Message-ID | <qRBK3-6DH-21@gated-at.bofh.it> |
Change variable type of struct opt3001 members 'ok_to_ignore_lock' and
'result_ready' uint16-bitfield of length one to bool.
They are used as bool, let the compiler do the optimization.
Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
---
drivers/iio/light/opt3001.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
index aefbd79..b05c484 100644
--- a/drivers/iio/light/opt3001.c
+++ b/drivers/iio/light/opt3001.c
@@ -79,8 +79,8 @@ struct opt3001 {
struct device *dev;
struct mutex lock;
- u16 ok_to_ignore_lock:1;
- u16 result_ready:1;
+ bool ok_to_ignore_lock;
+ bool result_ready;
wait_queue_head_t result_ready_queue;
u16 result;
--
2.7.0
[toc] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2016-01-24 16:10 +0100 |
| Message-ID | <qUusG-6yj-11@gated-at.bofh.it> |
| In reply to | #1310992 |
On 16/01/16 16:14, Alexander Koch wrote:
> Change variable type of struct opt3001 members 'ok_to_ignore_lock' and
> 'result_ready' uint16-bitfield of length one to bool.
>
> They are used as bool, let the compiler do the optimization.
>
> Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
> Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
I find it hard to care much about this one, but consistency is
always good and the bitfield never made much sense in here.
Applied to the togreg branch of iio.git - pushed out as testing... etc.
Thanks,
Jonathan
> ---
> drivers/iio/light/opt3001.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
> index aefbd79..b05c484 100644
> --- a/drivers/iio/light/opt3001.c
> +++ b/drivers/iio/light/opt3001.c
> @@ -79,8 +79,8 @@ struct opt3001 {
> struct device *dev;
>
> struct mutex lock;
> - u16 ok_to_ignore_lock:1;
> - u16 result_ready:1;
> + bool ok_to_ignore_lock;
> + bool result_ready;
> wait_queue_head_t result_ready_queue;
> u16 result;
>
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web