From ed8c40265288cfd0b3e5731c68ffd8c90dcb2d74 Mon Sep 17 00:00:00 2001 From: Alex Markuze Date: Tue, 18 Mar 2025 20:19:12 +0000 Subject: [PATCH] formatting warnings --- fs/ceph/debugfs.c | 28 +--------------------------- net/ceph/ceph_san_logger.c | 4 ++-- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index 6cc0384aa1e45..5a7d287474af5 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -386,37 +386,11 @@ static int jiffies_to_formatted_time(unsigned long jiffies_value, char *buffer, tm_time.tm_year = (seconds / 365 / 12) + 70; // Simplified year since 1970 // Format the time into the buffer - return snprintf(buffer, buffer_len, "%04d-%02d-%02d %02d:%02d:%02d", + return snprintf(buffer, buffer_len, "%04ld-%02d-%02d %02d:%02d:%02d", tm_time.tm_year + 1900, tm_time.tm_mon + 1, tm_time.tm_mday, tm_time.tm_hour, tm_time.tm_min, tm_time.tm_sec); } -static void jiffies_to_datetime_str(unsigned long input_jiffies, char *buffer, size_t buf_size) -{ - static time64_t boot_time_sec = 0; - struct rtc_time tm; - time64_t timestamp; - - // Initialize boot_time_sec only once - if (boot_time_sec == 0) { - struct timespec64 boot_ts; - ktime_get_boottime_ts64(&boot_ts); - boot_time_sec = boot_ts.tv_sec; - } - - //use ktime_get_boottime_ts64() to get the boot time - // Convert jiffies to absolute timestamp - timestamp = boot_time_sec + (input_jiffies / HZ); - - // Convert timestamp to human-readable format - rtc_time64_to_tm(timestamp, &tm); - - // Format the output string - snprintf(buffer, buf_size, "%04d-%02d-%02d %02d:%02d:%02d", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); -} - static int status_show(struct seq_file *s, void *p) { struct ceph_fs_client *fsc = s->private; diff --git a/net/ceph/ceph_san_logger.c b/net/ceph/ceph_san_logger.c index 0d5e761462235..06138396eeac0 100644 --- a/net/ceph/ceph_san_logger.c +++ b/net/ceph/ceph_san_logger.c @@ -268,12 +268,12 @@ struct ceph_san_log_entry *ceph_san_log_iter_next(struct ceph_san_log_iter *iter /* Get previous entry if available */ struct ceph_san_log_entry *prev_entry = NULL; prev_entry = cephsan_pagefrag_get_ptr(iter->pf, iter->prev_offset); - pr_err("Previous entry: entry=%px poison=%x len=%u prev_offset=%llu\n", + pr_err("Previous entry: entry=%px poison=%llx len=%u prev_offset=%llu\n", prev_entry, prev_entry->debug_poison, prev_entry->len, iter->prev_offset); iter->prev_offset = iter->current_offset; iter->current_offset = iter->end_offset; - pr_err("Pagefrag corruption detected: entry=%px poison=%x len=%u\n" + pr_err("Pagefrag corruption detected: entry=%px poison=%llx len=%u\n" "pf: head=%u tail=%u buffer=%px alloc_count=%u prev_offset=%llu\n", entry, entry->debug_poison, entry->len, iter->pf->head, iter->pf->tail, iter->pf->buffer, -- 2.39.5