Search Linux Wireless

Re: [RFC 2/7] net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021-07-13 20:31, Andrew Lunn wrote:
>> diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
>> +
>> +static inline void
>> +wed_m32(struct mtk_wed_device *dev, u32 reg, u32 mask, u32 val)
>> +{
>> +	regmap_update_bits(dev->hw->regs, reg, mask | val, val);
>> +}
> 
> Please don't use inline functions in .c files. Let the compiler
> decide.
Will drop inline

>> +static void
>> +mtk_wed_reset(struct mtk_wed_device *dev, u32 mask)
>> +{
>> +	int i;
>> +
>> +	wed_w32(dev, MTK_WED_RESET, mask);
>> +	for (i = 0; i < 100; i++) {
>> +		if (wed_r32(dev, MTK_WED_RESET) & mask)
>> +			continue;
>> +
>> +		return;
>> +	}
> 
> It may be better to use something from iopoll.h
Will do

>> +static inline int
>> +mtk_wed_device_attach(struct mtk_wed_device *dev)
>> +{
>> +	int ret = -ENODEV;
>> +
>> +#ifdef CONFIG_NET_MEDIATEK_SOC_WED
> 
> if (IS_ENABLED(CONFIG_NET_MEDIATEK_SOC_WED) is better, since it
> compiles the code, and then the optimizer throws away.
This one is intentional, since struct mtk_wed_device will be empty if
CONFIG_NET_MEDIATEK_SOC_WED is not set. The code would not compile
without the #ifdef.

Thanks,

- Felix



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux