[PATCH] sb1250-mac.c: De-typedef, de-volatile, de-etc...

Previous thread: ECC and DMA to/from disk controllers by Bruce Allen on Monday, September 10, 2007 - 8:19 am. (4 messages)

Next thread: [PATCH] input: Fix interrupt enable in i8042_ctr when enabling interrupt fails by Markus Armbruster on Monday, September 10, 2007 - 8:41 am. (3 messages)
To: Andrew Morton <akpm@...>, Jeff Garzik <jgarzik@...>
Cc: <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Monday, September 10, 2007 - 8:20 am

Remove typedefs, volatiles and convert kmalloc()/memset() pairs to
kcalloc(). Also reformat the surrounding clutter.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Per your request, Andrew, a while ago. It builds, runs, passes
checkpatch.pl and sparse. No semantic changes.

Please apply,

Maciej

patch-mips-2.6.23-rc5-20070904-sb1250-mac-typedef-7
diff -up --recursive --new-file linux-mips-2.6.23-rc5-20070904.macro/drivers/net/sb1250-mac.c linux-mips-2.6.23-rc5-20070904/drivers/net/sb1250-mac.c
--- linux-mips-2.6.23-rc5-20070904.macro/drivers/net/sb1250-mac.c 2007-07-10 04:57:46.000000000 +0000
+++ linux-mips-2.6.23-rc5-20070904/drivers/net/sb1250-mac.c 2007-09-10 01:01:09.000000000 +0000
@@ -140,17 +140,17 @@ MODULE_PARM_DESC(int_timeout_rx, "RX tim
********************************************************************* */

-typedef enum { sbmac_speed_auto, sbmac_speed_10,
- sbmac_speed_100, sbmac_speed_1000 } sbmac_speed_t;
+enum sbmac_speed { sbmac_speed_auto, sbmac_speed_10,
+ sbmac_speed_100, sbmac_speed_1000 };

-typedef enum { sbmac_duplex_auto, sbmac_duplex_half,
- sbmac_duplex_full } sbmac_duplex_t;
+enum sbmac_duplex { sbmac_duplex_auto, sbmac_duplex_half,
+ sbmac_duplex_full };

-typedef enum { sbmac_fc_auto, sbmac_fc_disabled, sbmac_fc_frame,
- sbmac_fc_collision, sbmac_fc_carrier } sbmac_fc_t;
+enum sbmac_fc { sbmac_fc_auto, sbmac_fc_disabled, sbmac_fc_frame,
+ sbmac_fc_collision, sbmac_fc_carrier } sbmac_fc_t;

-typedef enum { sbmac_state_uninit, sbmac_state_off, sbmac_state_on,
- sbmac_state_broken } sbmac_state_t;
+enum sbmac_state { sbmac_state_uninit, sbmac_state_off, sbmac_state_on,
+ sbmac_state_broken };

/**********************************************************************
@@ -176,55 +176,61 @@ typedef enum { sbmac_state_uninit, sbmac
* DMA Descriptor structure
********************************************************************* */

-typedef struct sbdmadscr...

To: Maciej W. Rozycki <macro@...>
Cc: Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Wednesday, September 12, 2007 - 11:58 pm

ACK, but patch does not apply cleanly to netdev-2.6.git#upstream (nor -mm)

-

To: Jeff Garzik <jgarzik@...>
Cc: Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 13, 2007 - 10:13 am

Hmm, works fine with linux-2.6.git#master. I do not recall any recent
activity with this driver -- I wonder what the difference is. Let me
see...

Maciej
-

To: Maciej W. Rozycki <macro@...>
Cc: Jeff Garzik <jgarzik@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 13, 2007 - 11:14 am

Hmm... HEAD du jour has no differences for the sb1250-mac between lmo
and kernel.org.

Ralf
-

To: Ralf Baechle <ralf@...>
Cc: Maciej W. Rozycki <macro@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 13, 2007 - 11:51 am

Net driver patches should apply on top of netdev-2.6.git#upstream, which
is where changes to net drivers are queued for the next release.

The closer we get to the merge window, the greater the diff between
netdev-2.6.git#upstream and linux-2.6.git#master, so
linux-2.6.git#master is not a useful comparison.

Jeff

-

To: Jeff Garzik <jgarzik@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Friday, September 14, 2007 - 6:48 am

Remove typedefs, volatiles and convert kmalloc()/memset() pairs to
kcalloc(). Also reformat the surrounding clutter.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---

I can see Andrew has done some changes to the patch and applied it
anyway, but here's a version I generated against your tree. Please feel
free to choose either.

You may be pleased (or less so) to hear that the version of sb1250-mac.c
in your tree does not even build (because of
42d53d6be113f974d8152979c88e1061b953bd12) and the patch below does not
address it. I ran out of time in the evening, but I will send you a fix
shortly. To be honest I think even with bulk changes it may be worth
checking whether they do not break stuff. ;-)

Maciej

patch-netdev-2.6.23-rc6-20070913-sb1250-mac-typedef-8
diff -up --recursive --new-file linux-netdev-2.6.23-rc6-20070913.macro/drivers/net/sb1250-mac.c linux-netdev-2.6.23-rc6-20070913/drivers/net/sb1250-mac.c
--- linux-netdev-2.6.23-rc6-20070913.macro/drivers/net/sb1250-mac.c 2007-09-13 17:27:52.000000000 +0000
+++ linux-netdev-2.6.23-rc6-20070913/drivers/net/sb1250-mac.c 2007-09-13 23:44:45.000000000 +0000
@@ -140,17 +140,17 @@ MODULE_PARM_DESC(int_timeout_rx, "RX tim
********************************************************************* */

-typedef enum { sbmac_speed_auto, sbmac_speed_10,
- sbmac_speed_100, sbmac_speed_1000 } sbmac_speed_t;
+enum sbmac_speed { sbmac_speed_auto, sbmac_speed_10,
+ sbmac_speed_100, sbmac_speed_1000 };

-typedef enum { sbmac_duplex_auto, sbmac_duplex_half,
- sbmac_duplex_full } sbmac_duplex_t;
+enum sbmac_duplex { sbmac_duplex_auto, sbmac_duplex_half,
+ sbmac_duplex_full };

-typedef enum { sbmac_fc_auto, sbmac_fc_disabled, sbmac_fc_frame,
- sbmac_fc_collision, sbmac_fc_carrier } sbmac_fc_t;
+enum sbmac_fc { sbmac_fc_auto, sbmac_fc_disabled, sbmac_fc_frame,
+ sbmac_fc_collision, sbmac_fc_carrier } sbmac_fc_t;

-typedef enum { sbmac_state_uninit, sbmac_state_off, sbmac_...

To: Maciej W. Rozycki <macro@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 20, 2007 - 12:10 am

hrm. I cannot get this to apply on top of linux-2.6.git,
netdev-2.6.git#upstream (prior to net-2.6.24 rebase) or
netdev-2.6.git#upstream (after net-2.6.24 rebase)

ACK the changes

-

To: Jeff Garzik <jgarzik@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 20, 2007 - 10:23 am

It applies on top of current -mm. It seems to apply to a copy of
netdev-2.6.git#upstream that I have got, but I am probably missing
something... If I try to clone your repository again I get:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/linux-netdev-2.6.git linux
Initialized empty Git repository in /home/macro/GIT-other/linux-netdev/linux/.git/
fatal: The remote end hung up unexpectedly
fetch-pack from 'git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/linux-netdev-2.6.git' failed.
$

For linux-2.6.git the patch-mips-2.6.23-rc5-20070904-sb1250-mac-typedef-7
version applies as submitted originally; I can resubmit this one if you
like.

I am slowly getting lost and I have another big chunk for sb1250-mac.c
waiting to be put on top of these...

Maciej
-

To: Maciej W. Rozycki <macro@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 20, 2007 - 1:01 pm

Remove the "linux-" prefix.

Jeff

-

To: Jeff Garzik <jgarzik@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 20, 2007 - 2:14 pm

Remove typedefs, volatiles and convert kmalloc()/memset() pairs to
kcalloc(). Also reformat the surrounding clutter.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---

Hmm, it looks like a bad application of `sed' by myself. Sorry for the
noise.

Maciej

patch-netdev-2.6.23-rc6-20070920-sb1250-mac-typedef-9
diff -up --recursive --new-file linux-netdev-2.6.23-rc6-20070920.macro/drivers/net/sb1250-mac.c linux-netdev-2.6.23-rc6-20070920/drivers/net/sb1250-mac.c
--- linux-netdev-2.6.23-rc6-20070920.macro/drivers/net/sb1250-mac.c 2007-09-20 17:55:14.000000000 +0000
+++ linux-netdev-2.6.23-rc6-20070920/drivers/net/sb1250-mac.c 2007-09-20 18:09:18.000000000 +0000
@@ -140,17 +140,17 @@ MODULE_PARM_DESC(int_timeout_rx, "RX tim
********************************************************************* */

-typedef enum { sbmac_speed_auto, sbmac_speed_10,
- sbmac_speed_100, sbmac_speed_1000 } sbmac_speed_t;
+enum sbmac_speed { sbmac_speed_auto, sbmac_speed_10,
+ sbmac_speed_100, sbmac_speed_1000 };

-typedef enum { sbmac_duplex_auto, sbmac_duplex_half,
- sbmac_duplex_full } sbmac_duplex_t;
+enum sbmac_duplex { sbmac_duplex_auto, sbmac_duplex_half,
+ sbmac_duplex_full };

-typedef enum { sbmac_fc_auto, sbmac_fc_disabled, sbmac_fc_frame,
- sbmac_fc_collision, sbmac_fc_carrier } sbmac_fc_t;
+enum sbmac_fc { sbmac_fc_auto, sbmac_fc_disabled, sbmac_fc_frame,
+ sbmac_fc_collision, sbmac_fc_carrier } sbmac_fc_t;

-typedef enum { sbmac_state_uninit, sbmac_state_off, sbmac_state_on,
- sbmac_state_broken } sbmac_state_t;
+enum sbmac_state { sbmac_state_uninit, sbmac_state_off, sbmac_state_on,
+ sbmac_state_broken };

/**********************************************************************
@@ -176,55 +176,61 @@ typedef enum { sbmac_state_uninit, sbmac
* DMA Descriptor structure
********************************************************************* */

-typedef struct sbdmadscr_s {
+struct sbdmadscr {
uint64_t ...

To: Maciej W. Rozycki <macro@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Saturday, September 29, 2007 - 1:14 am

applied

-

To: Maciej W. Rozycki <macro@...>
Cc: Andrew Morton <akpm@...>, Jeff Garzik <jgarzik@...>, <netdev@...>, <linux-mips@...>, <linux-kernel@...>
Date: Monday, September 10, 2007 - 12:58 pm

One step closer to sanity for this driver. So it's got my ACK.

Ralf
-

Previous thread: ECC and DMA to/from disk controllers by Bruce Allen on Monday, September 10, 2007 - 8:19 am. (4 messages)

Next thread: [PATCH] input: Fix interrupt enable in i8042_ctr when enabling interrupt fails by Markus Armbruster on Monday, September 10, 2007 - 8:41 am. (3 messages)