All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] arm64/kernel: improve the coding style
@ 2021-02-03  5:48 Zhiyuan Dai
  2021-02-03 11:41 ` Mark Rutland
  0 siblings, 1 reply; 3+ messages in thread
From: Zhiyuan Dai @ 2021-02-03  5:48 UTC (permalink / raw)
  To: catalin.marinas, will, mark.rutland
  Cc: ardb, jeyu, keescook, vincenzo.frascino, linux-kernel, Zhiyuan Dai

Just improve the coding style.

Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>
---
 arch/arm64/kernel/alternative.c | 2 +-
 arch/arm64/kernel/module-plts.c | 2 +-
 arch/arm64/kernel/perf_event.c  | 2 +-
 arch/arm64/kernel/process.c     | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
index a57cffb..1184c44 100644
--- a/arch/arm64/kernel/alternative.c
+++ b/arch/arm64/kernel/alternative.c
@@ -17,7 +17,7 @@
 #include <asm/sections.h>
 #include <linux/stop_machine.h>
 
-#define __ALT_PTR(a,f)		((void *)&(a)->f + (a)->f)
+#define __ALT_PTR(a, f)		((void *)&(a)->f + (a)->f)
 #define ALT_ORIG_PTR(a)		__ALT_PTR(a, orig_offset)
 #define ALT_REPL_PTR(a)		__ALT_PTR(a, alt_offset)
 
diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c
index 2e22443..e53493d 100644
--- a/arch/arm64/kernel/module-plts.c
+++ b/arch/arm64/kernel/module-plts.c
@@ -131,7 +131,7 @@ u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs,
 }
 #endif
 
-#define cmp_3way(a,b)	((a) < (b) ? -1 : (a) > (b))
+#define cmp_3way(a, b)	((a) < (b) ? -1 : (a) > (b))
 
 static int cmp_rela(const void *a, const void *b)
 {
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 3605f77a..d1fec4a 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -810,7 +810,7 @@ static int armv8pmu_get_single_idx(struct pmu_hw_events *cpuc,
 {
 	int idx;
 
-	for (idx = ARMV8_IDX_COUNTER0; idx < cpu_pmu->num_events; idx ++) {
+	for (idx = ARMV8_IDX_COUNTER0; idx < cpu_pmu->num_events; idx++) {
 		if (!test_and_set_bit(idx, cpuc->used_mask))
 			return idx;
 	}
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 6616486..4cc1ccc 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -304,7 +304,7 @@ void __show_regs(struct pt_regs *regs)
 	}
 }
 
-void show_regs(struct pt_regs * regs)
+void show_regs(struct pt_regs *regs)
 {
 	__show_regs(regs);
 	dump_backtrace(regs, NULL, KERN_DEFAULT);
@@ -587,7 +587,7 @@ unsigned long get_wchan(struct task_struct *p)
 			ret = frame.pc;
 			goto out;
 		}
-	} while (count ++ < 16);
+	} while (count++ < 16);
 
 out:
 	put_task_stack(p);
-- 
1.8.3.1


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

* Re: [PATCH 2/2] arm64/kernel: improve the coding style
  2021-02-03  5:48 [PATCH 2/2] arm64/kernel: improve the coding style Zhiyuan Dai
@ 2021-02-03 11:41 ` Mark Rutland
  2021-02-04  1:40   ` 戴志远
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Rutland @ 2021-02-03 11:41 UTC (permalink / raw)
  To: Zhiyuan Dai
  Cc: catalin.marinas, will, ardb, jeyu, keescook, vincenzo.frascino,
	linux-kernel

On Wed, Feb 03, 2021 at 01:48:19PM +0800, Zhiyuan Dai wrote:
> Just improve the coding style.
> 
> Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>

This is terse and doesn't tell the reader what to expect. It would be
better to say something more specific, e.g.

| arm64: improve whitespace
|
| In a few places we don't have whitespace between macro parameters,
| which makes them hard to read. This patch adds whitespace to clearly
| separate the parameters.
|
| In a few places we have unnecessary whitespace around unary operators,
| which is confusing, This patch removes the unnecessary whitespace.

... which more clearly justifies the change.

The patch itself looks sane to me (and the unary operator cleanup is
certianly nice), so with that wording:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

> ---
>  arch/arm64/kernel/alternative.c | 2 +-
>  arch/arm64/kernel/module-plts.c | 2 +-
>  arch/arm64/kernel/perf_event.c  | 2 +-
>  arch/arm64/kernel/process.c     | 4 ++--
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
> index a57cffb..1184c44 100644
> --- a/arch/arm64/kernel/alternative.c
> +++ b/arch/arm64/kernel/alternative.c
> @@ -17,7 +17,7 @@
>  #include <asm/sections.h>
>  #include <linux/stop_machine.h>
>  
> -#define __ALT_PTR(a,f)		((void *)&(a)->f + (a)->f)
> +#define __ALT_PTR(a, f)		((void *)&(a)->f + (a)->f)
>  #define ALT_ORIG_PTR(a)		__ALT_PTR(a, orig_offset)
>  #define ALT_REPL_PTR(a)		__ALT_PTR(a, alt_offset)
>  
> diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c
> index 2e22443..e53493d 100644
> --- a/arch/arm64/kernel/module-plts.c
> +++ b/arch/arm64/kernel/module-plts.c
> @@ -131,7 +131,7 @@ u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs,
>  }
>  #endif
>  
> -#define cmp_3way(a,b)	((a) < (b) ? -1 : (a) > (b))
> +#define cmp_3way(a, b)	((a) < (b) ? -1 : (a) > (b))
>  
>  static int cmp_rela(const void *a, const void *b)
>  {
> diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
> index 3605f77a..d1fec4a 100644
> --- a/arch/arm64/kernel/perf_event.c
> +++ b/arch/arm64/kernel/perf_event.c
> @@ -810,7 +810,7 @@ static int armv8pmu_get_single_idx(struct pmu_hw_events *cpuc,
>  {
>  	int idx;
>  
> -	for (idx = ARMV8_IDX_COUNTER0; idx < cpu_pmu->num_events; idx ++) {
> +	for (idx = ARMV8_IDX_COUNTER0; idx < cpu_pmu->num_events; idx++) {
>  		if (!test_and_set_bit(idx, cpuc->used_mask))
>  			return idx;
>  	}
> diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> index 6616486..4cc1ccc 100644
> --- a/arch/arm64/kernel/process.c
> +++ b/arch/arm64/kernel/process.c
> @@ -304,7 +304,7 @@ void __show_regs(struct pt_regs *regs)
>  	}
>  }
>  
> -void show_regs(struct pt_regs * regs)
> +void show_regs(struct pt_regs *regs)
>  {
>  	__show_regs(regs);
>  	dump_backtrace(regs, NULL, KERN_DEFAULT);
> @@ -587,7 +587,7 @@ unsigned long get_wchan(struct task_struct *p)
>  			ret = frame.pc;
>  			goto out;
>  		}
> -	} while (count ++ < 16);
> +	} while (count++ < 16);
>  
>  out:
>  	put_task_stack(p);
> -- 
> 1.8.3.1
> 

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

* Re: Re: [PATCH 2/2] arm64/kernel: improve the coding style
  2021-02-03 11:41 ` Mark Rutland
