Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: aquantia: switch to crc_itu_t()

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>

authored by

Stephen Rothwell and committed by
Jakub Kicinski
6c8e2407 63c7234f

+4 -4
+1 -1
drivers/net/phy/aquantia/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 config AQUANTIA_PHY 3 3 tristate "Aquantia PHYs" 4 - select CRC_CCITT 4 + select CRC_ITU_T 5 5 help 6 6 Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405
+3 -3
drivers/net/phy/aquantia/aquantia_firmware.c
··· 3 3 #include <linux/bitfield.h> 4 4 #include <linux/of.h> 5 5 #include <linux/firmware.h> 6 - #include <linux/crc-ccitt.h> 6 + #include <linux/crc-itu-t.h> 7 7 #include <linux/nvmem-consumer.h> 8 8 9 9 #include <asm/unaligned.h> ··· 132 132 crc_data[3] = word; 133 133 134 134 /* ...calculate CRC as we load data... */ 135 - crc = crc_ccitt_false(crc, crc_data, sizeof(crc_data)); 135 + crc = crc_itu_t(crc, crc_data, sizeof(crc_data)); 136 136 } 137 137 /* ...gets CRC from MAILBOX after we have loaded the entire section... */ 138 138 up_crc = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE2); ··· 164 164 phydev_err(phydev, "bad firmware CRC in firmware\n"); 165 165 return ret; 166 166 } 167 - calculated_crc = crc_ccitt_false(0, data, size - sizeof(u16)); 167 + calculated_crc = crc_itu_t(0, data, size - sizeof(u16)); 168 168 if (read_crc != calculated_crc) { 169 169 phydev_err(phydev, "bad firmware CRC: file 0x%04x calculated 0x%04x\n", 170 170 read_crc, calculated_crc);