mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 15:07:13 -04:00
staging: vt6655: Use named constants when checking preamble type
Compare `preamble_type` to a predefined constant, `PREAMBLE_SHORT`, instead of a literal in `bb_get_frame_time` and `vnt_get_phy_field` functions. Thanks to this change, it is clear that we check the type of a preamble, not just compare it against an arbitrary value. Remove a redundant comment. Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com> Link: https://lore.kernel.org/r/20211021092753.511863-1-karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c31237afcd
commit
9da4b50c38
@@ -1717,7 +1717,7 @@ unsigned int bb_get_frame_time(unsigned char preamble_type,
|
||||
rate = (unsigned int)awc_frame_time[rate_idx];
|
||||
|
||||
if (rate_idx <= 3) { /* CCK mode */
|
||||
if (preamble_type == 1) /* Short */
|
||||
if (preamble_type == PREAMBLE_SHORT)
|
||||
preamble = 96;
|
||||
else
|
||||
preamble = 192;
|
||||
@@ -1779,7 +1779,7 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
|
||||
case RATE_2M:
|
||||
count = bit_count / 2;
|
||||
|
||||
if (preamble_type == 1)
|
||||
if (preamble_type == PREAMBLE_SHORT)
|
||||
phy->signal = 0x09;
|
||||
else
|
||||
phy->signal = 0x01;
|
||||
@@ -1792,7 +1792,7 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
|
||||
if (tmp != bit_count)
|
||||
count++;
|
||||
|
||||
if (preamble_type == 1)
|
||||
if (preamble_type == PREAMBLE_SHORT)
|
||||
phy->signal = 0x0a;
|
||||
else
|
||||
phy->signal = 0x02;
|
||||
@@ -1809,7 +1809,7 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
|
||||
ext_bit = true;
|
||||
}
|
||||
|
||||
if (preamble_type == 1)
|
||||
if (preamble_type == PREAMBLE_SHORT)
|
||||
phy->signal = 0x0b;
|
||||
else
|
||||
phy->signal = 0x03;
|
||||
|
||||
Reference in New Issue
Block a user