Re: [PATCH] net: smc91x: Fix pointer types

From: Andrew Lunn
Date: Thu May 16 2024 - 10:14:14 EST


> -#define SMC_PUSH_DATA(lp, p, l) \
> +#define SMC_PUSH_DATA(lp, p, l) \
> do { \
> - if (SMC_32BIT(lp)) { \
> + void __iomem *__ioaddr = ioaddr; \

ioaddr is not a parameter passed to this macro.

> + if (SMC_32BIT(lp)) { \
> void *__ptr = (p); \
> int __len = (l); \
> - void __iomem *__ioaddr = ioaddr; \
> if (__len >= 2 && (unsigned long)__ptr & 2) { \
> __len -= 2; \
> - SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \
> + SMC_outsw(__ioaddr, DATA_REG(lp), __ptr, 1); \

You probably should use lp->base here, which is passed into this
macro, and should have the correct type.

> @@ -1072,7 +1072,7 @@ static const char * chip_ids[ 16 ] = {
> */ \
> __ptr -= 2; \
> __len += 2; \
> - SMC_SET_PTR(lp, \
> + SMC_SET_PTR(lp, \
> 2|PTR_READ|PTR_RCV|PTR_AUTOINC); \
> } \
> if (SMC_CAN_USE_DATACS && lp->datacs) \

This is just a whitespace change. Please put that into a different
patch.

Andrew