Thread (7 messages) 7 messages, 2 authors, 7d ago

Re: [PATCH net-next v7 4/5] net: dsa: microchip: Support Microchip KSZ8995XA / KS8995XA

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-07-21 00:22:26
Also in: linux-devicetree

On Sat, 04 Jul 2026 21:39:36 +0200 Linus Walleij wrote:
This adds support for the Microchip KSZ8995XA also known as the
Micrel KS8995XA switch to the KSZ driver.

Notice: there are also KSZ8995E and KSZ8995MA. These are BOTH
different from the KSZ8995XA.

The helper macros are named ksz_is_ksz8995xa() to make it
possible to add E and MA support in the future.
Clang says:

../drivers/net/dsa/microchip/ksz8.c:263:13: warning: variable 'reg_4q' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
  263 |         } else if (ksz_is_ksz8995xa(dev)) {
      |                    ^~~~~~~~~~~~~~~~~~~~~
../drivers/net/dsa/microchip/ksz8.c:288:29: note: uninitialized use occurs here
  288 |         ret = ksz_prmw8(dev, port, reg_4q, mask_4q, data_4q);
      |                                    ^~~~~~
../drivers/net/dsa/microchip/ksz8.c:263:9: note: remove the 'if' if its condition is always false
  263 |         } else if (ksz_is_ksz8995xa(dev)) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  264 |                 /* This switch has no 4way split support */
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265 |                 mask_2q = KSZ8795_PORT_2QUEUE_SPLIT_EN;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266 |                 reg_2q = REG_PORT_CTRL_0;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
  267 |         } else {
      |         ~~~~~~
../drivers/net/dsa/microchip/ksz8.c:237:11: note: initialize the variable 'reg_4q' to silence this warning
  237 |         u8 reg_4q, reg_2q;
      |                  ^
      |                   = '\0'
../drivers/net/dsa/microchip/ksz8.c:263:13: warning: variable 'mask_4q' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
  263 |         } else if (ksz_is_ksz8995xa(dev)) {
      |                    ^~~~~~~~~~~~~~~~~~~~~
../drivers/net/dsa/microchip/ksz8.c:288:37: note: uninitialized use occurs here
  288 |         ret = ksz_prmw8(dev, port, reg_4q, mask_4q, data_4q);
      |                                            ^~~~~~~
../drivers/net/dsa/microchip/ksz8.c:263:9: note: remove the 'if' if its condition is always false
  263 |         } else if (ksz_is_ksz8995xa(dev)) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  264 |                 /* This switch has no 4way split support */
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265 |                 mask_2q = KSZ8795_PORT_2QUEUE_SPLIT_EN;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266 |                 reg_2q = REG_PORT_CTRL_0;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
  267 |         } else {
      |         ~~~~~~
../drivers/net/dsa/microchip/ksz8.c:236:12: note: initialize the variable 'mask_4q' to silence this warning
  236 |         u8 mask_4q, mask_2q;
      |                   ^
      |                    = '\0'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help