All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Evgeniy Polyakov <zbr@ioremap.net>,
	Matt Campbell <mattrcampbell@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	David Fries <David@Fries.net>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 1/2] w1: fix for loop exit condition in w1_seq_show()
Date: Mon, 01 Jun 2015 09:55:37 +0000	[thread overview]
Message-ID: <20150601095537.GA897@mwanda> (raw)

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;

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Evgeniy Polyakov <zbr@ioremap.net>,
	Matt Campbell <mattrcampbell@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	David Fries <David@Fries.net>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 1/2] w1: fix for loop exit condition in w1_seq_show()
Date: Mon, 1 Jun 2015 12:55:37 +0300	[thread overview]
Message-ID: <20150601095537.GA897@mwanda> (raw)

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;

             reply	other threads:[~2015-06-01  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01  9:55 Dan Carpenter [this message]
2015-06-01  9:55 ` [patch 1/2] w1: fix for loop exit condition in w1_seq_show() Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150601095537.GA897@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=David@Fries.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattrcampbell@gmail.com \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.