[IB] mthca: fix format of FW version
Mellanox has decided that the components of the firmware version are really meant to be displayed in decimal, e.g. 0x000400070190 is version 4.7.400. Change the format we use from "%x.%x.%x" to "%d.%d.%d" to match this convention. Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
8ae5a8a24f
commit
87cfe32375
|
@ -1057,7 +1057,7 @@ static int __devinit mthca_init_one(struct pci_dev *pdev,
|
||||||
goto err_cmd;
|
goto err_cmd;
|
||||||
|
|
||||||
if (mdev->fw_ver < mthca_hca_table[id->driver_data].latest_fw) {
|
if (mdev->fw_ver < mthca_hca_table[id->driver_data].latest_fw) {
|
||||||
mthca_warn(mdev, "HCA FW version %x.%x.%x is old (%x.%x.%x is current).\n",
|
mthca_warn(mdev, "HCA FW version %d.%d.%d is old (%d.%d.%d is current).\n",
|
||||||
(int) (mdev->fw_ver >> 32), (int) (mdev->fw_ver >> 16) & 0xffff,
|
(int) (mdev->fw_ver >> 32), (int) (mdev->fw_ver >> 16) & 0xffff,
|
||||||
(int) (mdev->fw_ver & 0xffff),
|
(int) (mdev->fw_ver & 0xffff),
|
||||||
(int) (mthca_hca_table[id->driver_data].latest_fw >> 32),
|
(int) (mthca_hca_table[id->driver_data].latest_fw >> 32),
|
||||||
|
|
|
@ -1028,7 +1028,7 @@ static ssize_t show_rev(struct class_device *cdev, char *buf)
|
||||||
static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
|
static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
|
||||||
{
|
{
|
||||||
struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
|
struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
|
||||||
return sprintf(buf, "%x.%x.%x\n", (int) (dev->fw_ver >> 32),
|
return sprintf(buf, "%d.%d.%d\n", (int) (dev->fw_ver >> 32),
|
||||||
(int) (dev->fw_ver >> 16) & 0xffff,
|
(int) (dev->fw_ver >> 16) & 0xffff,
|
||||||
(int) dev->fw_ver & 0xffff);
|
(int) dev->fw_ver & 0xffff);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue