Skip to content

Commit 9b04bd2

Browse files
davem330Linus Torvalds
authored andcommitted
Fix printk format warnings in timer_list.c
u64 and s64 are not necessarily 'long long' on some 64-bit platforms, so explicit the type to kill the compiler warnings. Also consistently use '%Lu' which is unsigned. Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0366299 commit 9b04bd2

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

‎kernel/time/timer_list.c‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ print_timer(struct seq_file *m, struct hrtimer *timer, int idx, u64 now)
6565
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
6666
#endif
6767
SEQ_printf(m, "\n");
68-
SEQ_printf(m, " # expires at %Ld nsecs [in %Ld nsecs]\n",
68+
SEQ_printf(m, " # expires at %Lu nsecs [in %Lu nsecs]\n",
6969
(unsigned long long)ktime_to_ns(timer->expires),
7070
(unsigned long long)(ktime_to_ns(timer->expires) - now));
7171
}
@@ -111,14 +111,14 @@ print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now)
111111
{
112112
SEQ_printf(m, " .index: %d\n",
113113
base->index);
114-
SEQ_printf(m, " .resolution: %Ld nsecs\n",
114+
SEQ_printf(m, " .resolution: %Lu nsecs\n",
115115
(unsigned long long)ktime_to_ns(base->resolution));
116116
SEQ_printf(m, " .get_time: ");
117117
print_name_offset(m, base->get_time);
118118
SEQ_printf(m, "\n");
119119
#ifdef CONFIG_HIGH_RES_TIMERS
120-
SEQ_printf(m, " .offset: %Ld nsecs\n",
121-
ktime_to_ns(base->offset));
120+
SEQ_printf(m, " .offset: %Lu nsecs\n",
121+
(unsigned long long) ktime_to_ns(base->offset));
122122
#endif
123123
SEQ_printf(m, "active timers:\n");
124124
print_active_timers(m, base, now);
@@ -135,10 +135,11 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
135135
print_base(m, cpu_base->clock_base + i, now);
136136
}
137137
#define P(x) \
138-
SEQ_printf(m, " .%-15s: %Ld\n", #x, (u64)(cpu_base->x))
138+
SEQ_printf(m, " .%-15s: %Lu\n", #x, \
139+
(unsigned long long)(cpu_base->x))
139140
#define P_ns(x) \
140-
SEQ_printf(m, " .%-15s: %Ld nsecs\n", #x, \
141-
(u64)(ktime_to_ns(cpu_base->x)))
141+
SEQ_printf(m, " .%-15s: %Lu nsecs\n", #x, \
142+
(unsigned long long)(ktime_to_ns(cpu_base->x)))
142143

143144
#ifdef CONFIG_HIGH_RES_TIMERS
144145
P_ns(expires_next);
@@ -150,10 +151,11 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
150151

151152
#ifdef CONFIG_TICK_ONESHOT
152153
# define P(x) \
153-
SEQ_printf(m, " .%-15s: %Ld\n", #x, (u64)(ts->x))
154+
SEQ_printf(m, " .%-15s: %Lu\n", #x, \
155+
(unsigned long long)(ts->x))
154156
# define P_ns(x) \
155-
SEQ_printf(m, " .%-15s: %Ld nsecs\n", #x, \
156-
(u64)(ktime_to_ns(ts->x)))
157+
SEQ_printf(m, " .%-15s: %Lu nsecs\n", #x, \
158+
(unsigned long long)(ktime_to_ns(ts->x)))
157159
{
158160
struct tick_sched *ts = tick_get_tick_sched(cpu);
159161
P(nohz_mode);
@@ -167,7 +169,8 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
167169
P(last_jiffies);
168170
P(next_jiffies);
169171
P_ns(idle_expires);
170-
SEQ_printf(m, "jiffies: %Ld\n", (u64)jiffies);
172+
SEQ_printf(m, "jiffies: %Lu\n",
173+
(unsigned long long)jiffies);
171174
}
172175
#endif
173176

0 commit comments

Comments
 (0)