Subject: Re: [PATCH net-next v2 4/8] net: dsa: microchip: Add support for KSZ8463's PTP interrupts

From: Jakub Kicinski <[email-masked]>
Date: Sun, 25 Jan 2026 13:38:58 -0800

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
-- 
pw-bot: cr