Skip to content

Commit f61e063

Browse files
author
Jiri Kosina
committed
HID: nintendo: eliminate dead datastructures in !CONFIG_NINTENDO_FF case
The rumbling-related identifiers are never used in !CONFIG_NINTENDO_FF case, so let's hide them in order to avoid unused warnings. Reported-by: kernel test robot <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent a109111 commit f61e063

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/hid/hid-nintendo.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ struct joycon_rumble_amp_data {
189189
u16 amp;
190190
};
191191

192+
#if IS_ENABLED(CONFIG_NINTENDO_FF)
192193
/*
193194
* These tables are from
194195
* https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
@@ -289,6 +290,10 @@ static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
289290
{ 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
290291
{ 0xc8, 0x0072, joycon_max_rumble_amp }
291292
};
293+
static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
294+
static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
295+
#endif /* IS_ENABLED(CONFIG_NINTENDO_FF) */
296+
static const u16 JC_RUMBLE_PERIOD_MS = 50;
292297

293298
/* States for controller state machine */
294299
enum joycon_ctlr_state {
@@ -397,9 +402,6 @@ struct joycon_input_report {
397402
#define JC_RUMBLE_DATA_SIZE 8
398403
#define JC_RUMBLE_QUEUE_SIZE 8
399404

400-
static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
401-
static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
402-
static const u16 JC_RUMBLE_PERIOD_MS = 50;
403405
static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
404406

405407
static const char * const joycon_player_led_names[] = {

0 commit comments

Comments
 (0)