Fish Trophy

tsoome got a fish trophy!

9610 qede: error: left shift of negative value

Review Request #1111 — Created June 15, 2018 and submitted

tsoome
illumos-gate
9610
f55723d...
general
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


  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
vgusev
  1. 
      
  2. Could you clarify how new change will work with any another _SHIFT and _MASK values ?

    For instance:
    QM_STOP_CMD_GROUP_ID_SHIFT 16
    QM_STOP_CMD_GROUP_ID_MASK 15

    Old behaviour resets three bits 16,17,18 and then set those bits to flag value.

    Changed behaviour resets three bits (0,1,2) and then does "or" with bits 16,17,18 according to flag.

    1. Yes it is broken, just havent had time to figure out the correct fix there.

    2. Right, now I got time to read, indeed, they have 2 styles of shift and mask values (for exact bits and for whole register width), but one macro, so obviously there is a problem:) thanks for spotting this.

  3. 
      
tsoome
citrus
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...