* [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups
@ 2006-07-09 17:53 Adrian Bunk
0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2006-07-09 17:53 UTC (permalink / raw)
To: linville; +Cc: netdev, linux-kernel
This patch contains the following possible cleanups:
- make needlessly global functions static
- #if 0 unused functions
Please review which of these functions do make sense and which do
conflict with pending patches.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/net/wireless/zd1211rw/zd_chip.c | 32 ++++++++++++++++++++----
drivers/net/wireless/zd1211rw/zd_chip.h | 30 ++++------------------
drivers/net/wireless/zd1211rw/zd_mac.c | 4 +--
drivers/net/wireless/zd1211rw/zd_mac.h | 6 ----
drivers/net/wireless/zd1211rw/zd_usb.c | 4 +--
drivers/net/wireless/zd1211rw/zd_util.c | 4 +--
drivers/net/wireless/zd1211rw/zd_util.h | 6 ----
7 files changed, 39 insertions(+), 47 deletions(-)
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.h.old 2006-07-09 16:51:01.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.h 2006-07-09 19:01:05.000000000 +0200
@@ -690,15 +690,6 @@
return zd_usb_ioread16(&chip->usb, value, addr);
}
-int zd_ioread32v_locked(struct zd_chip *chip, u32 *values,
- const zd_addr_t *addresses, unsigned int count);
-
-static inline int zd_ioread32_locked(struct zd_chip *chip, u32 *value,
- const zd_addr_t addr)
-{
- return zd_ioread32v_locked(chip, value, (const zd_addr_t *)&addr, 1);
-}
-
static inline int zd_iowrite16_locked(struct zd_chip *chip, u16 value,
zd_addr_t addr)
{
@@ -728,9 +719,6 @@
return _zd_iowrite32v_locked(chip, &ioreq, 1);
}
-int zd_iowrite32a_locked(struct zd_chip *chip,
- const struct zd_ioreq32 *ioreqs, unsigned int count);
-
static inline int zd_rfwrite_locked(struct zd_chip *chip, u32 value, u8 bits)
{
ZD_ASSERT(mutex_is_locked(&chip->mutex));
@@ -743,12 +731,7 @@
/* Locking functions for reading and writing registers.
* The different parameters are intentional.
*/
-int zd_ioread16(struct zd_chip *chip, zd_addr_t addr, u16 *value);
-int zd_iowrite16(struct zd_chip *chip, zd_addr_t addr, u16 value);
-int zd_ioread32(struct zd_chip *chip, zd_addr_t addr, u32 *value);
int zd_iowrite32(struct zd_chip *chip, zd_addr_t addr, u32 value);
-int zd_ioread32v(struct zd_chip *chip, const zd_addr_t *addresses,
- u32 *values, unsigned int count);
int zd_iowrite32a(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
unsigned int count);
@@ -760,7 +743,6 @@
u8 zd_chip_get_channel(struct zd_chip *chip);
int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain);
void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr);
-int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr);
int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr);
int zd_chip_switch_radio_on(struct zd_chip *chip);
int zd_chip_switch_radio_off(struct zd_chip *chip);
@@ -771,20 +753,24 @@
int zd_chip_enable_hwint(struct zd_chip *chip);
int zd_chip_disable_hwint(struct zd_chip *chip);
+#if 0
static inline int zd_get_encryption_type(struct zd_chip *chip, u32 *type)
{
return zd_ioread32(chip, CR_ENCRYPTION_TYPE, type);
}
+#endif /* 0 */
static inline int zd_set_encryption_type(struct zd_chip *chip, u32 type)
{
return zd_iowrite32(chip, CR_ENCRYPTION_TYPE, type);
}
+#if 0
static inline int zd_chip_get_basic_rates(struct zd_chip *chip, u16 *cr_rates)
{
return zd_ioread16(chip, CR_BASIC_RATE_TBL, cr_rates);
}
+#endif /* 0 */
int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates);
@@ -803,16 +789,12 @@
LED_STATUS = 3,
};
-int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status);
-int zd_chip_led_flip(struct zd_chip *chip, int led,
- const unsigned int *phases_msecs, unsigned int count);
-
-int zd_set_beacon_interval(struct zd_chip *chip, u32 interval);
-
+#if 0
static inline int zd_get_beacon_interval(struct zd_chip *chip, u32 *interval)
{
return zd_ioread32(chip, CR_BCN_INTERVAL, interval);
}
+#endif /* 0 */
struct rx_status;
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.c.old 2006-07-09 16:51:15.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.c 2006-07-09 19:05:19.000000000 +0200
@@ -87,8 +87,8 @@
/* Read a variable number of 32-bit values. Parameter count is not allowed to
* exceed USB_MAX_IOREAD32_COUNT.
*/
-int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr,
- unsigned int count)
+static int zd_ioread32v_locked(struct zd_chip *chip, u32 *values,
+ const zd_addr_t *addr, unsigned int count)
{
int r;
int i;
@@ -135,6 +135,12 @@
return r;
}
+static int zd_ioread32_locked(struct zd_chip *chip, u32 *value,
+ const zd_addr_t addr)
+{
+ return zd_ioread32v_locked(chip, value, (const zd_addr_t *)&addr, 1);
+}
+
int _zd_iowrite32v_locked(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
unsigned int count)
{
@@ -215,8 +221,9 @@
* that in several USB requests. A split can be forced by inserting an IO
* request with an zero address field.
*/
-int zd_iowrite32a_locked(struct zd_chip *chip,
- const struct zd_ioreq32 *ioreqs, unsigned int count)
+static int zd_iowrite32a_locked(struct zd_chip *chip,
+ const struct zd_ioreq32 *ioreqs,
+ unsigned int count)
{
int r;
unsigned int i, j, t, max;
@@ -245,6 +252,8 @@
return 0;
}
+#if 0
+
int zd_ioread16(struct zd_chip *chip, zd_addr_t addr, u16 *value)
{
int r;
@@ -278,6 +287,8 @@
return r;
}
+#endif /* 0 */
+
int zd_iowrite32(struct zd_chip *chip, zd_addr_t addr, u32 value)
{
int r;
@@ -289,6 +300,7 @@
return r;
}
+#if 0
int zd_ioread32v(struct zd_chip *chip, const zd_addr_t *addresses,
u32 *values, unsigned int count)
{
@@ -300,6 +312,7 @@
mutex_unlock(&chip->mutex);
return r;
}
+#endif /* 0 */
int zd_iowrite32a(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
unsigned int count)
@@ -394,6 +407,7 @@
return _read_mac_addr(chip, mac_addr, (const zd_addr_t *)addr);
}
+#if 0
int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
{
int r;
@@ -404,6 +418,7 @@
mutex_unlock(&chip->mutex);
return r;
}
+#endif /* 0 */
int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
{
@@ -947,6 +962,7 @@
return set_aw_pt_bi(chip, &s);
}
+#if 0
int zd_set_beacon_interval(struct zd_chip *chip, u32 interval)
{
int r;
@@ -956,6 +972,7 @@
mutex_unlock(&chip->mutex);
return r;
}
+#endif /* 0 */
static int hw_init(struct zd_chip *chip)
{
@@ -1290,6 +1307,8 @@
return channel;
}
+#if 0
+
static u16 led_mask(int led)
{
switch (led) {
@@ -1314,7 +1333,8 @@
return zd_iowrite16_locked(chip, status, CR_LED);
}
-int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status)
+static int zd_chip_led_status(struct zd_chip *chip, int led,
+ enum led_status status)
{
int r, ret;
u16 mask = led_mask(led);
@@ -1376,6 +1396,8 @@
return r;
}
+#endif /* 0 */
+
int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates)
{
int r;
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.h.old 2006-07-09 17:01:36.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.h 2006-07-09 17:01:45.000000000 +0200
@@ -181,10 +181,4 @@
struct iw_statistics *zd_mac_get_wireless_stats(struct net_device *ndev);
-#ifdef DEBUG
-void zd_dump_rx_status(const struct rx_status *status);
-#else
-#define zd_dump_rx_status(status)
-#endif /* DEBUG */
-
#endif /* _ZD_MAC_H */
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.c.old 2006-07-09 17:01:52.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.c 2006-07-09 17:02:21.000000000 +0200
@@ -996,7 +996,7 @@
return iw_stats;
}
-#ifdef DEBUG
+#if 0
static const char* decryption_types[] = {
[ZD_RX_NO_WEP] = "none",
[ZD_RX_WEP64] = "WEP64",
@@ -1054,4 +1054,4 @@
"crc16" : "");
}
}
-#endif /* DEBUG */
+#endif /* 0 */
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_usb.c.old 2006-07-09 17:03:20.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_usb.c 2006-07-09 17:03:32.000000000 +0200
@@ -625,7 +625,7 @@
usb_submit_urb(urb, GFP_ATOMIC);
}
-struct urb *alloc_urb(struct zd_usb *usb)
+static struct urb *alloc_urb(struct zd_usb *usb)
{
struct usb_device *udev = zd_usb_to_usbdev(usb);
struct urb *urb;
@@ -649,7 +649,7 @@
return urb;
}
-void free_urb(struct urb *urb)
+static void free_urb(struct urb *urb)
{
if (!urb)
return;
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.h.old 2006-07-09 17:03:50.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.h 2006-07-09 17:04:15.000000000 +0200
@@ -20,10 +20,4 @@
void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size);
-#ifdef DEBUG
-void zd_hexdump(const void *bytes, size_t size);
-#else
-#define zd_hexdump(bytes, size)
-#endif /* DEBUG */
-
#endif /* _ZD_UTIL_H */
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.c.old 2006-07-09 17:04:19.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.c 2006-07-09 17:04:36.000000000 +0200
@@ -20,7 +20,7 @@
#include "zd_def.h"
#include "zd_util.h"
-#ifdef DEBUG
+#if 0
static char hex(u8 v)
{
v &= 0xf;
@@ -72,7 +72,7 @@
i += 8;
} while (i < size);
}
-#endif /* DEBUG */
+#endif /* 0 */
void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size)
{
^ permalink raw reply [flat|nested] 5+ messages in thread
* [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups
@ 2006-07-15 0:35 Adrian Bunk
2006-07-16 13:17 ` Daniel Drake
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2006-07-15 0:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: linville, netdev, linux-kernel
This patch contains the following possible cleanups:
- make needlessly global functions static
- #if 0 unused functions
Please review which of these functions do make sense and which do
conflict with pending patches.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 9 Jul 2006
drivers/net/wireless/zd1211rw/zd_chip.c | 32 ++++++++++++++++++++----
drivers/net/wireless/zd1211rw/zd_chip.h | 30 ++++------------------
drivers/net/wireless/zd1211rw/zd_mac.c | 4 +--
drivers/net/wireless/zd1211rw/zd_mac.h | 6 ----
drivers/net/wireless/zd1211rw/zd_usb.c | 4 +--
drivers/net/wireless/zd1211rw/zd_util.c | 4 +--
drivers/net/wireless/zd1211rw/zd_util.h | 6 ----
7 files changed, 39 insertions(+), 47 deletions(-)
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.h.old 2006-07-09 16:51:01.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.h 2006-07-09 19:01:05.000000000 +0200
@@ -690,15 +690,6 @@
return zd_usb_ioread16(&chip->usb, value, addr);
}
-int zd_ioread32v_locked(struct zd_chip *chip, u32 *values,
- const zd_addr_t *addresses, unsigned int count);
-
-static inline int zd_ioread32_locked(struct zd_chip *chip, u32 *value,
- const zd_addr_t addr)
-{
- return zd_ioread32v_locked(chip, value, (const zd_addr_t *)&addr, 1);
-}
-
static inline int zd_iowrite16_locked(struct zd_chip *chip, u16 value,
zd_addr_t addr)
{
@@ -728,9 +719,6 @@
return _zd_iowrite32v_locked(chip, &ioreq, 1);
}
-int zd_iowrite32a_locked(struct zd_chip *chip,
- const struct zd_ioreq32 *ioreqs, unsigned int count);
-
static inline int zd_rfwrite_locked(struct zd_chip *chip, u32 value, u8 bits)
{
ZD_ASSERT(mutex_is_locked(&chip->mutex));
@@ -743,12 +731,7 @@
/* Locking functions for reading and writing registers.
* The different parameters are intentional.
*/
-int zd_ioread16(struct zd_chip *chip, zd_addr_t addr, u16 *value);
-int zd_iowrite16(struct zd_chip *chip, zd_addr_t addr, u16 value);
-int zd_ioread32(struct zd_chip *chip, zd_addr_t addr, u32 *value);
int zd_iowrite32(struct zd_chip *chip, zd_addr_t addr, u32 value);
-int zd_ioread32v(struct zd_chip *chip, const zd_addr_t *addresses,
- u32 *values, unsigned int count);
int zd_iowrite32a(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
unsigned int count);
@@ -760,7 +743,6 @@
u8 zd_chip_get_channel(struct zd_chip *chip);
int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain);
void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr);
-int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr);
int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr);
int zd_chip_switch_radio_on(struct zd_chip *chip);
int zd_chip_switch_radio_off(struct zd_chip *chip);
@@ -771,20 +753,24 @@
int zd_chip_enable_hwint(struct zd_chip *chip);
int zd_chip_disable_hwint(struct zd_chip *chip);
+#if 0
static inline int zd_get_encryption_type(struct zd_chip *chip, u32 *type)
{
return zd_ioread32(chip, CR_ENCRYPTION_TYPE, type);
}
+#endif /* 0 */
static inline int zd_set_encryption_type(struct zd_chip *chip, u32 type)
{
return zd_iowrite32(chip, CR_ENCRYPTION_TYPE, type);
}
+#if 0
static inline int zd_chip_get_basic_rates(struct zd_chip *chip, u16 *cr_rates)
{
return zd_ioread16(chip, CR_BASIC_RATE_TBL, cr_rates);
}
+#endif /* 0 */
int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates);
@@ -803,16 +789,12 @@
LED_STATUS = 3,
};
-int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status);
-int zd_chip_led_flip(struct zd_chip *chip, int led,
- const unsigned int *phases_msecs, unsigned int count);
-
-int zd_set_beacon_interval(struct zd_chip *chip, u32 interval);
-
+#if 0
static inline int zd_get_beacon_interval(struct zd_chip *chip, u32 *interval)
{
return zd_ioread32(chip, CR_BCN_INTERVAL, interval);
}
+#endif /* 0 */
struct rx_status;
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.c.old 2006-07-09 16:51:15.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_chip.c 2006-07-09 19:05:19.000000000 +0200
@@ -87,8 +87,8 @@
/* Read a variable number of 32-bit values. Parameter count is not allowed to
* exceed USB_MAX_IOREAD32_COUNT.
*/
-int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr,
- unsigned int count)
+static int zd_ioread32v_locked(struct zd_chip *chip, u32 *values,
+ const zd_addr_t *addr, unsigned int count)
{
int r;
int i;
@@ -135,6 +135,12 @@
return r;
}
+static int zd_ioread32_locked(struct zd_chip *chip, u32 *value,
+ const zd_addr_t addr)
+{
+ return zd_ioread32v_locked(chip, value, (const zd_addr_t *)&addr, 1);
+}
+
int _zd_iowrite32v_locked(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
unsigned int count)
{
@@ -215,8 +221,9 @@
* that in several USB requests. A split can be forced by inserting an IO
* request with an zero address field.
*/
-int zd_iowrite32a_locked(struct zd_chip *chip,
- const struct zd_ioreq32 *ioreqs, unsigned int count)
+static int zd_iowrite32a_locked(struct zd_chip *chip,
+ const struct zd_ioreq32 *ioreqs,
+ unsigned int count)
{
int r;
unsigned int i, j, t, max;
@@ -245,6 +252,8 @@
return 0;
}
+#if 0
+
int zd_ioread16(struct zd_chip *chip, zd_addr_t addr, u16 *value)
{
int r;
@@ -278,6 +287,8 @@
return r;
}
+#endif /* 0 */
+
int zd_iowrite32(struct zd_chip *chip, zd_addr_t addr, u32 value)
{
int r;
@@ -289,6 +300,7 @@
return r;
}
+#if 0
int zd_ioread32v(struct zd_chip *chip, const zd_addr_t *addresses,
u32 *values, unsigned int count)
{
@@ -300,6 +312,7 @@
mutex_unlock(&chip->mutex);
return r;
}
+#endif /* 0 */
int zd_iowrite32a(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
unsigned int count)
@@ -394,6 +407,7 @@
return _read_mac_addr(chip, mac_addr, (const zd_addr_t *)addr);
}
+#if 0
int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
{
int r;
@@ -404,6 +418,7 @@
mutex_unlock(&chip->mutex);
return r;
}
+#endif /* 0 */
int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
{
@@ -947,6 +962,7 @@
return set_aw_pt_bi(chip, &s);
}
+#if 0
int zd_set_beacon_interval(struct zd_chip *chip, u32 interval)
{
int r;
@@ -956,6 +972,7 @@
mutex_unlock(&chip->mutex);
return r;
}
+#endif /* 0 */
static int hw_init(struct zd_chip *chip)
{
@@ -1290,6 +1307,8 @@
return channel;
}
+#if 0
+
static u16 led_mask(int led)
{
switch (led) {
@@ -1314,7 +1333,8 @@
return zd_iowrite16_locked(chip, status, CR_LED);
}
-int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status)
+static int zd_chip_led_status(struct zd_chip *chip, int led,
+ enum led_status status)
{
int r, ret;
u16 mask = led_mask(led);
@@ -1376,6 +1396,8 @@
return r;
}
+#endif /* 0 */
+
int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates)
{
int r;
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.h.old 2006-07-09 17:01:36.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.h 2006-07-09 17:01:45.000000000 +0200
@@ -181,10 +181,4 @@
struct iw_statistics *zd_mac_get_wireless_stats(struct net_device *ndev);
-#ifdef DEBUG
-void zd_dump_rx_status(const struct rx_status *status);
-#else
-#define zd_dump_rx_status(status)
-#endif /* DEBUG */
-
#endif /* _ZD_MAC_H */
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.c.old 2006-07-09 17:01:52.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_mac.c 2006-07-09 17:02:21.000000000 +0200
@@ -996,7 +996,7 @@
return iw_stats;
}
-#ifdef DEBUG
+#if 0
static const char* decryption_types[] = {
[ZD_RX_NO_WEP] = "none",
[ZD_RX_WEP64] = "WEP64",
@@ -1054,4 +1054,4 @@
"crc16" : "");
}
}
-#endif /* DEBUG */
+#endif /* 0 */
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_usb.c.old 2006-07-09 17:03:20.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_usb.c 2006-07-09 17:03:32.000000000 +0200
@@ -625,7 +625,7 @@
usb_submit_urb(urb, GFP_ATOMIC);
}
-struct urb *alloc_urb(struct zd_usb *usb)
+static struct urb *alloc_urb(struct zd_usb *usb)
{
struct usb_device *udev = zd_usb_to_usbdev(usb);
struct urb *urb;
@@ -649,7 +649,7 @@
return urb;
}
-void free_urb(struct urb *urb)
+static void free_urb(struct urb *urb)
{
if (!urb)
return;
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.h.old 2006-07-09 17:03:50.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.h 2006-07-09 17:04:15.000000000 +0200
@@ -20,10 +20,4 @@
void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size);
-#ifdef DEBUG
-void zd_hexdump(const void *bytes, size_t size);
-#else
-#define zd_hexdump(bytes, size)
-#endif /* DEBUG */
-
#endif /* _ZD_UTIL_H */
--- linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.c.old 2006-07-09 17:04:19.000000000 +0200
+++ linux-2.6.18-rc1-mm1-full/drivers/net/wireless/zd1211rw/zd_util.c 2006-07-09 17:04:36.000000000 +0200
@@ -20,7 +20,7 @@
#include "zd_def.h"
#include "zd_util.h"
-#ifdef DEBUG
+#if 0
static char hex(u8 v)
{
v &= 0xf;
@@ -72,7 +72,7 @@
i += 8;
} while (i < size);
}
-#endif /* DEBUG */
+#endif /* 0 */
void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size)
{
k
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups
2006-07-15 0:35 [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups Adrian Bunk
@ 2006-07-16 13:17 ` Daniel Drake
2006-07-17 21:29 ` Ulrich Kunitz
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Drake @ 2006-07-16 13:17 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Andrew Morton, linville, netdev, linux-kernel
Adrian Bunk wrote:
> This patch contains the following possible cleanups:
> - make needlessly global functions static
> - #if 0 unused functions
>
> Please review which of these functions do make sense and which do
> conflict with pending patches.
Thanks Adrian. I have put this in my tree and made an additional change
along the same lines (your patched introduced an unused function warning
to the non-debug build). If Ulrich signifies acceptance, I will send
this on to John.
I have also sent in a patch to add a MAINTAINERS entry for zd1211rw, in
hope that this will help you send patches with myself and/or Ulrich CC'd
in future :)
Thanks.
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups
2006-07-16 13:17 ` Daniel Drake
@ 2006-07-17 21:29 ` Ulrich Kunitz
2006-07-19 15:16 ` Adrian Bunk
0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Kunitz @ 2006-07-17 21:29 UTC (permalink / raw)
To: Daniel Drake; +Cc: Adrian Bunk, Andrew Morton, linville, netdev, linux-kernel
On 06-07-16 14:17 Daniel Drake wrote:
> Adrian Bunk wrote:
> >This patch contains the following possible cleanups:
> >- make needlessly global functions static
> >- #if 0 unused functions
> >
> >Please review which of these functions do make sense and which do
> >conflict with pending patches.
>
> Thanks Adrian. I have put this in my tree and made an additional change
> along the same lines (your patched introduced an unused function warning
> to the non-debug build). If Ulrich signifies acceptance, I will send
> this on to John.
>
> I have also sent in a patch to add a MAINTAINERS entry for zd1211rw, in
> hope that this will help you send patches with myself and/or Ulrich CC'd
> in future :)
>
> Thanks.
> Daniel
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Adrian, I would like to see this patch split up into three at
least.
Patch 1: Remove unused IO emulation functions
Patch 2: Remove other unused stuff, which could be split up
further for each C file and header
Patch 3: Change DEBUG ifdefs to #if 0
The purpose of patch 3 is bogus, because the follow-up patch will
be called "removed useless #if 0 stuff". Keep in mind there is
some reason, why I have such code there. If they ifdefs are not
acceptable I will make this code dependent on a module parameter
and compile it into the production module. We have a lot of
different devices from different vendors out there and people
report "stuff isn't working" but almost nothing more.
The problem with patch 1 and 2 is, that almost all of the function
are completing the interface and some of them are even only static
inlines. They are there because they should be used, before
somebody reinvents the wheel or makes something completely stupid.
However if such reasoning is not acceptable I'm ready to
compromise.
--
Uli Kunitz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups
2006-07-17 21:29 ` Ulrich Kunitz
@ 2006-07-19 15:16 ` Adrian Bunk
0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2006-07-19 15:16 UTC (permalink / raw)
To: Daniel Drake, Andrew Morton, linville, netdev, linux-kernel
On Mon, Jul 17, 2006 at 11:29:51PM +0200, Ulrich Kunitz wrote:
> On 06-07-16 14:17 Daniel Drake wrote:
>
> > Adrian Bunk wrote:
> > >This patch contains the following possible cleanups:
> > >- make needlessly global functions static
> > >- #if 0 unused functions
> > >
> > >Please review which of these functions do make sense and which do
> > >conflict with pending patches.
> >
> > Thanks Adrian. I have put this in my tree and made an additional change
> > along the same lines (your patched introduced an unused function warning
> > to the non-debug build). If Ulrich signifies acceptance, I will send
> > this on to John.
> >
> > I have also sent in a patch to add a MAINTAINERS entry for zd1211rw, in
> > hope that this will help you send patches with myself and/or Ulrich CC'd
> > in future :)
> >
> > Thanks.
> > Daniel
> > -
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> Adrian, I would like to see this patch split up into three at
> least.
>
> Patch 1: Remove unused IO emulation functions
> Patch 2: Remove other unused stuff, which could be split up
> further for each C file and header
> Patch 3: Change DEBUG ifdefs to #if 0
>
> The purpose of patch 3 is bogus, because the follow-up patch will
> be called "removed useless #if 0 stuff". Keep in mind there is
That's not the purpose.
#if 0'ed code is both marked as unused and does no longer bloat the
kernel.
> some reason, why I have such code there. If they ifdefs are not
> acceptable I will make this code dependent on a module parameter
> and compile it into the production module. We have a lot of
> different devices from different vendors out there and people
> report "stuff isn't working" but almost nothing more.
You are misunderstanding this part of my patch.
It does NOT remove used debug code.
It does #if 0 code that was not used with CONFIG_ZD1211RW_DEBUG=y.
> The problem with patch 1 and 2 is, that almost all of the function
> are completing the interface and some of them are even only static
> inlines. They are there because they should be used, before
> somebody reinvents the wheel or makes something completely stupid.
> However if such reasoning is not acceptable I'm ready to
> compromise.
I've only #if 0'ed "static inline" functions when they were the only
user of an otherwise unused global function.
The main question is what your "should be used" means.
Will they be used within the next days/weeks or only in some far future?
In the first case, I agree that my patch shouldn't be applied now.
In the latter case, there's no reason to bloat the kernel binary now for
some future usage that might or might not happen.
> Uli Kunitz
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-19 15:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-15 0:35 [2.6 patch] drivers/net/wireless/zd1211rw/: possible cleanups Adrian Bunk
2006-07-16 13:17 ` Daniel Drake
2006-07-17 21:29 ` Ulrich Kunitz
2006-07-19 15:16 ` Adrian Bunk
-- strict thread matches above, loose matches on Subject: below --
2006-07-09 17:53 Adrian Bunk
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).