Repository navigation
Commit 1ad8f7f
w1: w1_therm: Fix conversion result for negative temperatures
commit 2f6055c upstream.
DS18B20 device driver returns an incorrect value for negative temperatures
due to a missing sign-extension in w1_DS18B20_convert_temp().
Fix by using s16 temperature value when converting to int.
Fixes: 9ace0b4 (w1: w1_therm: Add support for GXCAS GX20MH01 device.)
Cc: stable <stable@vger.kernel.org>
Reported-by: Paweł Marciniak <sunwire@gmail.com>
Signed-off-by: Ivan Zaentsev <ivan.zaentsev@wirenboard.ru>
Link: https://lore.kernel.org/r/20210121093021.224764-1-ivan.zaentsev@wirenboard.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent ed5d02f commit 1ad8f7f
1 file changed
Lines changed: 9 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
670 | | - | |
671 | | - | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
672 | 675 | | |
673 | 676 | | |
674 | 677 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
682 | | - | |
683 | | - | |
| 681 | + | |
| 682 | + | |
684 | 683 | | |
685 | | - | |
686 | | - | |
687 | | - | |
| 684 | + | |
| 685 | + | |
688 | 686 | | |
689 | 687 | | |
690 | | - | |
691 | | - | |
692 | 688 | | |
693 | 689 | | |
694 | 690 | | |
| |||
0 commit comments