Skip to contentSkip to conversation

PPS build warning

PATCH New john stultz 3 participants 5 messages Feb 2, 2011 – Feb 25, 2011 PPS support

lore
Share & tools
lore
#0 lore raw

Hey Rodolfo,
Just ran into the following:

drivers/pps/kapi.c: In function ‘pps_event’:
drivers/pps/kapi.c:196: warning: ‘ts_real.flags’ may be used uninitialized in this function

Looks like you don't set the flags value in timespec_to_pps_ktime when you initialize the rest of the structure.

thanks
-john

#1 lore raw

(cc Alexander)

Quoted 9 lines · On Tue, 01 Feb 2011 17:31:33 -0800 john stultz <[email protected]> wrote:

Hey Rodolfo,
Just ran into the following:

drivers/pps/kapi.c: In function 'pps_event':
drivers/pps/kapi.c:196: warning: 'ts_real.flags' may be used uninitialized in this function

Looks like you don't set the flags value in timespec_to_pps_ktime when you initialize the rest of the structure.

#3 lore raw

PATCH 2/2 pps: remove unreachable code

Remove code enabled only when CONFIG_PREEMPT_RT is turned on because it is not used in the vanilla kernel.

---
 drivers/pps/generators/pps_gen_parport.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/pps/generators/pps_gen_parport.c +0 -5
index b93af3e..dcd39fb 100644
@@ -216,11 +216,6 @@ static void parport_attach(struct parport *port)
 
 	hrtimer_init(&device.timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
 	device.timer.function = hrtimer_event;
-#ifdef CONFIG_PREEMPT_RT
-	/* hrtimer interrupt will run in the interrupt context with this */
-	device.timer.irqsafe = 1;
-#endif
-
 	hrtimer_start(&device.timer, next_intr_time(&device), HRTIMER_MODE_ABS);
 
 	return;
Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 1/2 pps: initialize ts_real properly

In reply to Andrew Morton

Initialize ts_real.flags to fix compiler warning about possible uninitialized use of this field.

---
 drivers/pps/kapi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pps/kapi.c +1 -1
index cba1b43..a4e8eb9 100644
@@ -168,7 +168,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
 {
 	unsigned long flags;
 	int captured = 0;
-	struct pps_ktime ts_real;
+	struct pps_ktime ts_real = { .sec = 0, .nsec = 0, .flags = 0 };
 
 	/* check event type */
 	BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
Signature · 1 line
1.7.2.3
#4 lore raw

cover fix two minor PPS issues

In reply to Andrew Morton

These patches fix two minor issues in PPS. The first is reported in this thread and the second I found myself.

Alexander Gordeev (2):
pps: initialize ts_real properly
pps: remove unreachable code

 drivers/pps/generators/pps_gen_parport.c |    5 -----
 drivers/pps/kapi.c                       |    2 +-
 2 files changed, 1 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.2.3