* [patch 1/2] w1: fix for loop exit condition in w1_seq_show()
@ 2015-06-01 9:55 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-06-01 9:55 UTC (permalink / raw)
To: Evgeniy Polyakov, Matt Campbell
Cc: Greg Kroah-Hartman, David Fries, linux-kernel, kernel-janitors
The W1_42_FINISHED_BYTE is 0xFF so the cast means the condition is
never true.
Fixes: d9411e57dc7f ('w1: Add support for DS28EA00 sequence to w1-therm')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index d21e686..3351be6 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -378,7 +378,7 @@ static ssize_t w1_seq_show(struct device *device,
w1_write_8(sl->master, W1_42_COND_READ);
rv = w1_read_block(sl->master, (u8 *)&rn, 8);
reg_num = (struct w1_reg_num *) &rn;
- if ((char)reg_num->family == W1_42_FINISHED_BYTE)
+ if (reg_num->family == W1_42_FINISHED_BYTE)
break;
if (sl->reg_num.id == reg_num->id)
seq = i;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-01 9:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 9:55 [patch 1/2] w1: fix for loop exit condition in w1_seq_show() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).