Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rt2x00: Remove check for rf word 0

The only way rf_write() can be called with word 0 is
when the user sends the wrong word index through debugfs.
However the values which are send through debugfs are
validated using the RF_BASE and RF_SIZE macro values,
the most logical solution is to increase RF_BASE with 4
and decrease RF_SIZE with 4 (RF_SIZE has always been
1 word too big)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Ivo van Doorn and committed by
John W. Linville
53bc647a 62750f42

+10 -25
-3
drivers/net/wireless/rt2x00/rt2400pci.c
··· 114 114 { 115 115 u32 reg; 116 116 117 - if (!word) 118 - return; 119 - 120 117 mutex_lock(&rt2x00dev->csr_mutex); 121 118 122 119 /*
+2 -2
drivers/net/wireless/rt2x00/rt2400pci.h
··· 48 48 #define EEPROM_SIZE 0x0100 49 49 #define BBP_BASE 0x0000 50 50 #define BBP_SIZE 0x0020 51 - #define RF_BASE 0x0000 52 - #define RF_SIZE 0x0010 51 + #define RF_BASE 0x0004 52 + #define RF_SIZE 0x000c 53 53 54 54 /* 55 55 * Number of TX queues.
-3
drivers/net/wireless/rt2x00/rt2500pci.c
··· 114 114 { 115 115 u32 reg; 116 116 117 - if (!word) 118 - return; 119 - 120 117 mutex_lock(&rt2x00dev->csr_mutex); 121 118 122 119 /*
+2 -2
drivers/net/wireless/rt2x00/rt2500pci.h
··· 59 59 #define EEPROM_SIZE 0x0200 60 60 #define BBP_BASE 0x0000 61 61 #define BBP_SIZE 0x0040 62 - #define RF_BASE 0x0000 63 - #define RF_SIZE 0x0014 62 + #define RF_BASE 0x0004 63 + #define RF_SIZE 0x0010 64 64 65 65 /* 66 66 * Number of TX queues.
-3
drivers/net/wireless/rt2x00/rt2500usb.c
··· 204 204 { 205 205 u16 reg; 206 206 207 - if (!word) 208 - return; 209 - 210 207 mutex_lock(&rt2x00dev->csr_mutex); 211 208 212 209 /*
+2 -2
drivers/net/wireless/rt2x00/rt2500usb.h
··· 59 59 #define EEPROM_SIZE 0x006a 60 60 #define BBP_BASE 0x0000 61 61 #define BBP_SIZE 0x0060 62 - #define RF_BASE 0x0000 63 - #define RF_SIZE 0x0014 62 + #define RF_BASE 0x0004 63 + #define RF_SIZE 0x0010 64 64 65 65 /* 66 66 * Number of TX queues.
-3
drivers/net/wireless/rt2x00/rt61pci.c
··· 123 123 { 124 124 u32 reg; 125 125 126 - if (!word) 127 - return; 128 - 129 126 mutex_lock(&rt2x00dev->csr_mutex); 130 127 131 128 /*
+2 -2
drivers/net/wireless/rt2x00/rt61pci.h
··· 50 50 #define EEPROM_SIZE 0x0100 51 51 #define BBP_BASE 0x0000 52 52 #define BBP_SIZE 0x0080 53 - #define RF_BASE 0x0000 54 - #define RF_SIZE 0x0014 53 + #define RF_BASE 0x0004 54 + #define RF_SIZE 0x0010 55 55 56 56 /* 57 57 * Number of TX queues.
-3
drivers/net/wireless/rt2x00/rt73usb.c
··· 122 122 { 123 123 u32 reg; 124 124 125 - if (!word) 126 - return; 127 - 128 125 mutex_lock(&rt2x00dev->csr_mutex); 129 126 130 127 /*
+2 -2
drivers/net/wireless/rt2x00/rt73usb.h
··· 50 50 #define EEPROM_SIZE 0x0100 51 51 #define BBP_BASE 0x0000 52 52 #define BBP_SIZE 0x0080 53 - #define RF_BASE 0x0000 54 - #define RF_SIZE 0x0014 53 + #define RF_BASE 0x0004 54 + #define RF_SIZE 0x0010 55 55 56 56 /* 57 57 * Number of TX queues.