lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20181004070558.GA6535@flashbox>
Date:   Thu, 4 Oct 2018 00:05:58 -0700
From:   Nathan Chancellor <natechancellor@...il.com>
To:     Dept-GELinuxNICDev@...ium.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Clang warning in drivers/net/ethernet/qlogic/qla3xxx.c

Hi all,

In an effort to get the kernel compiling warning free with Clang, I came
the following warning:

drivers/net/ethernet/qlogic/qla3xxx.c:384:24: warning: signed shift result (0xF00000000) requires 37 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
                           ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
                             ~~~~~~~~~~~~~~ ^  ~~
1 warning generated.

This particular statement has been present since the introduction of the
driver in 2006 so I am unsure if this was intention or if maybe the
statement should have been removed since ISP_NVRAM_MASK is defined as
'0x000F << 16' in drivers/net/ethernet/qlogic/qla3xxx.h and it's the
only enum to be shifted. This is the only location in the driver that
has this warning.

Perhaps this diff would solve the warning and keep the driver
functional? I'll be happy to send a formal patch if that is the case.



diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index b48f76182049..10b075bc5959 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -380,8 +380,6 @@ static void fm93c56a_select(struct ql3_adapter *qdev)
 
        qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1;
        ql_write_nvram_reg(qdev, spir, ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
-       ql_write_nvram_reg(qdev, spir,
-                          ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
 }
 
 /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