aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_common.c
diff options
context:
space:
mode:
authorVladimir Oltean <[email protected]>2024-12-10 20:27:11 +0000
committerJakub Kicinski <[email protected]>2024-12-12 04:12:59 +0000
commit48c2752785ad1730e08a64507f05d0e5d5bc79b8 (patch)
tree7f5a9a2dd41464dd700f3e1b64ee1ff06c675b22 /drivers/net/ethernet/intel/ice/ice_common.c
parentlib: packing: create __pack() and __unpack() variants without error checking (diff)
downloadkernel-48c2752785ad1730e08a64507f05d0e5d5bc79b8.tar.gz
kernel-48c2752785ad1730e08a64507f05d0e5d5bc79b8.zip
lib: packing: demote truncation error in pack() to a warning in __pack()
Most of the sanity checks in pack() and unpack() can be covered at compile time. There is only one exception, and that is truncation of the uval during a pack() operation. We'd like the error-less __pack() to catch that condition as well. But at the same time, it is currently the responsibility of consumer drivers (currently just sja1105) to print anything at all when this error occurs, and then discard the return code. We can just print a loud warning in the library code and continue with the truncated __pack() operation. In practice, having the warning is very important, see commit 24deec6b9e4a ("net: dsa: sja1105: disallow C45 transactions on the BASE-TX MDIO bus") where the bug was caught exactly by noticing this print. Add the first print to the packing library, and at the same time remove the print for the same condition from the sja1105 driver, to avoid double printing. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/20241210-packing-pack-fields-and-ice-implementation-v10-2-ee56a47479ac@intel.com Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_common.c')
0 files changed, 0 insertions, 0 deletions