Skip to content

Commit

Permalink
kernel/generic: fix warnings if libata-ledtrig is disabled
Browse files Browse the repository at this point in the history
accidentally #if was used instead of #ifdef, thus gcc warned
about CONFIG_ATA_LEDS being undefined...

Signed-off-by: Daniel Golle <[email protected]>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43786 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
nbd committed Dec 27, 2014
1 parent 8784691 commit 0f39185
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions target/linux/generic/patches-3.14/834-ledtrig-libata.patch
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ index 5c84fb5..eb49e02 100644
return block;
}

+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+#define LIBATA_BLINK_DELAY 20 /* ms */
+static inline void ata_led_act(struct ata_port *ap)
+{
Expand All @@ -77,7 +77,7 @@ index 5c84fb5..eb49e02 100644
break;
}
}
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ ata_led_act(ap);
+#endif

Expand All @@ -87,7 +87,7 @@ index 5c84fb5..eb49e02 100644
ap->stats.unhandled_irq = 1;
ap->stats.idle_irq = 1;
#endif
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ ap->ledtrig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
+#endif
ata_sff_port_init(ap);
Expand All @@ -97,7 +97,7 @@ index 5c84fb5..eb49e02 100644

kfree(ap->pmp_link);
kfree(ap->slave_link);
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ if (ap->ledtrig) {
+ led_trigger_unregister(ap->ledtrig);
+ kfree(ap->ledtrig);
Expand All @@ -110,7 +110,7 @@ index 5c84fb5..eb49e02 100644
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ for (i = 0; i < host->n_ports; i++) {
+ if (unlikely(!host->ports[i]->ledtrig))
+ continue;
Expand Down
10 changes: 5 additions & 5 deletions target/linux/generic/patches-3.18/834-ledtrig-libata.patch
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ index 5c84fb5..eb49e02 100644
return block;
}

+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+#define LIBATA_BLINK_DELAY 20 /* ms */
+static inline void ata_led_act(struct ata_port *ap)
+{
Expand All @@ -77,7 +77,7 @@ index 5c84fb5..eb49e02 100644
break;
}
}
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ ata_led_act(ap);
+#endif

Expand All @@ -87,7 +87,7 @@ index 5c84fb5..eb49e02 100644
ap->stats.unhandled_irq = 1;
ap->stats.idle_irq = 1;
#endif
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ ap->ledtrig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
+#endif
ata_sff_port_init(ap);
Expand All @@ -97,7 +97,7 @@ index 5c84fb5..eb49e02 100644

kfree(ap->pmp_link);
kfree(ap->slave_link);
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ if (ap->ledtrig) {
+ led_trigger_unregister(ap->ledtrig);
+ kfree(ap->ledtrig);
Expand All @@ -110,7 +110,7 @@ index 5c84fb5..eb49e02 100644
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}
+#if CONFIG_ATA_LEDS
+#ifdef CONFIG_ATA_LEDS
+ for (i = 0; i < host->n_ports; i++) {
+ if (unlikely(!host->ports[i]->ledtrig))
+ continue;
Expand Down

0 comments on commit 0f39185

Please sign in to comment.