Re: Time for a code audit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewing drivers/staging/unisys/visorinput/visorinput.c

   465          case KEY_NUMLOCK:
   466                  led = LED_NUML;
   467                  break;
   468          default:
   469                  led = -1;

Just make this a direct return.

   470                  break;
   471          }
   472          if (led >= 0) {


Then you can remove this if condition.

   473                  int old_state = (test_bit(led, visorinput_dev->led));

Remove extra parens.

   474  
   475                  if (old_state != desired_state) {
   476                          input_report_key(visorinput_dev, keycode, 1);
   477                          input_sync(visorinput_dev);
   478                          input_report_key(visorinput_dev, keycode, 0);
   479                          input_sync(visorinput_dev);
   480                          __change_bit(led, visorinput_dev->led);
   481                  }
   482          }
   483  }

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux