linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: snapshot: Fix coding style issues
@ 2025-07-16 12:42 Darshan Rathod
  2025-07-17 18:32 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Darshan Rathod @ 2025-07-16 12:42 UTC (permalink / raw)
  To: Rafael J. Wysocki, Pavel Machek, Len Brown, linux-pm,
	linux-kernel
  Cc: Darshan Rathod

Clean up various coding style violations in snapshot.c identified by
checkpatch.pl.

- Add a space after control flow keywords (for, if).
- Correct indentation from spaces to tabs for a variable declaration.

These changes have no functional impact and improve compliance with the
Linux Kernel Coding Style.

Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
---
 kernel/power/snapshot.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 2af36cfe35cd..501df0676a61 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1536,7 +1536,7 @@ static unsigned long copy_data_pages(struct memory_bitmap *copy_bm,
 	memory_bm_position_reset(orig_bm);
 	memory_bm_position_reset(copy_bm);
 	copy_pfn = memory_bm_next_pfn(copy_bm);
-	for(;;) {
+	for (;;) {
 		pfn = memory_bm_next_pfn(orig_bm);
 		if (unlikely(pfn == BM_END_OF_MAP))
 			break;
@@ -2161,13 +2161,13 @@ static const char *check_image_kernel(struct swsusp_info *info)
 {
 	if (info->version_code != LINUX_VERSION_CODE)
 		return "kernel version";
-	if (strcmp(info->uts.sysname,init_utsname()->sysname))
+	if (strcmp(info->uts.sysname, init_utsname()->sysname))
 		return "system type";
-	if (strcmp(info->uts.release,init_utsname()->release))
+	if (strcmp(info->uts.release, init_utsname()->release))
 		return "kernel release";
-	if (strcmp(info->uts.version,init_utsname()->version))
+	if (strcmp(info->uts.version, init_utsname()->version))
 		return "version";
-	if (strcmp(info->uts.machine,init_utsname()->machine))
+	if (strcmp(info->uts.machine, init_utsname()->machine))
 		return "machine";
 	return NULL;
 }
@@ -2361,7 +2361,7 @@ static int unpack_orig_pfns(unsigned long *buf, struct memory_bitmap *bm,
 		struct memory_bitmap *zero_bm)
 {
 	unsigned long decoded_pfn;
-        bool zero;
+	bool zero;
 	int j;
 
 	for (j = 0; j < PAGE_SIZE / sizeof(long); j++) {
-- 
2.43.0


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

* Re: [PATCH] power: snapshot: Fix coding style issues
  2025-07-16 12:42 [PATCH] power: snapshot: Fix coding style issues Darshan Rathod
@ 2025-07-17 18:32 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-07-17 18:32 UTC (permalink / raw)
  To: Darshan Rathod
  Cc: Rafael J. Wysocki, Pavel Machek, Len Brown, linux-pm,
	linux-kernel

On Wed, Jul 16, 2025 at 2:42 PM Darshan Rathod
<darshanrathod475@gmail.com> wrote:
>
> Clean up various coding style violations in snapshot.c identified by
> checkpatch.pl.
>
> - Add a space after control flow keywords (for, if).
> - Correct indentation from spaces to tabs for a variable declaration.
>
> These changes have no functional impact and improve compliance with the
> Linux Kernel Coding Style.
>
> Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
> ---
>  kernel/power/snapshot.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
> index 2af36cfe35cd..501df0676a61 100644
> --- a/kernel/power/snapshot.c
> +++ b/kernel/power/snapshot.c
> @@ -1536,7 +1536,7 @@ static unsigned long copy_data_pages(struct memory_bitmap *copy_bm,
>         memory_bm_position_reset(orig_bm);
>         memory_bm_position_reset(copy_bm);
>         copy_pfn = memory_bm_next_pfn(copy_bm);
> -       for(;;) {
> +       for (;;) {
>                 pfn = memory_bm_next_pfn(orig_bm);
>                 if (unlikely(pfn == BM_END_OF_MAP))
>                         break;
> @@ -2161,13 +2161,13 @@ static const char *check_image_kernel(struct swsusp_info *info)
>  {
>         if (info->version_code != LINUX_VERSION_CODE)
>                 return "kernel version";
> -       if (strcmp(info->uts.sysname,init_utsname()->sysname))
> +       if (strcmp(info->uts.sysname, init_utsname()->sysname))
>                 return "system type";
> -       if (strcmp(info->uts.release,init_utsname()->release))
> +       if (strcmp(info->uts.release, init_utsname()->release))
>                 return "kernel release";
> -       if (strcmp(info->uts.version,init_utsname()->version))
> +       if (strcmp(info->uts.version, init_utsname()->version))
>                 return "version";
> -       if (strcmp(info->uts.machine,init_utsname()->machine))
> +       if (strcmp(info->uts.machine, init_utsname()->machine))
>                 return "machine";
>         return NULL;
>  }
> @@ -2361,7 +2361,7 @@ static int unpack_orig_pfns(unsigned long *buf, struct memory_bitmap *bm,
>                 struct memory_bitmap *zero_bm)
>  {
>         unsigned long decoded_pfn;
> -        bool zero;
> +       bool zero;
>         int j;
>
>         for (j = 0; j < PAGE_SIZE / sizeof(long); j++) {
> --

Applied (with rewritten subject and changelog) as 6.17 material, thanks!

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

end of thread, other threads:[~2025-07-17 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 12:42 [PATCH] power: snapshot: Fix coding style issues Darshan Rathod
2025-07-17 18:32 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).