Linux Power Management development
 help / color / mirror / Atom feed
* [bug report] thermal: add brcmstb AVS TMON driver
@ 2017-09-06  8:22 Dan Carpenter
  2017-09-06 17:00 ` Brian Norris
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2017-09-06  8:22 UTC (permalink / raw)
  To: computersforpeace; +Cc: linux-pm

Hello Brian Norris,

The patch 1e21c74eda83: "thermal: add brcmstb AVS TMON driver" from
Aug 9, 2017, leads to the following static checker warning:

	drivers/thermal/broadcom/brcmstb_thermal.c:281 brcmstb_set_trips()
	warn: impossible condition '(low > ((~0 >> 1))) => (s32min-s32max > s32max)'

	drivers/thermal/broadcom/brcmstb_thermal.c:290 brcmstb_set_trips()
	warn: impossible condition '(high > ((~0 >> 1))) => (s32min-s32max > s32max)'

drivers/thermal/broadcom/brcmstb_thermal.c
   274  static int brcmstb_set_trips(void *data, int low, int high)
   275  {
   276          struct brcmstb_thermal_priv *priv = data;
   277  
   278          dev_dbg(priv->dev, "set trips %d <--> %d\n", low, high);
   279  
   280          if (low) {
   281                  if (low > INT_MAX)
                            ^^^^^^^^^^^^^
Never true

   282                          low = INT_MAX;
   283                  avs_tmon_set_trip_temp(priv, TMON_TRIP_TYPE_LOW, low);
   284                  avs_tmon_trip_enable(priv, TMON_TRIP_TYPE_LOW, 1);
   285          } else {
   286                  avs_tmon_trip_enable(priv, TMON_TRIP_TYPE_LOW, 0);
   287          }
   288  
   289          if (high < ULONG_MAX) {
                    ^^^^^^^^^^^^^^^^
Always true

   290                  if (high > INT_MAX)
                            ^^^^^^^^^^^^^^
Never true

   291                          high = INT_MAX;
   292                  avs_tmon_set_trip_temp(priv, TMON_TRIP_TYPE_HIGH, high);
   293                  avs_tmon_trip_enable(priv, TMON_TRIP_TYPE_HIGH, 1);
   294          } else {
   295                  avs_tmon_trip_enable(priv, TMON_TRIP_TYPE_HIGH, 0);
   296          }
   297  
   298          return 0;
   299  }


regards,
dan carpenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-14 23:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-06  8:22 [bug report] thermal: add brcmstb AVS TMON driver Dan Carpenter
2017-09-06 17:00 ` Brian Norris
2017-09-06 18:08   ` Florian Fainelli
2017-09-06 18:37     ` Brian Norris
2017-09-06 19:33       ` Doug Berger
2017-09-06 19:46         ` Markus Mayer
2017-09-14 23:19           ` [PATCH] thermal: brcmstb: disable trip points properly when needed Markus Mayer
2017-09-14 23:25             ` Markus Mayer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox