* [PATCH] net/ehea: bitops work on unsigned longs
@ 2008-12-31 3:18 Stephen Rothwell
2008-12-31 5:51 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2008-12-31 3:18 UTC (permalink / raw)
To: David S. Miller
Cc: Klein, Thomas, Christoph, netdev, Jan-Bernd Themann, ppc-dev,
Raisch
These changes will avoid several warnings when we change u64 to unsigned
long long.
Also, ehea_driver_flags is only used in ehca_main.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/ehea/ehea.h | 3 +--
drivers/net/ehea/ehea_main.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 9930d5f..6271b94 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -478,7 +478,7 @@ struct ehea_port {
int num_add_tx_qps;
int num_mcs;
int resets;
- u64 flags;
+ unsigned long flags;
u64 mac_addr;
u32 logical_port_id;
u32 port_speed;
@@ -510,7 +510,6 @@ void ehea_set_ethtool_ops(struct net_device *netdev);
int ehea_sense_port_attr(struct ehea_port *port);
int ehea_set_portspeed(struct ehea_port *port, u32 port_speed);
-extern u64 ehea_driver_flags;
extern struct work_struct ehea_rereg_mr_task;
#endif /* __EHEA_H__ */
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index a2f1905..e3131ea 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -99,7 +99,7 @@ MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
static int port_name_cnt;
static LIST_HEAD(adapter_list);
-u64 ehea_driver_flags;
+static unsigned long ehea_driver_flags;
struct work_struct ehea_rereg_mr_task;
static DEFINE_MUTEX(dlpar_mem_lock);
struct ehea_fw_handle_array ehea_fw_handles;
--
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] 6+ messages in thread
* Re: [PATCH] net/ehea: bitops work on unsigned longs
2008-12-31 3:18 [PATCH] net/ehea: bitops work on unsigned longs Stephen Rothwell
@ 2008-12-31 5:51 ` David Miller
2008-12-31 9:02 ` Benjamin Herrenschmidt
2009-01-05 23:59 ` Stephen Rothwell
0 siblings, 2 replies; 6+ messages in thread
From: David Miller @ 2008-12-31 5:51 UTC (permalink / raw)
To: sfr; +Cc: tklein, netdev, raisch, themann, linuxppc-dev
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 31 Dec 2008 14:18:53 +1100
> These changes will avoid several warnings when we change u64 to unsigned
> long long.
>
> Also, ehea_driver_flags is only used in ehca_main.c
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
And also rejected, just like the previous two.
This is so much worse than the problems we had with
printing u64's and it's being done as a result to
the "fix" for that.
Please let's not do this...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ehea: bitops work on unsigned longs
2008-12-31 5:51 ` David Miller
@ 2008-12-31 9:02 ` Benjamin Herrenschmidt
2009-01-05 23:59 ` Stephen Rothwell
1 sibling, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2008-12-31 9:02 UTC (permalink / raw)
To: David Miller; +Cc: tklein, sfr, themann, netdev, linuxppc-dev, raisch
On Tue, 2008-12-30 at 21:51 -0800, David Miller wrote:
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 31 Dec 2008 14:18:53 +1100
>
> > These changes will avoid several warnings when we change u64 to unsigned
> > long long.
> >
> > Also, ehea_driver_flags is only used in ehca_main.c
> >
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
>
> And also rejected, just like the previous two.
>
> This is so much worse than the problems we had with
> printing u64's and it's being done as a result to
> the "fix" for that.
Hi David !
I think this patch specifically is different and deserve a second look.
While the other patches are somewhat debatable (I do agree with you for
example that we shouldn't break the possibility of building for 32-bit,
and we shouldn't artifically add crud to silence warnings caused by the
u64 type change etc... I'll send separate replies to the other messages
later), in the case of this specific patch, I think it's actually more
correct to define a "flags" field that is used by set_bit() and
test_bit() using "long" rather than "u64" (for that same reason you
mention, which is 32/64-bit compatibility).
IE. The bitops operate on longs. Thus the field should be a long,
period. The compatibility here consists of making sure we don't use bits
above 31, which in this case is find since we use a short enum.
Thus the patch is makes the code cleaner and more correct regardless of
the type change of u64.
So from my side, this patch is
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cheers,
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ehea: bitops work on unsigned longs
2008-12-31 5:51 ` David Miller
2008-12-31 9:02 ` Benjamin Herrenschmidt
@ 2009-01-05 23:59 ` Stephen Rothwell
2009-01-06 0:05 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2009-01-05 23:59 UTC (permalink / raw)
To: David Miller; +Cc: tklein, netdev, raisch, themann, linuxppc-dev
Hi Dave,
On Tue, 30 Dec 2008 21:51:56 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 31 Dec 2008 14:18:53 +1100
>
> > These changes will avoid several warnings when we change u64 to unsigned
> > long long.
> >
> > Also, ehea_driver_flags is only used in ehca_main.c
> >
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
>
> And also rejected, just like the previous two.
>
> This is so much worse than the problems we had with
> printing u64's and it's being done as a result to
> the "fix" for that.
How is this worse than anything? The only thing wrong with this patch is
the commit message ... Lets try this (if this doesn't address your
problems, then assume I am too dense for your original explanation):
---------------------------------------------------------------------------
net/ehea: bitops work on unsigned longs
The flags field of struct ehea_port is only used with test_bit(),
clear_bit() and set_bit() and these interfaces only work on
"unsigned long"s, so change the field to be an "unsigned long". Also,
this field only has two bits defined for it (0 and 1) so will still be
fine if someone builds this driver for a 32 bit arch (at least as far as
this flags field is concerned).
Also note that ehea_driver_flags is only used in ehca_main.c, so make it
static in there.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/ehea/ehea.h | 3 +--
drivers/net/ehea/ehea_main.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 9930d5f..6271b94 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -478,7 +478,7 @@ struct ehea_port {
int num_add_tx_qps;
int num_mcs;
int resets;
- u64 flags;
+ unsigned long flags;
u64 mac_addr;
u32 logical_port_id;
u32 port_speed;
@@ -510,7 +510,6 @@ void ehea_set_ethtool_ops(struct net_device *netdev);
int ehea_sense_port_attr(struct ehea_port *port);
int ehea_set_portspeed(struct ehea_port *port, u32 port_speed);
-extern u64 ehea_driver_flags;
extern struct work_struct ehea_rereg_mr_task;
#endif /* __EHEA_H__ */
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index a2f1905..e3131ea 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -99,7 +99,7 @@ MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
static int port_name_cnt;
static LIST_HEAD(adapter_list);
-u64 ehea_driver_flags;
+static unsigned long ehea_driver_flags;
struct work_struct ehea_rereg_mr_task;
static DEFINE_MUTEX(dlpar_mem_lock);
struct ehea_fw_handle_array ehea_fw_handles;
--
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] 6+ messages in thread
* Re: [PATCH] net/ehea: bitops work on unsigned longs
2009-01-05 23:59 ` Stephen Rothwell
@ 2009-01-06 0:05 ` David Miller
2009-01-06 0:11 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-01-06 0:05 UTC (permalink / raw)
To: sfr; +Cc: tklein, netdev, raisch, themann, linuxppc-dev
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 6 Jan 2009 10:59:51 +1100
> Hi Dave,
>
> On Tue, 30 Dec 2008 21:51:56 -0800 (PST) David Miller <davem@davemloft.net> wrote:
> >
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Wed, 31 Dec 2008 14:18:53 +1100
> >
> > > These changes will avoid several warnings when we change u64 to unsigned
> > > long long.
> > >
> > > Also, ehea_driver_flags is only used in ehca_main.c
> > >
> > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > ---
> >
> > And also rejected, just like the previous two.
> >
> > This is so much worse than the problems we had with
> > printing u64's and it's being done as a result to
> > the "fix" for that.
>
> How is this worse than anything? The only thing wrong with this patch is
> the commit message ... Lets try this (if this doesn't address your
> problems, then assume I am too dense for your original explanation):
Aha, yes the commit message fooled me :-) New patch is fine and
I'll toss this into net-2.6
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/ehea: bitops work on unsigned longs
2009-01-06 0:05 ` David Miller
@ 2009-01-06 0:11 ` Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2009-01-06 0:11 UTC (permalink / raw)
To: David Miller; +Cc: tklein, netdev, raisch, themann, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
Hi Dave,
On Mon, 05 Jan 2009 16:05:35 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>
> Aha, yes the commit message fooled me :-) New patch is fine and
> I'll toss this into net-2.6
I will try to do better in the future, thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-06 0:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31 3:18 [PATCH] net/ehea: bitops work on unsigned longs Stephen Rothwell
2008-12-31 5:51 ` David Miller
2008-12-31 9:02 ` Benjamin Herrenschmidt
2009-01-05 23:59 ` Stephen Rothwell
2009-01-06 0:05 ` David Miller
2009-01-06 0:11 ` Stephen Rothwell
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).