Skip to content

Commit c1685a8

Browse files
basuamdBenjamin Tissoires
authored and
Benjamin Tissoires
committed
HID: amd_sfh: Rename the float32 variable
As float32 is also used in other places as a data type, it is necessary to rename the float32 variable in order to avoid confusion. Cc: [email protected] Tested-by: Kai-Heng Feng <[email protected]> Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Akshata MukundShetty <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent e3ea646 commit c1685a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ static void get_common_inputs(struct common_input_property *common, int report_i
132132
common->event_type = HID_USAGE_SENSOR_EVENT_DATA_UPDATED_ENUM;
133133
}
134134

135-
static int float_to_int(u32 float32)
135+
static int float_to_int(u32 flt32_val)
136136
{
137137
int fraction, shift, mantissa, sign, exp, zeropre;
138138

139-
mantissa = float32 & GENMASK(22, 0);
140-
sign = (float32 & BIT(31)) ? -1 : 1;
141-
exp = (float32 & ~BIT(31)) >> 23;
139+
mantissa = flt32_val & GENMASK(22, 0);
140+
sign = (flt32_val & BIT(31)) ? -1 : 1;
141+
exp = (flt32_val & ~BIT(31)) >> 23;
142142

143143
if (!exp && !mantissa)
144144
return 0;
@@ -151,10 +151,10 @@ static int float_to_int(u32 float32)
151151
}
152152

153153
shift = 23 - exp;
154-
float32 = BIT(exp) + (mantissa >> shift);
154+
flt32_val = BIT(exp) + (mantissa >> shift);
155155
fraction = mantissa & GENMASK(shift - 1, 0);
156156

157-
return (((fraction * 100) >> shift) >= 50) ? sign * (float32 + 1) : sign * float32;
157+
return (((fraction * 100) >> shift) >= 50) ? sign * (flt32_val + 1) : sign * flt32_val;
158158
}
159159

160160
static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,

0 commit comments

Comments
 (0)