@ 2021-02-04  1:40   ` 戴志远
  0 siblings, 0 replies; 3+ messages in thread
From: 戴志远 @ 2021-02-04  1:40 UTC (permalink / raw)
  To: Mark Rutland
  Cc: catalin.marinas, will, ardb, jeyu, keescook, vincenzo.frascino,
	linux-kernel

I am very sorry, my English cooperation is poor, just want to contribute。

2021-02-03 19:41:58 "Mark Rutland" <mark.rutland@arm.com> 写道:
> On Wed, Feb 03, 2021 at 01:48:19PM +0800, Zhiyuan Dai wrote:
> > Just improve the coding style.
> > 
> > Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>
> 
> This is terse and doesn't tell the reader what to expect. It would be
> better to say something more specific, e.g.
> 
> | arm64: improve whitespace
> |
> | In a few places we don't have whitespace between macro parameters,
> | which makes them hard to read. This patch adds whitespace to clearly
> | separate the parameters.
> |
> | In a few places we have unnecessary whitespace around unary operators,
> | which is confusing, This patch removes the unnecessary whitespace.
> 
> ... which more clearly justifies the change.
> 
> The patch itself looks sane to me (and the unary operator cleanup is
> certianly nice), so with that wording:
> 
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> 
> Thanks,
> Mark.
> 
> > ---
> >  arch/arm64/kernel/alternative.c | 2 +-
> >  arch/arm64/kernel/module-plts.c | 2 +-
> >  arch/arm64/kernel/perf_event.c  | 2 +-
> >  arch/arm64/kernel/process.c     | 4 ++--
> >  4 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
> > index a57cffb..1184c44 100644
> > --- a/arch/arm64/kernel/alternative.c
> > +++ b/arch/arm64/kernel/alternative.c
> > @@ -17,7 +17,7 @@
> >  #include <asm/sections.h>
> >  #include <linux/stop_machine.h>
> >  
> > -#define __ALT_PTR(a,f)		((void *)&(a)->f + (a)->f)
> > +#define __ALT_PTR(a, f)		((void *)&(a)->f + (a)->f)
> >  #define ALT_ORIG_PTR(a)		__ALT_PTR(a, orig_offset)
> >  #define ALT_REPL_PTR(a)		__ALT_PTR(a, alt_offset)
> >  
> > diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c
> > index 2e22443..e53493d 100644
> > --- a/arch/arm64/kernel/module-plts.c
> > +++ b/arch/arm64/kernel/module-plts.c
> > @@ -131,7 +131,7 @@ u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs,
> >  }
> >  #endif
> >  
> > -#define cmp_3way(a,b)	((a) < (b) ? -1 : (a) > (b))
> > +#define cmp_3way(a, b)	((a) < (b) ? -1 : (a) > (b))
> >  
> >  static int cmp_rela(const void *a, const void *b)
> >  {
> > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
> > index 3605f77a..d1fec4a 100644
> > --- a/arch/arm64/kernel/perf_event.c
> > +++ b/arch/arm64/kernel/perf_event.c
> > @@ -810,7 +810,7 @@ static int armv8pmu_get_single_idx(struct pmu_hw_events *cpuc,
> >  {
> >  	int idx;
> >  
> > -	for (idx = ARMV8_IDX_COUNTER0; idx < cpu_pmu->num_events; idx ++) {
> > +	for (idx = ARMV8_IDX_COUNTER0; idx < cpu_pmu->num_events; idx++) {
> >  		if (!test_and_set_bit(idx, cpuc->used_mask))
> >  			return idx;
> >  	}
> > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> > index 6616486..4cc1ccc 100644
> > --- a/arch/arm64/kernel/process.c
> > +++ b/arch/arm64/kernel/process.c
> > @@ -304,7 +304,7 @@ void __show_regs(struct pt_regs *regs)
> >  	}
> >  }
> >  
> > -void show_regs(struct pt_regs * regs)
> > +void show_regs(struct pt_regs *regs)
> >  {
> >  	__show_regs(regs);
> >  	dump_backtrace(regs, NULL, KERN_DEFAULT);
> > @@ -587,7 +587,7 @@ unsigned long get_wchan(struct task_struct *p)
> >  			ret = frame.pc;
> >  			goto out;
> >  		}
> > -	} while (count ++ < 16);
> > +	} while (count++ < 16);
> >  
> >  out:
> >  	put_task_stack(p);
> > -- 
> > 1.8.3.1
> > 






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

end of thread, other threads:[~2021-02-04  1:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  5:48 [PATCH 2/2] arm64/kernel: improve the coding style Zhiyuan Dai
2021-02-03 11:41 ` Mark Rutland
2021-02-04  1:40   ` 戴志远

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.