Re: [PATCH net-next v2 4/8] net: dsa: microchip: Add support for KSZ8463's PTP interrupts
From: Bastien Curutchet
Date: Mon Jan 26 2026 - 03:03:40 EST
Hi Jakub,
On 1/25/26 10:38 PM, Jakub Kicinski wrote:
On Thu, 22 Jan 2026 14:27:38 +0100 Bastien Curutchet (Schneider
Electric) wrote:
+int ksz8463_ptp_irq_setup(struct dsa_switch *ds)
+{
+ struct ksz_device *dev = ds->priv;
+ const struct ksz_dev_ops *ops = dev->dev_ops;
+ struct ksz_port *port1, *port2;
+ struct ksz_irq *ptpirq;
+ int ret;
+ int p;
+
+ port1 = &dev->ports[0];
+ port2 = &dev->ports[1];
+ ptpirq = &port1->ptpirq;
+
+ ptpirq->irq_num = irq_find_mapping(dev->girq.domain, KSZ8463_SRC_PTP_INT);
+ if (!ptpirq->irq_num)
+ return -EINVAL;
+
+ ptpirq->dev = dev;
+ ptpirq->nirqs = 4;
+ ptpirq->reg_mask = ops->get_port_addr(p, KSZ8463_PTP_TS_IER);
+ ptpirq->reg_status = ops->get_port_addr(p, KSZ8463_PTP_TS_ISR);
clang says:
drivers/net/dsa/microchip/ksz_ptp.c:1187:40: warning: variable 'p' is uninitialized when used here [-Wuninitialized]
1187 | ptpirq->reg_mask = ops->get_port_addr(p, KSZ8463_PTP_TS_IER);
| ^
drivers/net/dsa/microchip/ksz_ptp.c:1175:7: note: initialize the variable 'p' to silence this warning
1175 | int p;
| ^
| = 0
I thought gcc also reported this kind of warning, but I see here that it only reports it with W=2.
Anyway, I'll respin with this fixed.
Best regards,
Bastien