Skip to content

Commit 749443d

Browse files
committed
Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
A couple of kernel functions call for_each_*_bit_from() with start bit equal to 0. Replace them with for_each_*_bit(). No functional changes, but might improve on readability. Signed-off-by: Yury Norov <yury.norov@gmail.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent 7516be9 commit 749443d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

arch/x86/kernel/apic/vector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,9 @@ void __init lapic_update_legacy_vectors(void)
760760

761761
void __init lapic_assign_system_vectors(void)
762762
{
763-
unsigned int i, vector = 0;
763+
unsigned int i, vector;
764764

765-
for_each_set_bit_from(vector, system_vectors, NR_VECTORS)
765+
for_each_set_bit(vector, system_vectors, NR_VECTORS)
766766
irq_matrix_assign_system(vector_matrix, vector, false);
767767

768768
if (nr_legacy_irqs() > 1)

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m)
10471047

10481048
void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu)
10491049
{
1050-
unsigned int i = 0;
1050+
unsigned int i;
10511051

10521052
dev_err(gpu->dev, "recover hung GPU!\n");
10531053

@@ -1060,7 +1060,7 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu)
10601060

10611061
/* complete all events, the GPU won't do it after the reset */
10621062
spin_lock(&gpu->event_spinlock);
1063-
for_each_set_bit_from(i, gpu->event_bitmap, ETNA_NR_EVENTS)
1063+
for_each_set_bit(i, gpu->event_bitmap, ETNA_NR_EVENTS)
10641064
complete(&gpu->event_free);
10651065
bitmap_zero(gpu->event_bitmap, ETNA_NR_EVENTS);
10661066
spin_unlock(&gpu->event_spinlock);

drivers/hwmon/ltc2992.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ static int ltc2992_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask
248248

249249
gpio_status = reg;
250250

251-
gpio_nr = 0;
252-
for_each_set_bit_from(gpio_nr, mask, LTC2992_GPIO_NR) {
251+
for_each_set_bit(gpio_nr, mask, LTC2992_GPIO_NR) {
253252
if (test_bit(LTC2992_GPIO_BIT(gpio_nr), &gpio_status))
254253
set_bit(gpio_nr, bits);
255254
}

0 commit comments

Comments
 (0)