net: phy: aquantia: switch to crc_itu_t()
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Dec 2023 02:09:46 +0000 (13:09 +1100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jan 2024 21:14:31 +0000 (13:14 -0800)
After merging the net-next tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/net/phy/aquantia/aquantia_firmware.c: In function 'aqr_fw_load_memory':
drivers/net/phy/aquantia/aquantia_firmware.c:135:23: error: implicit declaration of function 'crc_ccitt_false'; did you mean 'crc_ccitt_byte'? [-Werror=implicit-function-declaration]
  135 |                 crc = crc_ccitt_false(crc, crc_data, sizeof(crc_data));
      |                       ^~~~~~~~~~~~~~~
      |                       crc_ccitt_byte

Caused by commit e93984ebc1c8 ("net: phy: aquantia: add firmware load support")
interacting with commit ("lib: crc_ccitt_false() is identical to crc_itu_t()")
from the mm tree.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20231221130946.7ed9a805@canb.auug.org.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/aquantia/Kconfig
drivers/net/phy/aquantia/aquantia_firmware.c

index a35de4b9b5545bd9b9301b06791bba050e2ecdfb..1a65678583cf59b0039ee52cde65cc8be0ab0221 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config AQUANTIA_PHY
        tristate "Aquantia PHYs"
-       select CRC_CCITT
+       select CRC_ITU_T
        help
          Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405
index ff34d00d5a0e6a26710d90e7cef9078b5b486798..0c9640ef153bf9843a8a3ca0347a9d76e56d2d6f 100644 (file)
@@ -3,7 +3,7 @@
 #include <linux/bitfield.h>
 #include <linux/of.h>
 #include <linux/firmware.h>
-#include <linux/crc-ccitt.h>
+#include <linux/crc-itu-t.h>
 #include <linux/nvmem-consumer.h>
 
 #include <asm/unaligned.h>
@@ -132,7 +132,7 @@ static int aqr_fw_load_memory(struct phy_device *phydev, u32 addr,
                crc_data[3] = word;
 
                /* ...calculate CRC as we load data... */
-               crc = crc_ccitt_false(crc, crc_data, sizeof(crc_data));
+               crc = crc_itu_t(crc, crc_data, sizeof(crc_data));
        }
        /* ...gets CRC from MAILBOX after we have loaded the entire section... */
        up_crc = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE2);
@@ -164,7 +164,7 @@ static int aqr_fw_boot(struct phy_device *phydev, const u8 *data, size_t size,
                phydev_err(phydev, "bad firmware CRC in firmware\n");
                return ret;
        }
-       calculated_crc = crc_ccitt_false(0, data, size - sizeof(u16));
+       calculated_crc = crc_itu_t(0, data, size - sizeof(u16));
        if (read_crc != calculated_crc) {
                phydev_err(phydev, "bad firmware CRC: file 0x%04x calculated 0x%04x\n",
                           read_crc, calculated_crc);