Skip to contentSkip to conversation

v4.4-rt2: fix compilation warnings and errors

PATCH In review Anders Roxell 4 participants 19 messages Jan 15, 2016 – Jan 21, 2016 1 message not in the archive

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover v4.4-rt2: fix compilation warnings and errors

Hi,

This patchset fixes some build warnings and errors that were introduced by v4.4-rt2. To build these patches they should be applied on top of patch [1], [2] and [3].

Cheers,
Anders
[1] https://lkml.org/lkml/2015/12/28/221
[2] https://lkml.org/lkml/2015/12/28/222
[3] http://www.spinics.net/lists/kernel/msg2162906.html

Anders Roxell (9):
drivers/clocksource: timer-atmel-pit: fix irq name drivers/clocksource: timer-atmel-pit: fix forward declaration drivers/clocksource: timer-atmel-pit: fix unused var 'ret' drivers/clocksource: timer-atmel-st: undeclared var 'ret' drivers/clocksource: timer-atmel-st: fix unused var 'ret' drivers/clocksource: timer-atmel-st: undeclared var 'irq' kernel/time: hrtimer: fix forward declaration drivers/cpuidle: coupled: fix warning cpuidle_coupled_lock driver/gpio: gpio-omap: fix incompatible pointer type

 drivers/clocksource/timer-atmel-pit.c | 4 ++--
 drivers/clocksource/timer-atmel-st.c  | 4 ++--
 drivers/cpuidle/coupled.c             | 1 -
 drivers/gpio/gpio-omap.c              | 2 +-
 kernel/time/hrtimer.c                 | 4 ++--
 5 files changed, 7 insertions(+), 8 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/9 drivers/clocksource: timer-atmel-pit: fix irq name

Use the same irq (data->irq) that we used while registering the timer handle, and not atmel_pit_irq.

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation error without this fix:
../drivers/clocksource/timer-atmel-pit.c: In function 'pit_clkevt_shutdown':
../drivers/clocksource/timer-atmel-pit.c:99:11: error: 'atmel_pit_irq' undeclared (first use in this function)
free_irq(atmel_pit_irq, data);

---
 drivers/clocksource/timer-atmel-pit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-atmel-pit.c +1 -1
index 80d74c4..2e313e6 100644
@@ -96,7 +96,7 @@ static int pit_clkevt_shutdown(struct clock_event_device *dev)
 
 	/* disable irq, leaving the clocksource active */
 	pit_write(data->base, AT91_PIT_MR, (data->cycle - 1) | AT91_PIT_PITEN);
-	free_irq(atmel_pit_irq, data);
+	free_irq(data->irq, data);
 	return 0;
 }
 
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/9 drivers/clocksource: timer-atmel-pit: fix forward declaration

In reply to Anders Roxell

Forward declare function at91sam926x_pit_interrupt before use.

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation error without this fix:
../drivers/clocksource/timer-atmel-pit.c: In function 'pit_clkevt_set_periodic':
../drivers/clocksource/timer-atmel-pit.c:111:31: error:
'at91sam926x_pit_interrupt' undeclared (first use in this function)
ret = request_irq(data->irq, at91sam926x_pit_interrupt,

---
 drivers/clocksource/timer-atmel-pit.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clocksource/timer-atmel-pit.c +1 -0
index 2e313e6..f87e660 100644
@@ -100,6 +100,7 @@ static int pit_clkevt_shutdown(struct clock_event_device *dev)
 	return 0;
 }
 
+static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id);
 /*
  * Clockevent device:  interrupts every 1/HZ (== pit_cycles * MCK/16)
  */
Signature · 1 line
2.1.4
#3 lore raw

PATCH 3/9 drivers/clocksource: timer-atmel-pit: fix unused var 'ret'

In reply to Anders Roxell

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/clocksource/timer-atmel-pit.c: In function 'at91sam926x_pit_common_init':
../drivers/clocksource/timer-atmel-pit.c:193:6: warning: unused variable 'ret' [-Wunused-variable]

---
 drivers/clocksource/timer-atmel-pit.c | 1 -
 1 file changed, 1 deletion(-)
drivers/clocksource/timer-atmel-pit.c +0 -1
index f87e660..a7abdb6 100644
@@ -190,7 +190,6 @@ static void __init at91sam926x_pit_common_init(struct pit_data *data)
 {
 	unsigned long	pit_rate;
 	unsigned	bits;
-	int		ret;
 
 	/*
 	 * Use our actual MCK to figure out how many MCK/16 ticks per
Signature · 1 line
2.1.4
#4 lore raw

PATCH 4/9 drivers/clocksource: timer-atmel-st: undeclared var 'ret'

In reply to Anders Roxell

Used the at91_dt_defconfig and this caused a compilation error without this fix:
../drivers/clocksource/timer-atmel-st.c: In function 'clkevt32k_set_periodic':
../drivers/clocksource/timer-atmel-st.c:157:2: error: 'ret' undeclared (first use in this function)

---
 drivers/clocksource/timer-atmel-st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-atmel-st.c +1 -1
index ea37afc..b6f4aa6 100644
@@ -150,7 +150,7 @@ static int clkevt32k_set_oneshot(struct clock_event_device *dev)
 
 static int clkevt32k_set_periodic(struct clock_event_device *dev)
 {
-	int irq;
+	int irq, ret;
 
 	clkdev32k_disable_and_flush_irq();
 
Signature · 1 line
2.1.4
#5 lore raw

PATCH 5/9 drivers/clocksource: timer-atmel-st: fix unused var 'ret'

In reply to Anders Roxell

Used the at91_dt_defconfig and this caused a compilation warning without this fix:
../drivers/clocksource/timer-atmel-st.c:153:6: warning: unused variable 'irq' [-Wunused-variable]

---
 drivers/clocksource/timer-atmel-st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-atmel-st.c +1 -1
index b6f4aa6..ea4d8e5 100644
@@ -150,7 +150,7 @@ static int clkevt32k_set_oneshot(struct clock_event_device *dev)
 
 static int clkevt32k_set_periodic(struct clock_event_device *dev)
 {
-	int irq, ret;
+	int ret;
 
 	clkdev32k_disable_and_flush_irq();
 
Signature · 1 line
2.1.4
#11 lore raw

PATCH 6/9 drivers/clocksource: timer-atmel-st: undeclared var 'irq'

In reply to Anders Roxell

Used the at91_dt_defconfig and this caused a compilation error without this fix:
../drivers/clocksource/timer-atmel-st.c: In function 'atmel_st_timer_init':
../drivers/clocksource/timer-atmel-st.c:232:2: error: 'irq' undeclared (first use in this function)
make[3]: *** [drivers/clocksource/timer-atmel-st.o] Error 1

---
 drivers/clocksource/timer-atmel-st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-atmel-st.c +1 -1
index ea4d8e5..b26735f 100644
@@ -217,7 +217,7 @@ static void __init atmel_st_timer_init(struct device_node *node)
 {
 	struct clk *sclk;
 	unsigned int sclk_rate, val;
-	int ret;
+	int irq, ret;
 
 	regmap_st = syscon_node_to_regmap(node);
 	if (IS_ERR(regmap_st))
Signature · 1 line
2.1.4
#12 lore raw

PATCH 7/9 kernel/time: hrtimer: fix forward declaration

In reply to Anders Roxell

Forward declare function hrtimer_wakeup before use.

Used allmodconfig+CONFIG_OF=n and this caused a compilation error without this fix:
../kernel/time/hrtimer.c: In function '__hrtimer_run_queues':
../kernel/time/hrtimer.c:1464:27: error: 'hrtimer_wakeup' undeclared (first use in this function)

        timer->function == hrtimer_wakeup ?
---
 kernel/time/hrtimer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/time/hrtimer.c +2 -1
index fdd2b85..138d6f9 100644
@@ -1436,6 +1436,8 @@ static inline int hrtimer_rt_defer(struct hrtimer *timer) { return 0; }
 #endif
 
 
+static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer);
+
 static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
 {
 	struct hrtimer_clock_base *base = cpu_base->clock_base;
@@ -1490,8 +1492,6 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
 		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
 }
 
-static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer);
#13 lore raw

PATCH 8/9 drivers/cpuidle: coupled: fix warning cpuidle_coupled_lock

In reply to Anders Roxell

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/cpuidle/coupled.c:122:21: warning: 'cpuidle_coupled_lock' defined but not used [-Wunused-variable]

---
 drivers/cpuidle/coupled.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpuidle/coupled.c +0 -1
index 344058f..d5657d5 100644
@@ -119,7 +119,6 @@ struct cpuidle_coupled {
 
 #define CPUIDLE_COUPLED_NOT_IDLE	(-1)
 
-static DEFINE_MUTEX(cpuidle_coupled_lock);
 static DEFINE_PER_CPU(struct call_single_data, cpuidle_coupled_poke_cb);
 
 /*
Signature · 1 line
2.1.4
#16 lore raw

PATCH 9/9 driver/gpio: gpio-omap: fix incompatible pointer type

In reply to Anders Roxell

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/gpio/gpio-omap.c: In function 'omap_gpio_runtime_resume':
../drivers/gpio/gpio-omap.c:1398:4: warning: passing argument 1 of
'rt_spin_unlock' from incompatible pointer type [enabled by default]
In file included from ../include/linux/spinlock.h:290:0,

                 from ../include/linux/seqlock.h:35,
                 from ../include/linux/time.h:5,
                 from ../include/linux/stat.h:18,
                 from ../include/linux/module.h:10,
                 from ../drivers/gpio/gpio-omap.c:16:

../include/linux/spinlock_rt.h:24:56: note: expected
'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'

---
 drivers/gpio/gpio-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-omap.c +1 -1
index 004888b..f3028e7 100644
@@ -1395,7 +1395,7 @@ static int omap_gpio_runtime_resume(struct device *dev)
 		if (c != bank->context_loss_count) {
 			omap_gpio_restore_context(bank);
 		} else {
-			spin_unlock_irqrestore(&bank->lock, flags);
+			raw_spin_unlock_irqrestore(&bank->lock, flags);
 			return 0;
 		}
 	}
Signature · 1 line
2.1.4
#17 lore raw

Re: [PATCH 9/9] driver/gpio: gpio-omap: fix incompatible pointer type

Quoted 25 lines · Anders Roxell

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/gpio/gpio-omap.c: In function 'omap_gpio_runtime_resume':
../drivers/gpio/gpio-omap.c:1398:4: warning: passing argument 1 of
'rt_spin_unlock' from incompatible pointer type [enabled by default]
In file included from ../include/linux/spinlock.h:290:0,

                  from ../include/linux/seqlock.h:35,
                  from ../include/linux/time.h:5,
                  from ../include/linux/stat.h:18,
                  from ../include/linux/module.h:10,
                  from ../drivers/gpio/gpio-omap.c:16:

../include/linux/spinlock_rt.h:24:56: note: expected
'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'

---
  drivers/gpio/gpio-omap.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-omap.c +0 -0
index 004888b..f3028e7 100644

drivers/gpio/gpio-omap.c static int omap_gpio_runtime_resume(struct device *dev) · line 1401

Quoted 8 lines
drivers/gpio/gpio-omap.c +1 -1
@@ -1395,7 +1395,7 @@ static int omap_gpio_runtime_resume(struct device *dev)
  		if (c != bank->context_loss_count) {
  			omap_gpio_restore_context(bank);
  		} else {
-			spin_unlock_irqrestore(&bank->lock, flags);
+			raw_spin_unlock_irqrestore(&bank->lock, flags);
  			return 0;
  		}
  	}

This patch is not required since I've asked Sebastian to revert patch caused this warning.

Signature · 2 lines
regards,
-grygorii
#14 lore raw

Re: [PATCH 8/9] drivers/cpuidle: coupled: fix warning cpuidle_coupled_lock

In reply to Anders Roxell
Quoted 6 lines · * Anders Roxell | 2016-01-15 20:21:12 [+0100]:

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/cpuidle/coupled.c:122:21: warning: 'cpuidle_coupled_lock' defined but not used [-Wunused-variable]

Could you please forward this patch upstream? The driver was introduced in 4126c0197bc8 ("cpuidle: add support for states that affect multiple cpus") with the cpuidle_coupled_lock variable unused. This is not -RT specific.

Quoted 9 lines

---
drivers/cpuidle/coupled.c | 1 -

1 file changed, 1 deletion(-)
drivers/cpuidle/coupled.c +0 -0
index 344058f..d5657d5 100644

drivers/cpuidle/coupled.c struct cpuidle_coupled { · line 124

Quoted 7 lines
drivers/cpuidle/coupled.c +0 -1
@@ -119,7 +119,6 @@ struct cpuidle_coupled {
 
 #define CPUIDLE_COUPLED_NOT_IDLE	(-1)
 
-static DEFINE_MUTEX(cpuidle_coupled_lock);
 static DEFINE_PER_CPU(struct call_single_data, cpuidle_coupled_poke_cb);
 
 /*

Sebastian

#19 lore raw
In reply to Anders Roxell
Quoted 1 line · * Anders Roxell | 2016-01-15 20:21:04 [+0100]:

Hi,

Hi,

Quoted 3 lines

This patchset fixes some build warnings and errors that were introduced by v4.4-rt2. To build these patches they should be applied on top of patch [1], [2] and [3].

Thanks.

The AT91 pieces and hrtimer should have been fixed by now. An omap patch has been dropped which makes #9 obsolete.
I picked up #8 and the patch you reference [3] and hope they pop-up upstream soon :)

Quoted 3 lines

Cheers,
Anders
[3] http://www.spinics.net/lists/kernel/msg2162906.html

Sebastian

#15 lore raw

Re: [PATCH 8/9] drivers/cpuidle: coupled: fix warning cpuidle_coupled_lock

In reply to Sebastian Andrzej Siewior
Quoted 7 lines · Sebastian Andrzej Siewior
Quoted 5 lines · * Anders Roxell | 2016-01-15 20:21:12 [+0100]:

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/cpuidle/coupled.c:122:21: warning: 'cpuidle_coupled_lock' defined but not used [-Wunused-variable]

Quoted 6 lines
Quoted 1 line

Could you please forward this patch upstream? The driver was introduced in 4126c0197bc8 ("cpuidle: add support for states that affect multiple cpus") with the cpuidle_coupled_lock variable unused. This is not -RT specific.

Yes, I'll do that.

Cheers,
Anders

Quoted 19 lines
Quoted 10 lines

---
drivers/cpuidle/coupled.c | 1 -

1 file changed, 1 deletion(-)
drivers/cpuidle/coupled.c +0 -0
index 344058f..d5657d5 100644

drivers/cpuidle/coupled.c struct cpuidle_coupled { · line 124

Quoted 7 lines
drivers/cpuidle/coupled.c +0 -1
@@ -119,7 +119,6 @@ struct cpuidle_coupled {
 
 #define CPUIDLE_COUPLED_NOT_IDLE      (-1)
 
-static DEFINE_MUTEX(cpuidle_coupled_lock);
 static DEFINE_PER_CPU(struct call_single_data, cpuidle_coupled_poke_cb);
 
 /*

Sebastian

#18 lore raw

Re: [PATCH 9/9] driver/gpio: gpio-omap: fix incompatible pointer type

In reply to Grygorii Strashko
Quoted 29 lines · Grygorii Strashko
Quoted 28 lines · Anders Roxell

Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix:
../drivers/gpio/gpio-omap.c: In function 'omap_gpio_runtime_resume':
../drivers/gpio/gpio-omap.c:1398:4: warning: passing argument 1 of
'rt_spin_unlock' from incompatible pointer type [enabled by default]
In file included from ../include/linux/spinlock.h:290:0,

                  from ../include/linux/seqlock.h:35,
                  from ../include/linux/time.h:5,
                  from ../include/linux/stat.h:18,
                  from ../include/linux/module.h:10,
                  from ../drivers/gpio/gpio-omap.c:16:

../include/linux/spinlock_rt.h:24:56: note: expected
'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'

---
  drivers/gpio/gpio-omap.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-omap.c +0 -1
index 004888b..f3028e7 100644
@@ -1395,7 +1395,7 @@ static int omap_gpio_runtime_resume(struct device *dev)
              if (c != bank->context_loss_count) {
                      omap_gpio_restore_context(bank);
              } else {
-                     spin_unlock_irqrestore(&bank->lock, flags);
Quoted 8 lines

drivers/gpio/gpio-omap.c static int omap_gpio_runtime_resume(struct device *dev) · line 1401

Quoted 5 lines
drivers/gpio/gpio-omap.c +1 -0
+                     raw_spin_unlock_irqrestore(&bank->lock, flags);
                      return 0;
              }
      }

This patch is not required since I've asked Sebastian to revert patch caused this warning.

Yes your right, I've missed that.

Cheers,
Anders

Quoted 4 lines

--
regards,
-grygorii

#8 lore raw

Re: [PATCH 5/9] drivers/clocksource: timer-atmel-st: fix unused var 'ret'

In reply to Brian Silverman
Quoted 1 line · Brian Silverman

The subject line for this one has the wrong variable name in it.

#9 lore raw

Re: [PATCH 5/9] drivers/clocksource: timer-atmel-st: fix unused var 'ret'

Quoted 2 lines · Anders Roxell
Quoted 1 line · Brian Silverman

The subject line for this one has the wrong variable name in it.

Thanks, I'll send a v2.

Cheers,
Anders

#10 lore raw

Re: [PATCH 5/9] drivers/clocksource: timer-atmel-st: fix unused var 'ret'

Quoted 5 lines · Anders Roxell
Quoted 2 lines · Anders Roxell
Quoted 1 line · Brian Silverman

The subject line for this one has the wrong variable name in it.

Thanks, I'll send a v2.

No, please don't. It is all fixed by now.

Quoted 4 lines

Cheers,
Anders

Sebastian