linux/drivers/net/dsa/sja1105
Vladimir Oltean 48c2752785 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 24deec6b9e ("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 <vladimir.oltean@nxp.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241210-packing-pack-fields-and-ice-implementation-v10-2-ee56a47479ac@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-12-11 20:12:59 -08:00
..
Kconfig
Makefile
sja1105.h net: dsa: sja1105: use phylink_pcs internally 2024-10-02 17:32:00 -07:00
sja1105_clocking.c net: dsa: sja1105: make read-only const arrays static 2023-09-21 16:12:12 +02:00
sja1105_devlink.c
sja1105_dynamic_config.c net: dsa: sja1105: fix multicast forwarding working only for last added mdb entry 2023-09-11 08:32:30 +01:00
sja1105_dynamic_config.h
sja1105_ethtool.c net: dsa: use ethtool string helpers 2024-11-03 10:36:34 -08:00
sja1105_flower.c net: dsa: sja1105: flower: validate control flags 2024-04-18 17:08:37 -07:00
sja1105_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-10 13:13:33 -07:00
sja1105_mdio.c net: dsa: sja1105: use phylink_pcs internally 2024-10-02 17:32:00 -07:00
sja1105_ptp.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
sja1105_ptp.h net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
sja1105_spi.c net: dsa: sja1105: complete tc-cbs offload support on SJA1110 2023-09-06 06:23:05 +01:00
sja1105_static_config.c lib: packing: demote truncation error in pack() to a warning in __pack() 2024-12-11 20:12:59 -08:00
sja1105_static_config.h
sja1105_tas.c net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum 2023-05-31 10:00:30 +01:00
sja1105_tas.h
sja1105_vl.c
sja1105_vl.h