* [PATCH] staging: unsigned won't get negative after subtraction
@ 2009-01-18 14:34 Roel Kluin
2009-01-21 18:07 ` patch staging-meilhaus-unsigned-won-t-get-negative-after-subtraction.patch added to gregkh-2.6 tree gregkh
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-01-18 14:34 UTC (permalink / raw)
To: mail, g.gebhardt, Greg KH; +Cc: lkml
This also contains a fix I sent earlier, I'm not sure how split this patch,
but this is about the second hunk.
vi drivers/staging/meilhaus/me6000_ao.h +112
typedef struct me6000_ao_subdevice {
...
unsigned int ao_idx;
...
};
Since unsigned, it won't get negative after subtraction.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/staging/meilhaus/me6000_ao.c b/drivers/staging/meilhaus/me6000_ao.c
index 94f0123..dcb3526 100644
--- a/drivers/staging/meilhaus/me6000_ao.c
+++ b/drivers/staging/meilhaus/me6000_ao.c
@@ -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_WRAPAROUND) {
+ if (!(flags & ME_IO_STREAM_CONFIG_WRAPAROUND)) {
PERROR
("Hardware ME_IO_STREAM_CONFIG_HARDWARE_ONLY has to be with ME_IO_STREAM_CONFIG_WRAPAROUND.\n");
return ME_ERRNO_INVALID_FLAGS;
@@ -2825,10 +2825,11 @@ int inline ao_stop_immediately(me6000_ao_subdevice_t * instance)
int i;
uint32_t single_mask;
- single_mask =
- (instance->ao_idx - ME6000_AO_SINGLE_STATUS_OFFSET <
- 0) ? 0x0000 : (0x0001 << (instance->ao_idx -
- ME6000_AO_SINGLE_STATUS_OFFSET));
+ if (instance->ao_idx < ME6000_AO_SINGLE_STATUS_OFFSET)
+ single_mask = 0x0000;
+ else
+ single_mask = 0x0001 << (instance->ao_idx -
+ ME6000_AO_SINGLE_STATUS_OFFSET);
timeout =
(instance->hardware_stop_delay >
^ permalink raw reply related [flat|nested] 2+ messages in thread
* patch staging-meilhaus-unsigned-won-t-get-negative-after-subtraction.patch added to gregkh-2.6 tree
2009-01-18 14:34 [PATCH] staging: unsigned won't get negative after subtraction Roel Kluin
@ 2009-01-21 18:07 ` gregkh
0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2009-01-21 18:07 UTC (permalink / raw)
To: roel.kluin, g.gebhardt, gregkh, linux-kernel, mail
This is a note to let you know that I've just added the patch titled
Subject: Staging: meilhaus: unsigned won't get negative after subtraction
to my gregkh-2.6 tree. Its filename is
staging-meilhaus-unsigned-won-t-get-negative-after-subtraction.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From roel.kluin@gmail.com Wed Jan 21 09:47:26 2009
From: Roel Kluin <roel.kluin@gmail.com>
Date: Sun, 18 Jan 2009 15:34:55 +0100
Subject: Staging: meilhaus: unsigned won't get negative after subtraction
To: <mail@davidkiliani.de>, <g.gebhardt@meilhaus.de>, Greg KH <gregkh@suse.de>
Cc: lkml <linux-kernel@vger.kernel.org>
Message-ID: <49733E0F.7030305@gmail.com>
Since unsigned, it won't get negative after subtraction.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/meilhaus/me6000_ao.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- a/drivers/staging/meilhaus/me6000_ao.c
+++ b/drivers/staging/meilhaus/me6000_ao.c
@@ -2825,10 +2825,11 @@ int inline ao_stop_immediately(me6000_ao
int i;
uint32_t single_mask;
- single_mask =
- (instance->ao_idx - ME6000_AO_SINGLE_STATUS_OFFSET <
- 0) ? 0x0000 : (0x0001 << (instance->ao_idx -
- ME6000_AO_SINGLE_STATUS_OFFSET));
+ if (instance->ao_idx < ME6000_AO_SINGLE_STATUS_OFFSET)
+ single_mask = 0x0000;
+ else
+ single_mask = 0x0001 << (instance->ao_idx -
+ ME6000_AO_SINGLE_STATUS_OFFSET);
timeout =
(instance->hardware_stop_delay >
Patches currently in gregkh-2.6 which might be from roel.kluin@gmail.com are
staging/staging-meilhaus-unsigned-won-t-get-negative-after-subtraction.patch
staging/staging-otus-logical-bit-and-confusion.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-21 18:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-18 14:34 [PATCH] staging: unsigned won't get negative after subtraction Roel Kluin
2009-01-21 18:07 ` patch staging-meilhaus-unsigned-won-t-get-negative-after-subtraction.patch added to gregkh-2.6 tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox