net: mscc: ocelot: warn when encoding an out-of-bounds watermark value
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 5 Oct 2020 09:09:12 +0000 (12:09 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Oct 2020 13:05:47 +0000 (06:05 -0700)
commit013264936654fd3052fabe700b7a4933d3925395
treef6e5f625fd3afe6ee66e9cf9aa4ce0089b1b0fb7
parent601e984f23abcaa7cf3eb078c13de4db3cf6a4f0
net: mscc: ocelot: warn when encoding an out-of-bounds watermark value

There is an upper bound to the value that a watermark may hold. That
upper bound is not immediately obvious during configuration, and it
might be possible to have accidental truncation.

Actually this has happened already, add a warning to prevent it from
happening again.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/dsa/ocelot/seville_vsc9953.c
drivers/net/ethernet/mscc/ocelot_vsc7514.c