X86 platform drivers
 help / color / mirror / Atom feed
* re: drivers/platform/x86/sony-laptop.c: fix scancodes
@ 2011-11-30 12:55 Dan Carpenter
  2011-11-30 13:22 ` John Hughes
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-11-30 12:55 UTC (permalink / raw)
  To: John Hughes; +Cc: platform-driver-x86, Andrew Morton

Hi John,

Commit 04840b50f395 "drivers/platform/x86/sony-laptop.c: fix scancodes"
introduces a gcc warning:

drivers/platform/x86/sony-laptop.c:395:14: warning:
	‘scancode’ may be used uninitialized in this function [-Wuninitialized]

   345  static void sony_laptop_report_input_event(u8 event)
   346  {
   347          struct input_dev *jog_dev = sony_laptop_input.jog_dev;
   348          struct input_dev *key_dev = sony_laptop_input.key_dev;
   349          struct sony_laptop_keypress kp = { NULL };
   350          int scancode;
   351  

-- [snip] --

   373          /* key_dev events */
   374          case SONYPI_EVENT_JOGDIAL_PRESSED:
   375                  kp.key = BTN_MIDDLE;
   376                  kp.dev = jog_dev;
   377                  break;

scancode doesn't get initialized on this path, but kp.dev is set.

   378  
   379          default:
   380                  if (event >= ARRAY_SIZE(sony_laptop_input_index)) {
   381                          dprintk("sony_laptop_report_input_event, event not known: %d\n", event);
   382                          break;
   383                  }
   384                  scancode = sony_laptop_input_index[event];
   385                  if (scancode != -1) {
   386                          kp.key = sony_laptop_input_keycode_map[scancode];
   387                          if (kp.key != KEY_UNKNOWN)
   388                                  kp.dev = key_dev;
   389                  }
   390                  break;
   391          }
   392  
   393          if (kp.dev) {
   394                  /* we emit the scancode so we can always remap the key */
   395                  input_event(kp.dev, EV_MSC, MSC_SCAN, scancode);

We use scancode here.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-03 11:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-30 12:55 drivers/platform/x86/sony-laptop.c: fix scancodes Dan Carpenter
2011-11-30 13:22 ` John Hughes
2011-11-30 21:50 ` John Hughes
2011-12-03 11:47 ` [PATCH] Fix scancodes emitted by sony-laptop driver (Version 2 with warnings fixed) John Hughes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox