tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c8c109546a19613d323a319d0c921cb1f317e629
commit: daf11ca2b9f45a1ac6f90af5a61ee4db915110b1 HID: nintendo: fix -Werror build
date: 13 days ago
config: i386-buildonly-randconfig-r003-20211114 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=daf11ca2b9f45a1ac6f90af5a61ee4db915110b1
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout daf11ca2b9f45a1ac6f90af5a61ee4db915110b1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
All errors (new ones prefixed by >>):
>> drivers/hid/hid-nintendo.c:196:45: error: unused variable 'joycon_rumble_frequencies' [-Werror,-Wunused-const-variable]
static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
^
>> drivers/hid/hid-nintendo.c:254:44: error: unused variable 'joycon_rumble_amplitudes' [-Werror,-Wunused-const-variable]
static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
^
>> drivers/hid/hid-nintendo.c:400:18: error: unused variable 'JC_RUMBLE_DFLT_LOW_FREQ' [-Werror,-Wunused-const-variable]
static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
^
>> drivers/hid/hid-nintendo.c:401:18: error: unused variable 'JC_RUMBLE_DFLT_HIGH_FREQ' [-Werror,-Wunused-const-variable]
static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
^
>> drivers/hid/hid-nintendo.c:403:29: error: unused variable 'JC_RUMBLE_ZERO_AMP_PKT_CNT' [-Werror,-Wunused-const-variable]
static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
^
5 errors generated.
vim +/joycon_rumble_frequencies +196 drivers/hid/hid-nintendo.c
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 191
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 192 /*
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 193 * These tables are from
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 194 * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 195 */
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 @196 static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 197 /* high, low, freq */
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 198 { 0x0000, 0x01, 41 }, { 0x0000, 0x02, 42 }, { 0x0000, 0x03, 43 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 199 { 0x0000, 0x04, 44 }, { 0x0000, 0x05, 45 }, { 0x0000, 0x06, 46 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 200 { 0x0000, 0x07, 47 }, { 0x0000, 0x08, 48 }, { 0x0000, 0x09, 49 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 201 { 0x0000, 0x0A, 50 }, { 0x0000, 0x0B, 51 }, { 0x0000, 0x0C, 52 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 202 { 0x0000, 0x0D, 53 }, { 0x0000, 0x0E, 54 }, { 0x0000, 0x0F, 55 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 203 { 0x0000, 0x10, 57 }, { 0x0000, 0x11, 58 }, { 0x0000, 0x12, 59 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 204 { 0x0000, 0x13, 60 }, { 0x0000, 0x14, 62 }, { 0x0000, 0x15, 63 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 205 { 0x0000, 0x16, 64 }, { 0x0000, 0x17, 66 }, { 0x0000, 0x18, 67 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 206 { 0x0000, 0x19, 69 }, { 0x0000, 0x1A, 70 }, { 0x0000, 0x1B, 72 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 207 { 0x0000, 0x1C, 73 }, { 0x0000, 0x1D, 75 }, { 0x0000, 0x1e, 77 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 208 { 0x0000, 0x1f, 78 }, { 0x0000, 0x20, 80 }, { 0x0400, 0x21, 82 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 209 { 0x0800, 0x22, 84 }, { 0x0c00, 0x23, 85 }, { 0x1000, 0x24, 87 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 210 { 0x1400, 0x25, 89 }, { 0x1800, 0x26, 91 }, { 0x1c00, 0x27, 93 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 211 { 0x2000, 0x28, 95 }, { 0x2400, 0x29, 97 }, { 0x2800, 0x2a, 99 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 212 { 0x2c00, 0x2b, 102 }, { 0x3000, 0x2c, 104 }, { 0x3400, 0x2d, 106 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 213 { 0x3800, 0x2e, 108 }, { 0x3c00, 0x2f, 111 }, { 0x4000, 0x30, 113 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 214 { 0x4400, 0x31, 116 }, { 0x4800, 0x32, 118 }, { 0x4c00, 0x33, 121 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 215 { 0x5000, 0x34, 123 }, { 0x5400, 0x35, 126 }, { 0x5800, 0x36, 129 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 216 { 0x5c00, 0x37, 132 }, { 0x6000, 0x38, 135 }, { 0x6400, 0x39, 137 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 217 { 0x6800, 0x3a, 141 }, { 0x6c00, 0x3b, 144 }, { 0x7000, 0x3c, 147 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 218 { 0x7400, 0x3d, 150 }, { 0x7800, 0x3e, 153 }, { 0x7c00, 0x3f, 157 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 219 { 0x8000, 0x40, 160 }, { 0x8400, 0x41, 164 }, { 0x8800, 0x42, 167 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 220 { 0x8c00, 0x43, 171 }, { 0x9000, 0x44, 174 }, { 0x9400, 0x45, 178 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 221 { 0x9800, 0x46, 182 }, { 0x9c00, 0x47, 186 }, { 0xa000, 0x48, 190 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 222 { 0xa400, 0x49, 194 }, { 0xa800, 0x4a, 199 }, { 0xac00, 0x4b, 203 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 223 { 0xb000, 0x4c, 207 }, { 0xb400, 0x4d, 212 }, { 0xb800, 0x4e, 217 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 224 { 0xbc00, 0x4f, 221 }, { 0xc000, 0x50, 226 }, { 0xc400, 0x51, 231 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 225 { 0xc800, 0x52, 236 }, { 0xcc00, 0x53, 241 }, { 0xd000, 0x54, 247 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 226 { 0xd400, 0x55, 252 }, { 0xd800, 0x56, 258 }, { 0xdc00, 0x57, 263 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 227 { 0xe000, 0x58, 269 }, { 0xe400, 0x59, 275 }, { 0xe800, 0x5a, 281 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 228 { 0xec00, 0x5b, 287 }, { 0xf000, 0x5c, 293 }, { 0xf400, 0x5d, 300 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 229 { 0xf800, 0x5e, 306 }, { 0xfc00, 0x5f, 313 }, { 0x0001, 0x60, 320 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 230 { 0x0401, 0x61, 327 }, { 0x0801, 0x62, 334 }, { 0x0c01, 0x63, 341 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 231 { 0x1001, 0x64, 349 }, { 0x1401, 0x65, 357 }, { 0x1801, 0x66, 364 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 232 { 0x1c01, 0x67, 372 }, { 0x2001, 0x68, 381 }, { 0x2401, 0x69, 389 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 233 { 0x2801, 0x6a, 397 }, { 0x2c01, 0x6b, 406 }, { 0x3001, 0x6c, 415 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 234 { 0x3401, 0x6d, 424 }, { 0x3801, 0x6e, 433 }, { 0x3c01, 0x6f, 443 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 235 { 0x4001, 0x70, 453 }, { 0x4401, 0x71, 462 }, { 0x4801, 0x72, 473 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 236 { 0x4c01, 0x73, 483 }, { 0x5001, 0x74, 494 }, { 0x5401, 0x75, 504 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 237 { 0x5801, 0x76, 515 }, { 0x5c01, 0x77, 527 }, { 0x6001, 0x78, 538 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 238 { 0x6401, 0x79, 550 }, { 0x6801, 0x7a, 562 }, { 0x6c01, 0x7b, 574 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 239 { 0x7001, 0x7c, 587 }, { 0x7401, 0x7d, 600 }, { 0x7801, 0x7e, 613 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 240 { 0x7c01, 0x7f, 626 }, { 0x8001, 0x00, 640 }, { 0x8401, 0x00, 654 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 241 { 0x8801, 0x00, 668 }, { 0x8c01, 0x00, 683 }, { 0x9001, 0x00, 698 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 242 { 0x9401, 0x00, 713 }, { 0x9801, 0x00, 729 }, { 0x9c01, 0x00, 745 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 243 { 0xa001, 0x00, 761 }, { 0xa401, 0x00, 778 }, { 0xa801, 0x00, 795 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 244 { 0xac01, 0x00, 812 }, { 0xb001, 0x00, 830 }, { 0xb401, 0x00, 848 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 245 { 0xb801, 0x00, 867 }, { 0xbc01, 0x00, 886 }, { 0xc001, 0x00, 905 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 246 { 0xc401, 0x00, 925 }, { 0xc801, 0x00, 945 }, { 0xcc01, 0x00, 966 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 247 { 0xd001, 0x00, 987 }, { 0xd401, 0x00, 1009 }, { 0xd801, 0x00, 1031 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 248 { 0xdc01, 0x00, 1053 }, { 0xe001, 0x00, 1076 }, { 0xe401, 0x00, 1100 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 249 { 0xe801, 0x00, 1124 }, { 0xec01, 0x00, 1149 }, { 0xf001, 0x00, 1174 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 250 { 0xf401, 0x00, 1199 }, { 0xf801, 0x00, 1226 }, { 0xfc01, 0x00, 1253 }
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 251 };
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 252
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 253 #define joycon_max_rumble_amp (1003)
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 @254 static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 255 /* high, low, amp */
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 256 { 0x00, 0x0040, 0 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 257 { 0x02, 0x8040, 10 }, { 0x04, 0x0041, 12 }, { 0x06, 0x8041, 14 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 258 { 0x08, 0x0042, 17 }, { 0x0a, 0x8042, 20 }, { 0x0c, 0x0043, 24 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 259 { 0x0e, 0x8043, 28 }, { 0x10, 0x0044, 33 }, { 0x12, 0x8044, 40 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 260 { 0x14, 0x0045, 47 }, { 0x16, 0x8045, 56 }, { 0x18, 0x0046, 67 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 261 { 0x1a, 0x8046, 80 }, { 0x1c, 0x0047, 95 }, { 0x1e, 0x8047, 112 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 262 { 0x20, 0x0048, 117 }, { 0x22, 0x8048, 123 }, { 0x24, 0x0049, 128 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 263 { 0x26, 0x8049, 134 }, { 0x28, 0x004a, 140 }, { 0x2a, 0x804a, 146 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 264 { 0x2c, 0x004b, 152 }, { 0x2e, 0x804b, 159 }, { 0x30, 0x004c, 166 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 265 { 0x32, 0x804c, 173 }, { 0x34, 0x004d, 181 }, { 0x36, 0x804d, 189 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 266 { 0x38, 0x004e, 198 }, { 0x3a, 0x804e, 206 }, { 0x3c, 0x004f, 215 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 267 { 0x3e, 0x804f, 225 }, { 0x40, 0x0050, 230 }, { 0x42, 0x8050, 235 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 268 { 0x44, 0x0051, 240 }, { 0x46, 0x8051, 245 }, { 0x48, 0x0052, 251 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 269 { 0x4a, 0x8052, 256 }, { 0x4c, 0x0053, 262 }, { 0x4e, 0x8053, 268 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 270 { 0x50, 0x0054, 273 }, { 0x52, 0x8054, 279 }, { 0x54, 0x0055, 286 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 271 { 0x56, 0x8055, 292 }, { 0x58, 0x0056, 298 }, { 0x5a, 0x8056, 305 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 272 { 0x5c, 0x0057, 311 }, { 0x5e, 0x8057, 318 }, { 0x60, 0x0058, 325 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 273 { 0x62, 0x8058, 332 }, { 0x64, 0x0059, 340 }, { 0x66, 0x8059, 347 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 274 { 0x68, 0x005a, 355 }, { 0x6a, 0x805a, 362 }, { 0x6c, 0x005b, 370 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 275 { 0x6e, 0x805b, 378 }, { 0x70, 0x005c, 387 }, { 0x72, 0x805c, 395 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 276 { 0x74, 0x005d, 404 }, { 0x76, 0x805d, 413 }, { 0x78, 0x005e, 422 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 277 { 0x7a, 0x805e, 431 }, { 0x7c, 0x005f, 440 }, { 0x7e, 0x805f, 450 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 278 { 0x80, 0x0060, 460 }, { 0x82, 0x8060, 470 }, { 0x84, 0x0061, 480 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 279 { 0x86, 0x8061, 491 }, { 0x88, 0x0062, 501 }, { 0x8a, 0x8062, 512 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 280 { 0x8c, 0x0063, 524 }, { 0x8e, 0x8063, 535 }, { 0x90, 0x0064, 547 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 281 { 0x92, 0x8064, 559 }, { 0x94, 0x0065, 571 }, { 0x96, 0x8065, 584 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 282 { 0x98, 0x0066, 596 }, { 0x9a, 0x8066, 609 }, { 0x9c, 0x0067, 623 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 283 { 0x9e, 0x8067, 636 }, { 0xa0, 0x0068, 650 }, { 0xa2, 0x8068, 665 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 284 { 0xa4, 0x0069, 679 }, { 0xa6, 0x8069, 694 }, { 0xa8, 0x006a, 709 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 285 { 0xaa, 0x806a, 725 }, { 0xac, 0x006b, 741 }, { 0xae, 0x806b, 757 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 286 { 0xb0, 0x006c, 773 }, { 0xb2, 0x806c, 790 }, { 0xb4, 0x006d, 808 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 287 { 0xb6, 0x806d, 825 }, { 0xb8, 0x006e, 843 }, { 0xba, 0x806e, 862 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 288 { 0xbc, 0x006f, 881 }, { 0xbe, 0x806f, 900 }, { 0xc0, 0x0070, 920 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 289 { 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 290 { 0xc8, 0x0072, joycon_max_rumble_amp }
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 291 };
c4eae84feff3e6 Daniel J. Ogorchock 2021-09-11 292
:::::: The code at line 196 was first introduced by commit
:::::: c4eae84feff3e68c2f385aa10faea4a96791e7ad HID: nintendo: add rumble support
:::::: TO: Daniel J. Ogorchock <[email protected]>
:::::: CC: Jiri Kosina <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
On Sun, 14 Nov 2021, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: c8c109546a19613d323a319d0c921cb1f317e629
> commit: daf11ca2b9f45a1ac6f90af5a61ee4db915110b1 HID: nintendo: fix -Werror build
> date: 13 days ago
> config: i386-buildonly-randconfig-r003-20211114 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=daf11ca2b9f45a1ac6f90af5a61ee4db915110b1
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout daf11ca2b9f45a1ac6f90af5a61ee4db915110b1
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
> >> drivers/hid/hid-nintendo.c:196:45: error: unused variable 'joycon_rumble_frequencies' [-Werror,-Wunused-const-variable]
> static const struct joycon_rumble_freq_data joycon_rumble_frequencies[] = {
> ^
> >> drivers/hid/hid-nintendo.c:254:44: error: unused variable 'joycon_rumble_amplitudes' [-Werror,-Wunused-const-variable]
> static const struct joycon_rumble_amp_data joycon_rumble_amplitudes[] = {
> ^
> >> drivers/hid/hid-nintendo.c:400:18: error: unused variable 'JC_RUMBLE_DFLT_LOW_FREQ' [-Werror,-Wunused-const-variable]
> static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
> ^
> >> drivers/hid/hid-nintendo.c:401:18: error: unused variable 'JC_RUMBLE_DFLT_HIGH_FREQ' [-Werror,-Wunused-const-variable]
> static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
> ^
> >> drivers/hid/hid-nintendo.c:403:29: error: unused variable 'JC_RUMBLE_ZERO_AMP_PKT_CNT' [-Werror,-Wunused-const-variable]
> static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
> ^
> 5 errors generated.
From: Jiri Kosina <[email protected]>
Subject: [PATCH] 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]>
---
drivers/hid/hid-nintendo.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 7e1d1127493e..b6a9a0f3966e 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -189,6 +189,7 @@ struct joycon_rumble_amp_data {
u16 amp;
};
+#if IS_ENABLED(CONFIG_NINTENDO_FF)
/*
* These tables are from
* 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[] = {
{ 0xc2, 0x8070, 940 }, { 0xc4, 0x0071, 960 }, { 0xc6, 0x8071, 981 },
{ 0xc8, 0x0072, joycon_max_rumble_amp }
};
+static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
+static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
+#endif /* IS_ENABLED(CONFIG_NINTENDO_FF) */
+static const u16 JC_RUMBLE_PERIOD_MS = 50;
/* States for controller state machine */
enum joycon_ctlr_state {
@@ -397,9 +402,6 @@ struct joycon_input_report {
#define JC_RUMBLE_DATA_SIZE 8
#define JC_RUMBLE_QUEUE_SIZE 8
-static const u16 JC_RUMBLE_DFLT_LOW_FREQ = 160;
-static const u16 JC_RUMBLE_DFLT_HIGH_FREQ = 320;
-static const u16 JC_RUMBLE_PERIOD_MS = 50;
static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
static const char * const joycon_player_led_names[] = {
--
2.12.3
--
Jiri Kosina
SUSE Labs