diff options
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r-- | scripts/mod/file2alias.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 84e21201f3c0..37f67c23e11b 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -374,10 +374,10 @@ static void do_input(char *alias, | |||
374 | kernel_ulong_t *arr, unsigned int min, unsigned int max) | 374 | kernel_ulong_t *arr, unsigned int min, unsigned int max) |
375 | { | 375 | { |
376 | unsigned int i; | 376 | unsigned int i; |
377 | for (i = min; i < max; i++) { | 377 | |
378 | if (arr[i/BITS_PER_LONG] & (1 << (i%BITS_PER_LONG))) | 378 | for (i = min; i < max; i++) |
379 | sprintf(alias+strlen(alias), "%X,*", i); | 379 | if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG))) |
380 | } | 380 | sprintf(alias + strlen(alias), "%X,*", i); |
381 | } | 381 | } |
382 | 382 | ||
383 | /* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */ | 383 | /* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */ |
@@ -386,39 +386,37 @@ static int do_input_entry(const char *filename, struct input_device_id *id, | |||
386 | { | 386 | { |
387 | sprintf(alias, "input:"); | 387 | sprintf(alias, "input:"); |
388 | 388 | ||
389 | ADD(alias, "b", id->flags&INPUT_DEVICE_ID_MATCH_BUS, id->id.bustype); | 389 | ADD(alias, "b", id->flags & INPUT_DEVICE_ID_MATCH_BUS, id->bustype); |
390 | ADD(alias, "v", id->flags&INPUT_DEVICE_ID_MATCH_VENDOR, id->id.vendor); | 390 | ADD(alias, "v", id->flags & INPUT_DEVICE_ID_MATCH_VENDOR, id->vendor); |
391 | ADD(alias, "p", id->flags&INPUT_DEVICE_ID_MATCH_PRODUCT, | 391 | ADD(alias, "p", id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT, id->product); |
392 | id->id.product); | 392 | ADD(alias, "e", id->flags & INPUT_DEVICE_ID_MATCH_VERSION, id->version); |
393 | ADD(alias, "e", id->flags&INPUT_DEVICE_ID_MATCH_VERSION, | ||
394 | id->id.version); | ||
395 | 393 | ||
396 | sprintf(alias + strlen(alias), "-e*"); | 394 | sprintf(alias + strlen(alias), "-e*"); |
397 | if (id->flags&INPUT_DEVICE_ID_MATCH_EVBIT) | 395 | if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT) |
398 | do_input(alias, id->evbit, 0, EV_MAX); | 396 | do_input(alias, id->evbit, 0, EV_MAX); |
399 | sprintf(alias + strlen(alias), "k*"); | 397 | sprintf(alias + strlen(alias), "k*"); |
400 | if (id->flags&INPUT_DEVICE_ID_MATCH_KEYBIT) | 398 | if (id->flags & INPUT_DEVICE_ID_MATCH_KEYBIT) |
401 | do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX); | 399 | do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX); |
402 | sprintf(alias + strlen(alias), "r*"); | 400 | sprintf(alias + strlen(alias), "r*"); |
403 | if (id->flags&INPUT_DEVICE_ID_MATCH_RELBIT) | 401 | if (id->flags & INPUT_DEVICE_ID_MATCH_RELBIT) |
404 | do_input(alias, id->relbit, 0, REL_MAX); | 402 | do_input(alias, id->relbit, 0, REL_MAX); |
405 | sprintf(alias + strlen(alias), "a*"); | 403 | sprintf(alias + strlen(alias), "a*"); |
406 | if (id->flags&INPUT_DEVICE_ID_MATCH_ABSBIT) | 404 | if (id->flags & INPUT_DEVICE_ID_MATCH_ABSBIT) |
407 | do_input(alias, id->absbit, 0, ABS_MAX); | 405 | do_input(alias, id->absbit, 0, ABS_MAX); |
408 | sprintf(alias + strlen(alias), "m*"); | 406 | sprintf(alias + strlen(alias), "m*"); |
409 | if (id->flags&INPUT_DEVICE_ID_MATCH_MSCIT) | 407 | if (id->flags & INPUT_DEVICE_ID_MATCH_MSCIT) |
410 | do_input(alias, id->mscbit, 0, MSC_MAX); | 408 | do_input(alias, id->mscbit, 0, MSC_MAX); |
411 | sprintf(alias + strlen(alias), "l*"); | 409 | sprintf(alias + strlen(alias), "l*"); |
412 | if (id->flags&INPUT_DEVICE_ID_MATCH_LEDBIT) | 410 | if (id->flags & INPUT_DEVICE_ID_MATCH_LEDBIT) |
413 | do_input(alias, id->ledbit, 0, LED_MAX); | 411 | do_input(alias, id->ledbit, 0, LED_MAX); |
414 | sprintf(alias + strlen(alias), "s*"); | 412 | sprintf(alias + strlen(alias), "s*"); |
415 | if (id->flags&INPUT_DEVICE_ID_MATCH_SNDBIT) | 413 | if (id->flags & INPUT_DEVICE_ID_MATCH_SNDBIT) |
416 | do_input(alias, id->sndbit, 0, SND_MAX); | 414 | do_input(alias, id->sndbit, 0, SND_MAX); |
417 | sprintf(alias + strlen(alias), "f*"); | 415 | sprintf(alias + strlen(alias), "f*"); |
418 | if (id->flags&INPUT_DEVICE_ID_MATCH_FFBIT) | 416 | if (id->flags & INPUT_DEVICE_ID_MATCH_FFBIT) |
419 | do_input(alias, id->ffbit, 0, FF_MAX); | 417 | do_input(alias, id->ffbit, 0, FF_MAX); |
420 | sprintf(alias + strlen(alias), "w*"); | 418 | sprintf(alias + strlen(alias), "w*"); |
421 | if (id->flags&INPUT_DEVICE_ID_MATCH_SWBIT) | 419 | if (id->flags & INPUT_DEVICE_ID_MATCH_SWBIT) |
422 | do_input(alias, id->swbit, 0, SW_MAX); | 420 | do_input(alias, id->swbit, 0, SW_MAX); |
423 | return 1; | 421 | return 1; |
424 | } | 422 | } |