aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-08-18 09:43:31 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 09:49:48 -0400
commitb592e89ac9af521be164490e45c53c93e89c776f (patch)
treed344abae4fc3a829389df72adcd91f5f3a7603b8 /arch
parent0fac3f477b6b520ae7d972ceb6e958e6807c8e1a (diff)
[SCSI] zfcp: Remove duplicated code for debug timestamps
The timestamp calculation used for s390dbf output is the same in a private zfcp function and in debug.c. Replace both with a common inline function. Reviewed-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/timex.h8
-rw-r--r--arch/s390/kernel/debug.c8
-rw-r--r--arch/s390/kernel/time.c1
3 files changed, 10 insertions, 7 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index cc21e3e20fd7..a07e699bb65c 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -88,6 +88,14 @@ int get_sync_clock(unsigned long long *clock);
88void init_cpu_timer(void); 88void init_cpu_timer(void);
89unsigned long long monotonic_clock(void); 89unsigned long long monotonic_clock(void);
90 90
91void tod_to_timeval(__u64, struct timespec *);
92
93static inline
94void stck_to_timespec(unsigned long long stck, struct timespec *ts)
95{
96 tod_to_timeval(stck - TOD_UNIX_EPOCH, ts);
97}
98
91extern u64 sched_clock_base_cc; 99extern u64 sched_clock_base_cc;
92 100
93#endif 101#endif
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index be8bceaf37d9..4c512561687d 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -63,8 +63,6 @@ typedef struct
63} debug_sprintf_entry_t; 63} debug_sprintf_entry_t;
64 64
65 65
66extern void tod_to_timeval(uint64_t todval, struct timespec *xtime);
67
68/* internal function prototyes */ 66/* internal function prototyes */
69 67
70static int debug_init(void); 68static int debug_init(void);
@@ -1450,17 +1448,13 @@ debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
1450 int area, debug_entry_t * entry, char *out_buf) 1448 int area, debug_entry_t * entry, char *out_buf)
1451{ 1449{
1452 struct timespec time_spec; 1450 struct timespec time_spec;
1453 unsigned long long time;
1454 char *except_str; 1451 char *except_str;
1455 unsigned long caller; 1452 unsigned long caller;
1456 int rc = 0; 1453 int rc = 0;
1457 unsigned int level; 1454 unsigned int level;
1458 1455
1459 level = entry->id.fields.level; 1456 level = entry->id.fields.level;
1460 time = entry->id.stck; 1457 stck_to_timespec(entry->id.stck, &time_spec);
1461 /* adjust todclock to 1970 */
1462 time -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096);
1463 tod_to_timeval(time, &time_spec);
1464 1458
1465 if (entry->id.fields.exception) 1459 if (entry->id.fields.exception)
1466 except_str = "*"; 1460 except_str = "*";
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index d4c8e9c47c81..9693d98d4d4a 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -90,6 +90,7 @@ void tod_to_timeval(__u64 todval, struct timespec *xtime)
90 todval -= (sec * 1000000) << 12; 90 todval -= (sec * 1000000) << 12;
91 xtime->tv_nsec = ((todval * 1000) >> 12); 91 xtime->tv_nsec = ((todval * 1000) >> 12);
92} 92}
93EXPORT_SYMBOL(tod_to_timeval);
93 94
94void clock_comparator_work(void) 95void clock_comparator_work(void)
95{ 96{