Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1282628

Re: [PATCH v4 06/10] thermal: rockchip: consistently use int for temperatures

From Brian Norris <computersforpeace@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 06/10] thermal: rockchip: consistently use int for temperatures
Date 2015-12-03 01:50 +0100
Message-ID <qBqfT-68m-1@gated-at.bofh.it> (permalink)
References <qsMIG-1ze-3@gated-at.bofh.it> <qsMIG-1ze-17@gated-at.bofh.it> <qBkDw-2x9-21@gated-at.bofh.it> <qBqfT-68m-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Caesar,

On Thu, Dec 03, 2015 at 08:42:38AM +0800, Caesar Wang wrote:
> ? 2015?12?03? 02:38, Brian Norris ??:
> 
> [.....]
> >  	if (thermal->tshut_temp > INT_MAX) {
> >      CID 1341498:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
> >      "thermal->tshut_temp > 2147483647 /* (int)(~0U >> 1) */" is always false regardless of the values of its operands. This occurs as the logical operand of if.
> >
> >I don't think this condition is even useful any more, so maybe we should
> >just kill the 'if' block.
> 
> See the patch to fix
> it.----->(https://patchwork.kernel.org/patch/7720601/)
> <https://patchwork.kernel.org/patch/7720601/>

-	if (thermal->tshut_temp > INT_MAX) {
+	if (!(thermal->tshut_temp < INT_MAX)) {

Huh? That still doesn't make much sense. The condition is still
impossible, since thermal->tshut_temp is an int. You've just made it
slightly harder for static analyzers to notice the impossibility.

> This patch is merged into kernel 4.4-rc3.

No it isn't, and I'm glad. The patch is silly.

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v4 06/10] thermal: rockchip: consistently use int for  temperatures Brian Norris <computersforpeace@gmail.com> - 2015-12-02 19:50 +0100
  Re: [PATCH v4 06/10] thermal: rockchip: consistently use int for  temperatures Brian Norris <computersforpeace@gmail.com> - 2015-12-03 01:50 +0100
    Re: [PATCH v4 06/10] thermal: rockchip: consistently use int for  temperatures Caesar Wang <wxt@rock-chips.com> - 2015-12-03 02:20 +0100

csiph-web