Bug #9090

ses: using integer constants in boolean context, the expression will always evaluate to 'true'

Added by Toomas Soome 6 months ago. Updated 6 months ago.

Status:ClosedStart date:2018-02-10
Priority:NormalDue date:
Assignee:Toomas Soome% Done:

100%

Category:driver - device drivers
Target version:-
Difficulty:Medium Tags:

Description

Issue found by gcc 7:

    In file included from ../../common/io/scsi/targets/ses.c:35:0:
    ../../common/io/scsi/targets/ses.c: In function 'ses_callback':
    ../../common/io/scsi/targets/ses.c:1329:37: error: ?: using integer constants in
     boolean context, the expression will always evaluate to 'true' [-Werror=int-in-
    bool-context]
            (err == EBUSY)? SES_BUSY_TIME: SES_RESTART_TIME,
    ../../common/sys/scsi/targets/ses.h:252:7: note: in definition of macro 'SES_ENA
    BLE_RESTART'
          (ms_time)? (drv_usectohz(ms_time * 1000)) : \
           ^~~~~~~
    cc1: all warnings being treated as errors

History

#1 Updated by Toomas Soome 6 months ago

  • Subject changed from ses: using integer constants in boolean context, the expression will always evaluate to 'true' to ses: using integer constants in boolean context, the expression will always evaluate to 'true'

#2 Updated by Electric Monk 6 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 146ac3cd9d5017d58ec9ba26132a9ee30d53c4aa

commit  146ac3cd9d5017d58ec9ba26132a9ee30d53c4aa
Author: Toomas Soome <tsoome@me.com>
Date:   2018-02-16T16:18:18.000Z

    9090 ses: using integer constants in boolean context, the expression will always evaluate to 'true'
    Reviewed by: Yuri Pankov <yuripv@yuripv.net>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom