netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] xilinx_emaclite W=1 fixes
@ 2020-10-31 17:47 Andrew Lunn
  2020-10-31 17:47 ` [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andrew Lunn @ 2020-10-31 17:47 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey, Andrew Lunn

kerneldoc, pointer issues, and add COMPILE_TEST support to easy
finding future issues via build testing.

Andrew Lunn (3):
  drivers: net: xilinx_emaclite: Add missing parameter kerneldoc
  drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with
    W=1
  drivers: net: xilinx_emaclite: Add COMPILE_TEST support

 drivers/net/ethernet/xilinx/Kconfig           |  2 +-
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc
  2020-10-31 17:47 [PATCH net-next 0/3] xilinx_emaclite W=1 fixes Andrew Lunn
@ 2020-10-31 17:47 ` Andrew Lunn
  2020-11-02  7:18   ` Michal Simek
  2020-10-31 17:47 ` [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1 Andrew Lunn
  2020-10-31 17:47 ` [PATCH net-next 3/3] drivers: net: xilinx_emaclite: Add COMPILE_TEST support Andrew Lunn
  2 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2020-10-31 17:47 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey, Andrew Lunn

The txqueue parameter to the watchdog callback is unused in this
driver. But it still needs to be documented.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 0c26f5bcc523..2c98e4cc07a5 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -518,6 +518,7 @@ static int xemaclite_set_mac_address(struct net_device *dev, void *address)
 /**
  * xemaclite_tx_timeout - Callback for Tx Timeout
  * @dev:	Pointer to the network device
+ * @txqueue:	Unused
  *
  * This function is called when Tx time out occurs for Emaclite device.
  */
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1
  2020-10-31 17:47 [PATCH net-next 0/3] xilinx_emaclite W=1 fixes Andrew Lunn
  2020-10-31 17:47 ` [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc Andrew Lunn
@ 2020-10-31 17:47 ` Andrew Lunn
  2020-11-02  7:20   ` Michal Simek
  2020-10-31 17:47 ` [PATCH net-next 3/3] drivers: net: xilinx_emaclite: Add COMPILE_TEST support Andrew Lunn
  2 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2020-10-31 17:47 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey, Andrew Lunn

drivers/net/ethernet//xilinx/xilinx_emaclite.c:341:35: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  341 |   addr = (void __iomem __force *)((u32 __force)addr ^

Use long instead of u32 to avoid problems on 64 bit systems.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 2c98e4cc07a5..f56c1fd01061 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -97,7 +97,7 @@
 #define ALIGNMENT		4
 
 /* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */
-#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) % ALIGNMENT)
+#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) % ALIGNMENT)
 
 #ifdef __BIG_ENDIAN
 #define xemaclite_readl		ioread32be
@@ -338,7 +338,7 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
 		 * if it is configured in HW
 		 */
 
-		addr = (void __iomem __force *)((u32 __force)addr ^
+		addr = (void __iomem __force *)((long __force)addr ^
 						 XEL_BUFFER_OFFSET);
 		reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
 
@@ -399,7 +399,7 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)
 		 * will correct on subsequent calls
 		 */
 		if (drvdata->rx_ping_pong != 0)
-			addr = (void __iomem __force *)((u32 __force)addr ^
+			addr = (void __iomem __force *)((long __force)addr ^
 							 XEL_BUFFER_OFFSET);
 		else
 			return 0;	/* No data was available */
@@ -1192,9 +1192,9 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
 	}
 
 	dev_info(dev,
-		 "Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
+		 "Xilinx EmacLite at 0x%08X mapped to 0x%08lX, irq=%d\n",
 		 (unsigned int __force)ndev->mem_start,
-		 (unsigned int __force)lp->base_addr, ndev->irq);
+		 (unsigned long __force)lp->base_addr, ndev->irq);
 	return 0;
 
 error:
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net-next 3/3] drivers: net: xilinx_emaclite: Add COMPILE_TEST support
  2020-10-31 17:47 [PATCH net-next 0/3] xilinx_emaclite W=1 fixes Andrew Lunn
  2020-10-31 17:47 ` [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc Andrew Lunn
  2020-10-31 17:47 ` [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1 Andrew Lunn
@ 2020-10-31 17:47 ` Andrew Lunn
  2020-11-02  7:21   ` Michal Simek
  2 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2020-10-31 17:47 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey, Andrew Lunn

To improve build testing of this driver, add COMPILE_TEST support.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/xilinx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/Kconfig b/drivers/net/ethernet/xilinx/Kconfig
index d0d0d4fe9d40..3b2137d1f4c6 100644
--- a/drivers/net/ethernet/xilinx/Kconfig
+++ b/drivers/net/ethernet/xilinx/Kconfig
@@ -18,7 +18,7 @@ if NET_VENDOR_XILINX
 
 config XILINX_EMACLITE
 	tristate "Xilinx 10/100 Ethernet Lite support"
-	depends on PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS
+	depends on PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS || COMPILE_TEST
 	select PHYLIB
 	help
 	  This driver supports the 10/100 Ethernet Lite from Xilinx.
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc
  2020-10-31 17:47 ` [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc Andrew Lunn
@ 2020-11-02  7:18   ` Michal Simek
  0 siblings, 0 replies; 11+ messages in thread
From: Michal Simek @ 2020-11-02  7:18 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey



On 31. 10. 20 18:47, Andrew Lunn wrote:
> The txqueue parameter to the watchdog callback is unused in this
> driver. But it still needs to be documented.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/net/ethernet/xilinx/xilinx_emaclite.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index 0c26f5bcc523..2c98e4cc07a5 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -518,6 +518,7 @@ static int xemaclite_set_mac_address(struct net_device *dev, void *address)
>  /**
>   * xemaclite_tx_timeout - Callback for Tx Timeout
>   * @dev:	Pointer to the network device
> + * @txqueue:	Unused
>   *
>   * This function is called when Tx time out occurs for Emaclite device.
>   */
> 


Fixes: 0290bd291cc0 ("netdev: pass the stuck queue to the timeout handler")
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1
  2020-10-31 17:47 ` [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1 Andrew Lunn
@ 2020-11-02  7:20   ` Michal Simek
  2020-11-02  7:31     ` Radhey Shyam Pandey
  2020-11-02 13:51     ` Andrew Lunn
  0 siblings, 2 replies; 11+ messages in thread
From: Michal Simek @ 2020-11-02  7:20 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey



On 31. 10. 20 18:47, Andrew Lunn wrote:
> drivers/net/ethernet//xilinx/xilinx_emaclite.c:341:35: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>   341 |   addr = (void __iomem __force *)((u32 __force)addr ^
> 
> Use long instead of u32 to avoid problems on 64 bit systems.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/net/ethernet/xilinx/xilinx_emaclite.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index 2c98e4cc07a5..f56c1fd01061 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -97,7 +97,7 @@
>  #define ALIGNMENT		4
>  
>  /* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */
> -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) % ALIGNMENT)
> +#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) % ALIGNMENT)

I can't see any reason to change unsigned type to signed one.

>  
>  #ifdef __BIG_ENDIAN
>  #define xemaclite_readl		ioread32be
> @@ -338,7 +338,7 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
>  		 * if it is configured in HW
>  		 */
>  
> -		addr = (void __iomem __force *)((u32 __force)addr ^
> +		addr = (void __iomem __force *)((long __force)addr ^

ditto.

>  						 XEL_BUFFER_OFFSET);
>  		reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
>  
> @@ -399,7 +399,7 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)
>  		 * will correct on subsequent calls
>  		 */
>  		if (drvdata->rx_ping_pong != 0)
> -			addr = (void __iomem __force *)((u32 __force)addr ^
> +			addr = (void __iomem __force *)((long __force)addr ^

ditto.

>  							 XEL_BUFFER_OFFSET);
>  		else
>  			return 0;	/* No data was available */
> @@ -1192,9 +1192,9 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
>  	}
>  
>  	dev_info(dev,
> -		 "Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
> +		 "Xilinx EmacLite at 0x%08X mapped to 0x%08lX, irq=%d\n",
>  		 (unsigned int __force)ndev->mem_start,
> -		 (unsigned int __force)lp->base_addr, ndev->irq);
> +		 (unsigned long __force)lp->base_addr, ndev->irq);

This is different case but I don't think address can be signed type here
too.

>  	return 0;
>  
>  error:
> 

Thanks,
Michal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 3/3] drivers: net: xilinx_emaclite: Add COMPILE_TEST support
  2020-10-31 17:47 ` [PATCH net-next 3/3] drivers: net: xilinx_emaclite: Add COMPILE_TEST support Andrew Lunn
@ 2020-11-02  7:21   ` Michal Simek
  0 siblings, 0 replies; 11+ messages in thread
From: Michal Simek @ 2020-11-02  7:21 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski; +Cc: netdev, Michal Simek, Radhey Shyam Pandey



On 31. 10. 20 18:47, Andrew Lunn wrote:
> To improve build testing of this driver, add COMPILE_TEST support.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/net/ethernet/xilinx/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/Kconfig b/drivers/net/ethernet/xilinx/Kconfig
> index d0d0d4fe9d40..3b2137d1f4c6 100644
> --- a/drivers/net/ethernet/xilinx/Kconfig
> +++ b/drivers/net/ethernet/xilinx/Kconfig
> @@ -18,7 +18,7 @@ if NET_VENDOR_XILINX
>  
>  config XILINX_EMACLITE
>  	tristate "Xilinx 10/100 Ethernet Lite support"
> -	depends on PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS
> +	depends on PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS || COMPILE_TEST
>  	select PHYLIB
>  	help
>  	  This driver supports the 10/100 Ethernet Lite from Xilinx.
> 

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1
  2020-11-02  7:20   ` Michal Simek
@ 2020-11-02  7:31     ` Radhey Shyam Pandey
  2020-11-03 23:28       ` Andrew Lunn
  2020-11-02 13:51     ` Andrew Lunn
  1 sibling, 1 reply; 11+ messages in thread
From: Radhey Shyam Pandey @ 2020-11-02  7:31 UTC (permalink / raw)
  To: Michal Simek, Andrew Lunn, Jakub Kicinski; +Cc: netdev, Michal Simek

> -----Original Message-----
> From: Michal Simek <michal.simek@xilinx.com>
> Sent: Monday, November 2, 2020 12:51 PM
> To: Andrew Lunn <andrew@lunn.ch>; Jakub Kicinski <kuba@kernel.org>
> Cc: netdev <netdev@vger.kernel.org>; Michal Simek <michals@xilinx.com>;
> Radhey Shyam Pandey <radheys@xilinx.com>
> Subject: Re: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-
> to-int-cast warnings with W=1
> 
> 
> 
> On 31. 10. 20 18:47, Andrew Lunn wrote:
> > drivers/net/ethernet//xilinx/xilinx_emaclite.c:341:35: warning: cast from
> pointer to integer of different size [-Wpointer-to-int-cast]
> >   341 |   addr = (void __iomem __force *)((u32 __force)addr ^
> >
> > Use long instead of u32 to avoid problems on 64 bit systems.
> >
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> >  drivers/net/ethernet/xilinx/xilinx_emaclite.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > index 2c98e4cc07a5..f56c1fd01061 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > @@ -97,7 +97,7 @@
> >  #define ALIGNMENT		4
> >
> >  /* BUFFER_ALIGN(adr) calculates the number of bytes to the next
> > alignment. */ -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) %
> > ALIGNMENT)
> > +#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) % ALIGNMENT)
> 
> I can't see any reason to change unsigned type to signed one.
Agree. Also, I think we can get rid of this custom BUFFER_ALIGN
macro and simply calling skb_reserve(skb, NET_IP_ALIGN)
will make the protocol header to be aligned on at 
least a 4-byte boundary?

> 
> >
> >  #ifdef __BIG_ENDIAN
> >  #define xemaclite_readl		ioread32be
> > @@ -338,7 +338,7 @@ static int xemaclite_send_data(struct net_local
> *drvdata, u8 *data,
> >  		 * if it is configured in HW
> >  		 */
> >
> > -		addr = (void __iomem __force *)((u32 __force)addr ^
> > +		addr = (void __iomem __force *)((long __force)addr ^
> 
> ditto.
> 
> >  						 XEL_BUFFER_OFFSET);
> >  		reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
> >
> > @@ -399,7 +399,7 @@ static u16 xemaclite_recv_data(struct net_local
> *drvdata, u8 *data, int maxlen)
> >  		 * will correct on subsequent calls
> >  		 */
> >  		if (drvdata->rx_ping_pong != 0)
> > -			addr = (void __iomem __force *)((u32 __force)addr ^
> > +			addr = (void __iomem __force *)((long __force)addr
> ^
> 
> ditto.
> 
> >
> XEL_BUFFER_OFFSET);
> >  		else
> >  			return 0;	/* No data was available */
> > @@ -1192,9 +1192,9 @@ static int xemaclite_of_probe(struct
> platform_device *ofdev)
> >  	}
> >
> >  	dev_info(dev,
> > -		 "Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
> > +		 "Xilinx EmacLite at 0x%08X mapped to 0x%08lX, irq=%d\n",
> >  		 (unsigned int __force)ndev->mem_start,
> > -		 (unsigned int __force)lp->base_addr, ndev->irq);
> > +		 (unsigned long __force)lp->base_addr, ndev->irq);
> 
> This is different case but I don't think address can be signed type here too.
> 
> >  	return 0;
> >
> >  error:
> >
> 
> Thanks,
> Michal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1
  2020-11-02  7:20   ` Michal Simek
  2020-11-02  7:31     ` Radhey Shyam Pandey
@ 2020-11-02 13:51     ` Andrew Lunn
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2020-11-02 13:51 UTC (permalink / raw)
  To: Michal Simek; +Cc: Jakub Kicinski, netdev, Radhey Shyam Pandey

On Mon, Nov 02, 2020 at 08:20:47AM +0100, Michal Simek wrote:
> 
> 
> On 31. 10. 20 18:47, Andrew Lunn wrote:
> > drivers/net/ethernet//xilinx/xilinx_emaclite.c:341:35: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> >   341 |   addr = (void __iomem __force *)((u32 __force)addr ^
> > 
> > Use long instead of u32 to avoid problems on 64 bit systems.
> > 
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> >  drivers/net/ethernet/xilinx/xilinx_emaclite.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > index 2c98e4cc07a5..f56c1fd01061 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> > @@ -97,7 +97,7 @@
> >  #define ALIGNMENT		4
> >  
> >  /* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */
> > -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) % ALIGNMENT)
> > +#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) % ALIGNMENT)
> 
> I can't see any reason to change unsigned type to signed one.

I just found out that the kernel has uintptr_t. I will change it to
that.

> >  	}
> >  
> >  	dev_info(dev,
> > -		 "Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
> > +		 "Xilinx EmacLite at 0x%08X mapped to 0x%08lX, irq=%d\n",
> >  		 (unsigned int __force)ndev->mem_start,
> > -		 (unsigned int __force)lp->base_addr, ndev->irq);
> > +		 (unsigned long __force)lp->base_addr, ndev->irq);
> 
> This is different case but I don't think address can be signed type here
> too.

So unsigned long.

   Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1
  2020-11-02  7:31     ` Radhey Shyam Pandey
@ 2020-11-03 23:28       ` Andrew Lunn
  2020-11-06 16:43         ` Radhey Shyam Pandey
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2020-11-03 23:28 UTC (permalink / raw)
  To: Radhey Shyam Pandey; +Cc: Michal Simek, Jakub Kicinski, netdev

> > >  /* BUFFER_ALIGN(adr) calculates the number of bytes to the next
> > > alignment. */ -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) %
> > > ALIGNMENT)
> > > +#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) % ALIGNMENT)
> > 
> > I can't see any reason to change unsigned type to signed one.

> Agree. Also, I think we can get rid of this custom BUFFER_ALIGN
> macro and simply calling skb_reserve(skb, NET_IP_ALIGN)
> will make the protocol header to be aligned on at 
> least a 4-byte boundary?

Hi Radhey

I'm just going to replace the long with a uintptr_t. That will fix the
warnings. I don't have this hardware, so don't want to risk anything
more invasive which i cannot test.

Please feel free to add a follow up patch replacing this with 
skb_reserve(skb, NET_IP_ALIGN).

	 Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1
  2020-11-03 23:28       ` Andrew Lunn
@ 2020-11-06 16:43         ` Radhey Shyam Pandey
  0 siblings, 0 replies; 11+ messages in thread
From: Radhey Shyam Pandey @ 2020-11-06 16:43 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Michal Simek, Jakub Kicinski, netdev

> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Wednesday, November 4, 2020 4:58 AM
> To: Radhey Shyam Pandey <radheys@xilinx.com>
> Cc: Michal Simek <michals@xilinx.com>; Jakub Kicinski <kuba@kernel.org>;
> netdev <netdev@vger.kernel.org>
> Subject: Re: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-
> to-int-cast warnings with W=1
> 
> > > >  /* BUFFER_ALIGN(adr) calculates the number of bytes to the next
> > > > alignment. */ -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr))
> %
> > > > ALIGNMENT)
> > > > +#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) %
> ALIGNMENT)
> > >
> > > I can't see any reason to change unsigned type to signed one.
> 
> > Agree. Also, I think we can get rid of this custom BUFFER_ALIGN
> > macro and simply calling skb_reserve(skb, NET_IP_ALIGN)
> > will make the protocol header to be aligned on at
> > least a 4-byte boundary?
> 
> Hi Radhey
> 
> I'm just going to replace the long with a uintptr_t. That will fix the
> warnings. I don't have this hardware, so don't want to risk anything
> more invasive which i cannot test.
> 
> Please feel free to add a follow up patch replacing this with
> skb_reserve(skb, NET_IP_ALIGN).

Ok, thanks. I will send out a patch to remove this buffer align macro.
> 
> 	 Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-11-06 16:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 17:47 [PATCH net-next 0/3] xilinx_emaclite W=1 fixes Andrew Lunn
2020-10-31 17:47 ` [PATCH net-next 1/3] drivers: net: xilinx_emaclite: Add missing parameter kerneldoc Andrew Lunn
2020-11-02  7:18   ` Michal Simek
2020-10-31 17:47 ` [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-to-int-cast warnings with W=1 Andrew Lunn
2020-11-02  7:20   ` Michal Simek
2020-11-02  7:31     ` Radhey Shyam Pandey
2020-11-03 23:28       ` Andrew Lunn
2020-11-06 16:43         ` Radhey Shyam Pandey
2020-11-02 13:51     ` Andrew Lunn
2020-10-31 17:47 ` [PATCH net-next 3/3] drivers: net: xilinx_emaclite: Add COMPILE_TEST support Andrew Lunn
2020-11-02  7:21   ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).