Linux Power Management development
 help / color / mirror / Atom feed
From: "Muhammed Çevik" <talhaderyavahap@gmail.com>
To: rafael.j.wysocki@intel.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Muhammed Talha Çevik" <talhaderyavahap@gmail.com>
Subject: [PATCH] power: fix whitespace and type inconsistencies in poweroff.c and user.c
Date: Sat, 18 Jul 2026 23:16:19 +0300	[thread overview]
Message-ID: <20260718201621.7203-1-talhaderyavahap@gmail.com> (raw)

From: Muhammed Talha Çevik <talhaderyavahap@gmail.com>

Fix a number of coding style issues and a type inconsistency found in
kernel/power/poweroff.c and kernel/power/user.c:

- poweroff.c: remove extra whitespace before struct name in
  sysrq_poweroff_op definition, and normalize member alignment to
  use tabs consistently.

- user.c: fix snapshot_write() using 'unsigned long' for sleep_flags
  where lock_system_sleep() returns 'unsigned int', matching
  snapshot_read() and other callers.

- user.c: fix function parameter continuation alignment to use a
  single tab instead of visual alignment with spaces, per CodingStyle.

- user.c: remove stray semicolon after closing brace of
  snapshot_device_init().

- user.c: normalize goto label names — rename 'Unlock:' to 'unlock:'
  to match the label used in snapshot_write(), and adjust indentation
  to be consistent (no leading space).

Signed-off-by: Muhammed Talha ÇEVİK <talhaderyavahap@gmail.com>
---
 kernel/power/poweroff.c |  8 +++----
 kernel/power/user.c     | 50 ++++++++++++++++++++---------------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/kernel/power/poweroff.c b/kernel/power/poweroff.c
index xxxxxxx..xxxxxxx 100644
--- a/kernel/power/poweroff.c
+++ b/kernel/power/poweroff.c
@@ -28,10 +28,10 @@ static void handle_poweroff(u8 key)
 	schedule_work_on(cpumask_first(cpu_online_mask), &poweroff_work);
 }
 
-static const struct sysrq_key_op	sysrq_poweroff_op = {
-	.handler        = handle_poweroff,
-	.help_msg       = "poweroff(o)",
-	.action_msg     = "Power Off",
-	.enable_mask	= SYSRQ_ENABLE_BOOT,
+static const struct sysrq_key_op sysrq_poweroff_op = {
+	.handler	= handle_poweroff,
+	.help_msg	= "poweroff(o)",
+	.action_msg	= "Power Off",
+	.enable_mask	= SYSRQ_ENABLE_BOOT,
 };
 
diff --git a/kernel/power/user.c b/kernel/power/user.c
index xxxxxxx..xxxxxxx 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -110,17 +110,17 @@ static int snapshot_release(struct inode *inode, struct file *filp)
 	if (data->frozen) {
 		pm_restore_gfp_mask();
 		free_basic_memory_bitmaps();
 		thaw_processes();
 	} else if (data->free_bitmaps) {
 		free_basic_memory_bitmaps();
 	}
 	pm_notifier_call_chain(data->mode == O_RDONLY ?
 			PM_POST_HIBERNATION : PM_POST_RESTORE);
 	hibernate_release();
 
 	unlock_system_sleep(sleep_flags);
 
 	return 0;
 }
 
-static ssize_t snapshot_read(struct file *filp, char __user *buf,
-                             size_t count, loff_t *offp)
+static ssize_t snapshot_read(struct file *filp, char __user *buf,
+		size_t count, loff_t *offp)
 {
 	loff_t pg_offp = *offp & ~PAGE_MASK;
 	struct snapshot_data *data;
@@ -143,7 +143,7 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
 	if (res > 0)
 		*offp += res;
 
- Unlock:
+unlock:
 	unlock_system_sleep(sleep_flags);
 
 	return res;
@@ -133,7 +133,7 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
 		goto Unlock;
 	}
 	if (!pg_offp) { /* on page boundary? */
 		res = snapshot_read_next(&data->handle);
 		if (res <= 0)
-			goto Unlock;
+			goto unlock;
 	} else {
 		res = PAGE_SIZE - pg_offp;
 	}
@@ -153,8 +153,8 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
 		goto Unlock;
 	}
 
-static ssize_t snapshot_write(struct file *filp, const char __user *buf,
-                              size_t count, loff_t *offp)
+static ssize_t snapshot_write(struct file *filp, const char __user *buf,
+		size_t count, loff_t *offp)
 {
 	loff_t pg_offp = *offp & ~PAGE_MASK;
 	struct snapshot_data *data;
-	unsigned long sleep_flags;
+	unsigned int sleep_flags;
 	ssize_t res;
 
@@ -420,7 +420,7 @@ static int __init snapshot_device_init(void)
 {
 	return misc_register(&snapshot_device);
-};
+}
 
 device_initcall(snapshot_device_init);
-- 
2.39.0

             reply	other threads:[~2026-07-18 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18 20:16 Muhammed Çevik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-18 20:19 [PATCH] power: fix whitespace and type inconsistencies in poweroff.c and user.c Muhammed Çevik
2026-07-18 20:12 Muhammed Çevik

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=20260718201621.7203-1-talhaderyavahap@gmail.com \
    --to=talhaderyavahap@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    /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