Commit 530ddf85 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

Staging: meilhaus: Correct use of ! and &

ME_IO_SINGLE_TYPE_WRITE_NONBLOCKING and ME_IO_STREAM_CONFIG_WRAPAROUND both
hanve 0 as the rightmost bit, and thus eg
!flags & ME_IO_SINGLE_TYPE_WRITE_NONBLOCKING is always 0.
I assume that !(flags & ME_IO_SINGLE_TYPE_WRITE_NONBLOCKING) and
!(flags & ME_IO_STREAM_CONFIG_WRAPAROUND) were intended.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
(
  !E & !C
|
- !E & C
+ !(E & C)
)
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c6f5af88
...@@ -756,7 +756,9 @@ static int me1600_ao_io_single_write(me_subdevice_t * subdevice, ...@@ -756,7 +756,9 @@ static int me1600_ao_io_single_write(me_subdevice_t * subdevice,
queue_delayed_work(instance->me1600_workqueue, queue_delayed_work(instance->me1600_workqueue,
&instance->ao_control_task, 1); &instance->ao_control_task, 1);
if ((!flags & ME_IO_SINGLE_TYPE_WRITE_NONBLOCKING) && ((instance->ao_regs_shadows)->trigger & instance->ao_idx)) { //Blocking mode. Wait for software trigger. if ((!(flags & ME_IO_SINGLE_TYPE_WRITE_NONBLOCKING)) &&
((instance->ao_regs_shadows)->trigger & instance->ao_idx)) {
/* Blocking mode. Wait for software trigger. */
if (time_out) { if (time_out) {
delay = (time_out * HZ) / 1000; delay = (time_out * HZ) / 1000;
if (delay == 0) if (delay == 0)
......
...@@ -1025,7 +1025,7 @@ static int me4600_ao_io_stream_config(me_subdevice_t * subdevice, ...@@ -1025,7 +1025,7 @@ static int me4600_ao_io_stream_config(me_subdevice_t * subdevice,
} }
if (flags & ME_IO_STREAM_CONFIG_HARDWARE_ONLY) { if (flags & ME_IO_STREAM_CONFIG_HARDWARE_ONLY) {
if (!flags & ME_IO_STREAM_CONFIG_WRAPAROUND) { if (!(flags & ME_IO_STREAM_CONFIG_WRAPAROUND)) {
PERROR PERROR
("Hardware ME_IO_STREAM_CONFIG_HARDWARE_ONLY has to be with ME_IO_STREAM_CONFIG_WRAPAROUND.\n"); ("Hardware ME_IO_STREAM_CONFIG_HARDWARE_ONLY has to be with ME_IO_STREAM_CONFIG_WRAPAROUND.\n");
return ME_ERRNO_INVALID_FLAGS; return ME_ERRNO_INVALID_FLAGS;
......
...@@ -1063,7 +1063,7 @@ static int me6000_ao_io_stream_config(me_subdevice_t * subdevice, ...@@ -1063,7 +1063,7 @@ static int me6000_ao_io_stream_config(me_subdevice_t * subdevice,
} }
if (flags & ME_IO_STREAM_CONFIG_HARDWARE_ONLY) { if (flags & ME_IO_STREAM_CONFIG_HARDWARE_ONLY) {
if (!flags & ME_IO_STREAM_CONFIG_WRAPAROUND) { if (!(flags & ME_IO_STREAM_CONFIG_WRAPAROUND)) {
PERROR PERROR
("Hardware ME_IO_STREAM_CONFIG_HARDWARE_ONLY has to be with ME_IO_STREAM_CONFIG_WRAPAROUND.\n"); ("Hardware ME_IO_STREAM_CONFIG_HARDWARE_ONLY has to be with ME_IO_STREAM_CONFIG_WRAPAROUND.\n");
return ME_ERRNO_INVALID_FLAGS; return ME_ERRNO_INVALID_FLAGS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment