Project

General

Profile

Bug #9610

qede: error: left shift of negative value

Added by Toomas Soome almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
2018-06-15
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Issue found by gcc 7 build:

    In file included from ../../common/io/qede/579xx/drivers/ecore/ecore_hw.h:39:0,
                     from ../../common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c:37:
    ../../common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c: In function 'ecore_send_qm_stop_cmd':
    ../../common/io/qede/579xx/drivers/ecore/ecore.h:114:27: error: left shift of negative value [-Werror=shift-negative-value]
      (value) &= ~(name##_MASK << name##_SHIFT);   \
                               ^
    ../../common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c:157:52: note: in expansion of macro 'SET_FIELD'
     #define QM_CMD_SET_FIELD(var, cmd, field, value)   SET_FIELD(var[cmd##_##field##_OFFSET], cmd##_##field, value)
                                                        ^~~~~~~~~
    ../../common/io/qede/579xx/drivers/ecore/ecore_init_fw_funcs.c:860:4: note: in expansion of macro 'QM_CMD_SET_FIELD'
        QM_CMD_SET_FIELD(cmd_arr, QM_STOP_CMD, PAUSE_MASK, pq_mask);
        ^
    cc1: all warnings being treated as errors

We have mask defined as -1, and its being left shifted. use UINT_MAX and no shifting.

History

#1

Updated by Electric Monk over 1 year ago

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

git commit 7e3488dc6cdcb0c04e1ce167a1a3bfef83b5f2e0

commit  7e3488dc6cdcb0c04e1ce167a1a3bfef83b5f2e0
Author: Toomas Soome <tsoome@me.com>
Date:   2018-07-30T17:31:16.000Z

    9610 qede: error: left shift of negative value
    Contributed by: Anand Khoje <Anand.Khoje@cavium.com>
    Reviewed by: Andy Fiddaman <af@citrus-it.net>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF