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:
Arnd Bergmann 2017-05-17 16:46:58 +02:00 committed by Kalle Valo
parent 48bde9c969
commit eebd68e782
2 changed files with 155 additions and 166 deletions

File diff suppressed because it is too large Load Diff

View File

@ -78,32 +78,22 @@ 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,
const unsigned int offset)
static inline u32 rt2800_register_read(struct rt2x00_dev *rt2x00dev,
const unsigned int offset)
{
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
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)