Skip to contentSkip to conversation

V4L/DVB: Fix test in copy_reg_bits()

PATCH In review Roel Kluin 2 participants 2 messages Nov 20, 2009 – Nov 21, 2009 Media (V4L/DVB)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 V4L/DVB: Fix test in copy_reg_bits()

The reg_pair2[j].reg was tested twice.

---
 drivers/media/common/tuners/mxl5007t.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

I think this was intended?

drivers/media/common/tuners/mxl5007t.c +1 -1
index 2d02698..7eb1bf7 100644
@@ -196,7 +196,7 @@ static void copy_reg_bits(struct reg_pair_t *reg_pair1,
 	i = j = 0;
 
 	while (reg_pair1[i].reg || reg_pair1[i].val) {
-		while (reg_pair2[j].reg || reg_pair2[j].reg) {
+		while (reg_pair2[j].reg || reg_pair2[j].val) {
 			if (reg_pair1[i].reg != reg_pair2[j].reg) {
 				j++;
 				continue;
#1 lore raw

Ah! Nice catch. Thank you, Roel. Mauro / Andrew, can one of you please merge this? The driver hasn't changed, so it should go to Linus' current tree and also stable, although it isn't crucial.

Quoted 26 lines · Roel Kluin

The reg_pair2[j].reg was tested twice.

---
 drivers/media/common/tuners/mxl5007t.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

I think this was intended?

drivers/media/common/tuners/mxl5007t.c +1 -2
index 2d02698..7eb1bf7 100644
@@ -196,7 +196,7 @@ static void copy_reg_bits(struct reg_pair_t *reg_pair1,
 	i = j = 0;
 
 	while (reg_pair1[i].reg || reg_pair1[i].val) {
-		while (reg_pair2[j].reg || reg_pair2[j].reg) {
+		while (reg_pair2[j].reg || reg_pair2[j].val) {
 			if (reg_pair1[i].reg != reg_pair2[j].reg) {
 				j++;
 				continue;
--

To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html