Search Linux Wireless

Re: [RFC v3 07/12] rtw88: phy files

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

 



On Wed, Oct 03, 2018 at 07:20:54PM +0800, yhchuang@xxxxxxxxxxx wrote:
> +void rtw_phy_cfg_bb(struct rtw_dev *rtwdev, const struct rtw_table *tbl,
> +		    u32 addr, u32 data)
> +{
> +	if (addr == 0xfe)
> +		msleep(50);
> +	else if (addr == 0xfd)
> +		mdelay(5);
> +	else if (addr == 0xfc)
> +		mdelay(1);
> +	else if (addr == 0xfb)
> +		usleep_range(50, 60);
> +	else if (addr == 0xfa)
> +		udelay(5);
> +	else if (addr == 0xf9)
> +		udelay(1);
> +	else
> +		rtw_write32(rtwdev, addr, data);

This mix of mdelay(), msleep(), udelay() and usleep_range() looks strange.
You should eigher use atomic versions *delay or non-atomic *sleep
versions .

> +#define bcd_to_dec_pwr_by_rate(val, i) \
> +	({ \
> +		typeof(val) __val_ = val; \
> +		typeof(i) __i_ = i; \
> +		((s8)((((__val_ >> (__i_ * 8 + 4)) & 0xF)) * 10 + \
> +		       ((__val_ >> (__i_ * 8)) & 0xF))); \
> +	 })

Can use bcd2bin from include/linux/bcd.h instead ?


Thanks
Stanislaw 



[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