Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] power: fix whitespace and type inconsistencies in poweroff.c and user.c
@ 2026-07-18 20:12 Muhammed Çevik
  0 siblings, 0 replies; 3+ messages in thread
From: Muhammed Çevik @ 2026-07-18 20:12 UTC (permalink / raw)
  To: rafael.j.wysocki; +Cc: linux-pm, linux-kernel, Your Name

From: Your Name <your.email@example.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: Your Name <your.email@example.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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] power: fix whitespace and type inconsistencies in poweroff.c and user.c
@ 2026-07-18 20:16 Muhammed Çevik
  0 siblings, 0 replies; 3+ messages in thread
From: Muhammed Çevik @ 2026-07-18 20:16 UTC (permalink / raw)
  To: rafael.j.wysocki; +Cc: linux-pm, linux-kernel, Muhammed Talha Çevik

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] power: fix whitespace and type inconsistencies in poweroff.c and user.c
@ 2026-07-18 20:19 Muhammed Çevik
  0 siblings, 0 replies; 3+ messages in thread
From: Muhammed Çevik @ 2026-07-18 20:19 UTC (permalink / raw)
  To: rafael.j.wysocki; +Cc: linux-pm, linux-kernel, Your Name

From: Your Name <your.email@example.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: Your Name <your.email@example.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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-18 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-18 20:12 [PATCH] power: fix whitespace and type inconsistencies in poweroff.c and user.c Muhammed Çevik
  -- strict thread matches above, loose matches on Subject: below --
2026-07-18 20:16 Muhammed Çevik
2026-07-18 20:19 Muhammed Çevik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox