Project

General

Profile

Actions

Bug #9609

closed

qede: error: result of '983040 << 16' requires 37 bits to represent, but 'int' only has 32 bits

Added by Toomas Soome about 4 years ago. Updated about 4 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Issue found by gcc 7 build:

    qede: error: result of '983040 << 16' requires 37 bits to represent, but 'int' only has 32 bits

    In file included from ../../common/io/qede/579xx/drivers/ecore/ecore_mcp.c:37:0:
    ../../common/io/qede/579xx/drivers/ecore/ecore_mcp.c: In function '__ecore_mcp_load_req':
    ../../common/io/qede/579xx/drivers/ecore/ecore.h:127:31: error: result of '983040 << 16' requires 37 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
      (name) &= ~((field ## _MASK) << (field ## _SHIFT));  \
                                   ^
    ../../common/io/qede/579xx/drivers/ecore/ecore_mcp.c:725:2: note: in expansion of macro 'ECORE_MFW_SET_FIELD'
      ECORE_MFW_SET_FIELD(load_req.misc0, LOAD_REQ_FORCE,
      ^
    ../../common/io/qede/579xx/drivers/ecore/ecore.h:127:31: error: result of '15728640 << 20' requires 45 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
      (name) &= ~((field ## _MASK) << (field ## _SHIFT));  \
                                   ^
    ../../common/io/qede/579xx/drivers/ecore/ecore_mcp.c:727:2: note: in expansion of macro 'ECORE_MFW_SET_FIELD'
      ECORE_MFW_SET_FIELD(load_req.misc0, LOAD_REQ_FLAGS0,
      ^
    cc1: all warnings being treated as errors

the masks are mishandled --- we do not need to have mask shifted.

Actions #1

Updated by Electric Monk about 4 years ago

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

git commit d972451485b9ccf8c5c4951e2d24f63da9ac2cc8

commit  d972451485b9ccf8c5c4951e2d24f63da9ac2cc8
Author: Toomas Soome <tsoome@me.com>
Date:   2018-07-30T17:30:27.000Z

    9609 qede: error: result of '983040 << 16' requires 37 bits to represent, but 'int' only has 32 bits
    Contributed by: Anand Khoje <Anand.Khoje@cavium.com>
    Reviewed by: Andy Fiddaman <af@citrus-it.net>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF