public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: linux-kernel@vger.kernel.org, ian@beware.dropbear.id.au
Subject: Re: [1/1] w1: w1 temp calculation overflow fix.
Date: Mon, 9 Feb 2009 13:56:41 -0800	[thread overview]
Message-ID: <20090209135641.0367a71f.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090209214217.GA14958@ioremap.net>

On Tue, 10 Feb 2009 00:42:17 +0300
Evgeniy Polyakov <zbr@ioremap.net> wrote:

> Signed-off-by: Ian Dall <ian@beware.dropbear.id.au>
> Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>

I assumed from the above that Ian authored this patch.  Please let me
know if that was incorrect.

The way to track authorship is to put the originator's From: line at
the top of the changelog.

> diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
> index 2c8dff9..1ed3d55 100644
> --- a/drivers/w1/slaves/w1_therm.c
> +++ b/drivers/w1/slaves/w1_therm.c
> @@ -115,7 +115,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
>  
>  static inline int w1_DS18B20_convert_temp(u8 rom[9])
>  {
> -	s16 t = (rom[1] << 8) | rom[0];
> +	int t = ((s16)rom[1] << 8) | rom[0];
>  	t = t*1000/16;
>  	return t;
>  }

It seems strange to use s16 here, but it will fix the bug.

Perhaps this function should be using plain old `unsigned' everywhere.

Please provide changelogs.  This bugfix is applicable to 2.6.28.x and
probably earlier.  But due to the lack of any supporting information I
am not in a position to determine whether it should be backported.




  parent reply	other threads:[~2009-02-09 21:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 21:42 [1/1] w1: w1 temp calculation overflow fix Evgeniy Polyakov
2009-02-09 21:48 ` Harvey Harrison
2009-02-09 22:09   ` Evgeniy Polyakov
2009-02-09 21:56 ` Andrew Morton [this message]
2009-02-09 22:08   ` Evgeniy Polyakov
2009-02-09 22:48     ` Andrew Morton
2009-02-09 23:31       ` Andrew Morton
2009-02-10  8:54         ` Evgeniy Polyakov
2009-02-11  6:41         ` Ian Dall

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=20090209135641.0367a71f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ian@beware.dropbear.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox