mirror of https://gitee.com/openkylin/linux.git
rt2x00: convert rt2800_register_read return type
This is a semi-automated conversion to change rt2800_register_read to return the register contents instead of passing them by value, resulting in much better object code. The majority of the patch was done using: sed -i 's:\(rt2800_register_read(.*, .*\), &\(.*\));:\2 = \1);:' \ 's:\(rt2800_register_read_lock(.*, .*\), &\(.*\));:\2 = \1);:' \ drivers/net/wireless/ralink/rt2x00/rt2800lib.c The function itself was modified manually along with the one remaining multi-line caller that was not covered automatically and the indirect reference. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
48bde9c969
commit
eebd68e782
File diff suppressed because it is too large
Load Diff
|
@ -78,25 +78,7 @@ struct rt2800_ops {
|
|||
__le32 *(*drv_get_txwi)(struct queue_entry *entry);
|
||||
};
|
||||
|
||||
static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset,
|
||||
u32 *value)
|
||||
{
|
||||
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
|
||||
|
||||
*value = rt2800ops->register_read(rt2x00dev, offset);
|
||||
}
|
||||
|
||||
static inline void rt2800_register_read_lock(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset,
|
||||
u32 *value)
|
||||
{
|
||||
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
|
||||
|
||||
*value = rt2800ops->register_read_lock(rt2x00dev, offset);
|
||||
}
|
||||
|
||||
static inline u32 _rt2800_register_read(struct rt2x00_dev *rt2x00dev,
|
||||
static inline u32 rt2800_register_read(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset)
|
||||
{
|
||||
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
|
||||
|
@ -104,6 +86,14 @@ static inline u32 _rt2800_register_read(struct rt2x00_dev *rt2x00dev,
|
|||
return rt2800ops->register_read(rt2x00dev, offset);
|
||||
}
|
||||
|
||||
static inline u32 rt2800_register_read_lock(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset)
|
||||
{
|
||||
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
|
||||
|
||||
return rt2800ops->register_read_lock(rt2x00dev, offset);
|
||||
}
|
||||
|
||||
static inline void rt2800_register_write(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset,
|
||||
u32 value)
|
||||
|
|
Loading…
Reference in New Issue