@@ -21,6 +21,7 @@
* GNU General Public License for more details.
*/
+#include <linux/find_atomic.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/leds.h>
@@ -158,10 +159,7 @@ static void shark_led_work(struct work_struct *work)
container_of(work, struct shark_device, led_work);
int i, res, brightness, actual_len;
- for (i = 0; i < 3; i++) {
- if (!test_and_clear_bit(i, &shark->brightness_new))
- continue;
-
+ for_each_test_and_clear_bit(i, &shark->brightness_new, 3) {
brightness = atomic_read(&shark->brightness[i]);
memset(shark->transfer_buffer, 0, TB_LEN);
if (i != RED_LED) {
@@ -21,6 +21,7 @@
* GNU General Public License for more details.
*/
+#include <linux/find_atomic.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/leds.h>
@@ -145,10 +146,7 @@ static void shark_led_work(struct work_struct *work)
container_of(work, struct shark_device, led_work);
int i, res, brightness, actual_len;
- for (i = 0; i < 2; i++) {
- if (!test_and_clear_bit(i, &shark->brightness_new))
- continue;
-
+ for_each_test_and_clear_bit(i, &shark->brightness_new, 2) {
brightness = atomic_read(&shark->brightness[i]);
memset(shark->transfer_buffer, 0, TB_LEN);
shark->transfer_buffer[0] = 0x83 + i;