lkml.org 
[lkml]   [2020]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functions
On Fri, Mar 20, 2020 at 07:13:26PM +0100, Oscar Carter wrote:
> +#include <linux/bits.h>
> #include "mac.h"
> #include "baseband.h"
> #include "rf.h"
> @@ -468,7 +469,7 @@ int vnt_vt3184_init(struct vnt_private *priv)
> if (ret)
> goto end;
>
> - ret = vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, 0x01);
> + ret = vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, BIT(0));

Everyone knows 0x01 is bit(0) already. This isn't more clear. It
should be a define instead of a magic number.

> @@ -63,7 +64,8 @@ void vnt_set_channel(struct vnt_private *priv, u32 connection_channel)
> vnt_mac_reg_bits_on(priv, MAC_REG_MACCR, MACCR_CLRNAV);
>
> /* Set Channel[7] = 0 to tell H/W channel is changing now. */
> - vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL, 0xb0);
> + vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL,
> + (BIT(7) | BIT(5) | BIT(4)));

This one especially is just a lot longer now but still not clear.

regards,
dan carpenter

\
 
 \ /
  Last update: 2020-03-23 08:33    [W:0.570 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site