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

staging/rtl8187se: Remove temporary variable for return value

The simple PlatformIORead1Byte function doesn't need to store its return
value in a temporary variable; rather simply return the value directly.

By moving the function to the top we can also get rid of the forward
declaration.

The wrapper functions could be easily replaced by direct calls to
read_nic_byte but is kept for readability.

Since this functions is local only we can mark it as static.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peter Huewe and committed by
Greg Kroah-Hartman
aa341b6a 2c370d95

+5 -12
+5 -12
drivers/staging/rtl8187se/r8185b_init.c
··· 115 115 *--------------------------------------------------------------- 116 116 */ 117 117 118 + static u8 PlatformIORead1Byte(struct net_device *dev, u32 offset) 119 + { 120 + return read_nic_byte(dev, offset); 121 + } 122 + 118 123 void PlatformIOWrite1Byte(struct net_device *dev, u32 offset, u8 data) 119 124 { 120 125 write_nic_byte(dev, offset, data); ··· 131 126 write_nic_word(dev, offset, data); 132 127 read_nic_word(dev, offset); /* To make sure write operation is completed, 2005.11.09, by rcnjko. */ 133 128 } 134 - 135 - u8 PlatformIORead1Byte(struct net_device *dev, u32 offset); 136 129 137 130 void PlatformIOWrite4Byte(struct net_device *dev, u32 offset, u32 data) 138 131 { ··· 173 170 write_nic_dword(dev, offset, data); 174 171 read_nic_dword(dev, offset); /* To make sure write operation is completed, 2005.11.09, by rcnjko. */ 175 172 } 176 - } 177 - 178 - u8 PlatformIORead1Byte(struct net_device *dev, u32 offset) 179 - { 180 - u8 data = 0; 181 - 182 - data = read_nic_byte(dev, offset); 183 - 184 - 185 - return data; 186 173 } 187 174 188 175 u16 PlatformIORead2Byte(struct net_device *dev, u32 offset)