public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Clint George <clintbgeorge@gmail.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, clintbgeorge@gmail.com,
	david.hunter.linux@gmail.com, khalid@kernel.org,
	linux-kernel-mentees@lists.linux.dev,
	linux-kernel@vger.kernel.org, skhan@linuxfoundation.org
Subject: [PATCH v2 0/3] hangcheck-timer: coding style improvements
Date: Tue, 11 Nov 2025 20:43:37 +0530	[thread overview]
Message-ID: <20251111151340.9162-1-clintbgeorge@gmail.com> (raw)
In-Reply-To: <2025110649-elves-steadying-a4d0@gregkh>

This series improves coding style in hangcheck-timer:

Clint George (3):
  hangcheck-timer: replace printk(KERN_CRIT) with pr_crit
  hangcheck-timer: Replace %Ld with %lld
  hangcheck-timer: fix coding style spacing

No functional changes were made to hangcheck logic.

Signed-off-by: Clint George <clintbgeorge@gmail.com>

---

Testing:
- Verified timer firing and margin detection using "hangtest" module that
i created (I will paste the code below for reference) and checked dmesg
logs for expected output: "Hangcheck: hangcheck value past margin!".
- Used Static Analysis tools
- Ensured module builds and inserts cleanly after changes.

Let me know any more tests need to be done on this module.

[] hangtest.c (testing module i created to test hangcheck-timer module):

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Clint George");
MODULE_DESCRIPTION("Hang test for testing hangcheck-timer");

static int hang_duration = 20;
module_param(hang_duration, int, 0644);

static int __init hangtest_init(void) {
    unsigned long timeout;

    printk(KERN_INFO "hangtest: Disabling interrupts for %d seconds...\n", hang_duration);

    local_irq_disable();
    preempt_disable();

    timeout = jiffies + (hang_duration * HZ);
    while (time_before(jiffies, timeout)) {
        cpu_relax();
        barrier();
    }

    preempt_enable();
    local_irq_enable();

    printk(KERN_INFO "hangtest: Interrupts re-enabled\n");
//    return 0;
    return -EINVAL; // Return error so module doesn't stay loaded
}

static void __exit hangtest_exit(void) {
    printk(KERN_INFO "hangtest: Exit\n");
}

module_init(hangtest_init);
module_exit(hangtest_exit);

 drivers/char/hangcheck-timer.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

-- 
2.43.0


  reply	other threads:[~2025-11-11 15:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 14:05 [PATCH] hangcheck-timer: use pr_crit and fix coding style Clint George
2025-11-06  7:51 ` Greg KH
2025-11-11 15:13   ` Clint George [this message]
2025-11-11 15:13     ` [PATCH v2 1/3] hangcheck-timer: replace printk(KERN_CRIT) with pr_crit Clint George
2025-11-11 15:13     ` [PATCH v2 2/3] hangcheck-timer: Replace %Ld with %lld Clint George
2025-11-11 15:13     ` [PATCH v2 3/3] hangcheck-timer: fix coding style spacing Clint George

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251111151340.9162-1-clintbgeorge@gmail.com \
    --to=clintbgeorge@gmail.com \
    --cc=arnd@arndb.de \
    --cc=david.hunter.linux@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khalid@kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox