From 2db33d5c8c2c2c96a03009cc00c5cae03993acfa Mon Sep 17 00:00:00 2001 From: Kees van Reeuwijk Date: Tue, 2 Feb 2010 12:24:35 +0000 Subject: [PATCH] Fix some incorrect testing of bit flags. --- drivers/audio/sb16/mixer.c | 10 +++++----- drivers/fxp/fxp.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/audio/sb16/mixer.c b/drivers/audio/sb16/mixer.c index 770af03ea..f276b1e87 100644 --- a/drivers/audio/sb16/mixer.c +++ b/drivers/audio/sb16/mixer.c @@ -172,8 +172,8 @@ PRIVATE int get_set_input(struct inout_ctrl *input, int flag, int channel) { mixer_set(input_cmd, mask); } else { /* Get input */ if (shift > 0) { - input->left = ((mask >> (shift+1)) & 1 == 1 ? ON : OFF); - input->right = ((mask >> shift) & 1 == 1 ? ON : OFF); + input->left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF); + input->right = (((mask >> shift) & 1) == 1 ? ON : OFF); } else { input->left = ((mask & 1) == 1 ? ON : OFF); } @@ -220,8 +220,8 @@ PRIVATE int get_set_output(struct inout_ctrl *output, int flag) { mixer_set(MIXER_OUTPUT_CTRL, mask); } else { /* Get input */ if (shift > 0) { - output->left = ((mask >> (shift+1)) & 1 == 1 ? ON : OFF); - output->right = ((mask >> shift) & 1 == 1 ? ON : OFF); + output->left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF); + output->right = (((mask >> shift) & 1) == 1 ? ON : OFF); } else { output->left = ((mask & 1) == 1 ? ON : OFF); } @@ -250,4 +250,4 @@ PUBLIC int mixer_get(int reg) { sb16_outb(MIXER_REG, reg); for(i = 0; i < 100; i++); return sb16_inb(MIXER_DATA) & 0xff; -} \ No newline at end of file +} diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 0f8ca0e60..e806bda21 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -1482,7 +1482,7 @@ int vectored; goto suspend; } - if (!rfd_status & RFDS_OK) + if (!(rfd_status & RFDS_OK)) { /* Not OK? What happened? */ assert(0); @@ -1662,7 +1662,7 @@ int from_int; goto suspend; } - if (!rfd_status & RFDS_OK) + if (!(rfd_status & RFDS_OK)) { /* Not OK? What happened? */ assert(0); -- 2.44.0