linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ibmveth: use consistent types
@ 2008-12-31  3:02 Stephen Rothwell
  2008-12-31  5:49 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stephen Rothwell @ 2008-12-31  3:02 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, ppc-dev

These variables are only used with an interface involving "unsigned
long" and the macros are only used with these variables.  This change
will prevent some warnings when we change u64 to "unsigned long long".

This code is only built for 64bit powerpc, so the transformation is
really a noop.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/net/ibmveth.c |    4 ++--
 drivers/net/ibmveth.h |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 9bc0f17..ca3bb9f 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -754,7 +754,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
 				    void (*done) (struct net_device *, u32))
 {
 	struct ibmveth_adapter *adapter = netdev_priv(dev);
-	u64 set_attr, clr_attr, ret_attr;
+	unsigned long set_attr, clr_attr, ret_attr;
 	long ret;
 	int rc1 = 0, rc2 = 0;
 	int restart = 0;
@@ -1209,7 +1209,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 	long ret;
 	struct net_device *netdev;
 	struct ibmveth_adapter *adapter;
-	u64 set_attr, ret_attr;
+	unsigned long set_attr, ret_attr;
 
 	unsigned char *mac_addr_p;
 	unsigned int *mcastFilterSize_p;
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index d281869..ec76ace 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -39,11 +39,11 @@
 #define IbmVethMcastRemoveFilter     0x2UL
 #define IbmVethMcastClearFilterTable 0x3UL
 
-#define IBMVETH_ILLAN_PADDED_PKT_CSUM	0x0000000000002000ULL
-#define IBMVETH_ILLAN_TRUNK_PRI_MASK	0x0000000000000F00ULL
-#define IBMVETH_ILLAN_IPV6_TCP_CSUM		0x0000000000000004ULL
-#define IBMVETH_ILLAN_IPV4_TCP_CSUM		0x0000000000000002ULL
-#define IBMVETH_ILLAN_ACTIVE_TRUNK		0x0000000000000001ULL
+#define IBMVETH_ILLAN_PADDED_PKT_CSUM	0x0000000000002000UL
+#define IBMVETH_ILLAN_TRUNK_PRI_MASK	0x0000000000000F00UL
+#define IBMVETH_ILLAN_IPV6_TCP_CSUM		0x0000000000000004UL
+#define IBMVETH_ILLAN_IPV4_TCP_CSUM		0x0000000000000002UL
+#define IBMVETH_ILLAN_ACTIVE_TRUNK		0x0000000000000001UL
 
 /* hcall macros */
 #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
-- 
1.6.0.5

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

* Re: [PATCH] ibmveth: use consistent types
  2008-12-31  3:02 [PATCH] ibmveth: use consistent types Stephen Rothwell
@ 2008-12-31  5:49 ` David Miller
  2008-12-31  9:06 ` Benjamin Herrenschmidt
  2009-01-06  5:39 ` Stephen Rothwell
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-12-31  5:49 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linuxppc-dev

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 31 Dec 2008 14:02:25 +1100

> These variables are only used with an interface involving "unsigned
> long" and the macros are only used with these variables.  This change
> will prevent some warnings when we change u64 to "unsigned long long".
> 
> This code is only built for 64bit powerpc, so the transformation is
> really a noop.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

I'd prefer if the types were to remain 32-bit portable.

Doing things like this is just a problem waiting to happen,
either for the first person who actually finds a need and
a way to use this driver on 32-bit or the person who cut and
pastes this code into their driver which should work on both
32-bit and 64-bit.

Patch not applied.

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

* Re: [PATCH] ibmveth: use consistent types
  2008-12-31  3:02 [PATCH] ibmveth: use consistent types Stephen Rothwell
  2008-12-31  5:49 ` David Miller
@ 2008-12-31  9:06 ` Benjamin Herrenschmidt
  2009-01-06  5:39 ` Stephen Rothwell
  2 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-12-31  9:06 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: netdev, David S. Miller, ppc-dev

On Wed, 2008-12-31 at 14:02 +1100, Stephen Rothwell wrote:
> These variables are only used with an interface involving "unsigned
> long" and the macros are only used with these variables.  This change
> will prevent some warnings when we change u64 to "unsigned long long".
> 
> This code is only built for 64bit powerpc, so the transformation is
> really a noop.

Actually, if you look at the code without the patch, the #define's are
using "ULL", which means that having the type as u64 is fine with the
change, as u64 is becoming an unsigned long long.

I don't know for sure thus what warning you are trying to fix, could you
paste it ? I suspect it's when passing those flags to a pHyp function
that takes a long, in which case, the proper fix would probably be to be
consistent the other way around, ie, make the pHyp interface take a
u64 :-)

Cheers,
Ben.

> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/net/ibmveth.c |    4 ++--
>  drivers/net/ibmveth.h |   10 +++++-----
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
> index 9bc0f17..ca3bb9f 100644
> --- a/drivers/net/ibmveth.c
> +++ b/drivers/net/ibmveth.c
> @@ -754,7 +754,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
>  				    void (*done) (struct net_device *, u32))
>  {
>  	struct ibmveth_adapter *adapter = netdev_priv(dev);
> -	u64 set_attr, clr_attr, ret_attr;
> +	unsigned long set_attr, clr_attr, ret_attr;
>  	long ret;
>  	int rc1 = 0, rc2 = 0;
>  	int restart = 0;
> @@ -1209,7 +1209,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
>  	long ret;
>  	struct net_device *netdev;
>  	struct ibmveth_adapter *adapter;
> -	u64 set_attr, ret_attr;
> +	unsigned long set_attr, ret_attr;
>  
>  	unsigned char *mac_addr_p;
>  	unsigned int *mcastFilterSize_p;
> diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
> index d281869..ec76ace 100644
> --- a/drivers/net/ibmveth.h
> +++ b/drivers/net/ibmveth.h
> @@ -39,11 +39,11 @@
>  #define IbmVethMcastRemoveFilter     0x2UL
>  #define IbmVethMcastClearFilterTable 0x3UL
>  
> -#define IBMVETH_ILLAN_PADDED_PKT_CSUM	0x0000000000002000ULL
> -#define IBMVETH_ILLAN_TRUNK_PRI_MASK	0x0000000000000F00ULL
> -#define IBMVETH_ILLAN_IPV6_TCP_CSUM		0x0000000000000004ULL
> -#define IBMVETH_ILLAN_IPV4_TCP_CSUM		0x0000000000000002ULL
> -#define IBMVETH_ILLAN_ACTIVE_TRUNK		0x0000000000000001ULL
> +#define IBMVETH_ILLAN_PADDED_PKT_CSUM	0x0000000000002000UL
> +#define IBMVETH_ILLAN_TRUNK_PRI_MASK	0x0000000000000F00UL
> +#define IBMVETH_ILLAN_IPV6_TCP_CSUM		0x0000000000000004UL
> +#define IBMVETH_ILLAN_IPV4_TCP_CSUM		0x0000000000000002UL
> +#define IBMVETH_ILLAN_ACTIVE_TRUNK		0x0000000000000001UL
>  
>  /* hcall macros */
>  #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
> -- 
> 1.6.0.5
> 

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

* [PATCH] ibmveth: use consistent types
  2008-12-31  3:02 [PATCH] ibmveth: use consistent types Stephen Rothwell
  2008-12-31  5:49 ` David Miller
  2008-12-31  9:06 ` Benjamin Herrenschmidt
@ 2009-01-06  5:39 ` Stephen Rothwell
  2009-01-06 18:47   ` David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2009-01-06  5:39 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, ppc-dev

These variables are only used with an interface that just dumps their
values into registers to be passed to the hypervisor. The arguments
to that interface are declared to be "unsigned long", so make these
variables match.  The macros are only used with these variables, so make
them match as well.

This code is currently only built for 64bit powerpc, so the transformation
is really a noop.  If the interface was ever ported to 32 bit, it would
almost certainly still use registers to pass the parameters and so
"unsigned long" would still be appropriate.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/net/ibmveth.c |    4 ++--
 drivers/net/ibmveth.h |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 9bc0f17..ca3bb9f 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -754,7 +754,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
 				    void (*done) (struct net_device *, u32))
 {
 	struct ibmveth_adapter *adapter = netdev_priv(dev);
-	u64 set_attr, clr_attr, ret_attr;
+	unsigned long set_attr, clr_attr, ret_attr;
 	long ret;
 	int rc1 = 0, rc2 = 0;
 	int restart = 0;
@@ -1209,7 +1209,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 	long ret;
 	struct net_device *netdev;
 	struct ibmveth_adapter *adapter;
-	u64 set_attr, ret_attr;
+	unsigned long set_attr, ret_attr;
 
 	unsigned char *mac_addr_p;
 	unsigned int *mcastFilterSize_p;
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index d281869..ec76ace 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -39,11 +39,11 @@
 #define IbmVethMcastRemoveFilter     0x2UL
 #define IbmVethMcastClearFilterTable 0x3UL
 
-#define IBMVETH_ILLAN_PADDED_PKT_CSUM	0x0000000000002000ULL
-#define IBMVETH_ILLAN_TRUNK_PRI_MASK	0x0000000000000F00ULL
-#define IBMVETH_ILLAN_IPV6_TCP_CSUM		0x0000000000000004ULL
-#define IBMVETH_ILLAN_IPV4_TCP_CSUM		0x0000000000000002ULL
-#define IBMVETH_ILLAN_ACTIVE_TRUNK		0x0000000000000001ULL
+#define IBMVETH_ILLAN_PADDED_PKT_CSUM	0x0000000000002000UL
+#define IBMVETH_ILLAN_TRUNK_PRI_MASK	0x0000000000000F00UL
+#define IBMVETH_ILLAN_IPV6_TCP_CSUM		0x0000000000000004UL
+#define IBMVETH_ILLAN_IPV4_TCP_CSUM		0x0000000000000002UL
+#define IBMVETH_ILLAN_ACTIVE_TRUNK		0x0000000000000001UL
 
 /* hcall macros */
 #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
-- 
1.6.0.5

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

* Re: [PATCH] ibmveth: use consistent types
  2009-01-06  5:39 ` Stephen Rothwell
@ 2009-01-06 18:47   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-01-06 18:47 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linuxppc-dev

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 6 Jan 2009 16:39:08 +1100

> These variables are only used with an interface that just dumps their
> values into registers to be passed to the hypervisor. The arguments
> to that interface are declared to be "unsigned long", so make these
> variables match.  The macros are only used with these variables, so make
> them match as well.
> 
> This code is currently only built for 64bit powerpc, so the transformation
> is really a noop.  If the interface was ever ported to 32 bit, it would
> almost certainly still use registers to pass the parameters and so
> "unsigned long" would still be appropriate.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Also applied, thanks Stephen.

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

end of thread, other threads:[~2009-01-06 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31  3:02 [PATCH] ibmveth: use consistent types Stephen Rothwell
2008-12-31  5:49 ` David Miller
2008-12-31  9:06 ` Benjamin Herrenschmidt
2009-01-06  5:39 ` Stephen Rothwell
2009-01-06 18:47   ` David Miller

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).