2021-02-06 04:38:08

by Amy Parker

[permalink] [raw]
Subject: [PATCH] ia64: Fix style guide breakage

Some statements do not have proper spacing between their C
keywords (commonly if and for) throughout files in the ia64 tree.
This patch corrects this to follow the kernel code style guide.

Signed-off-by: Amy Parker <[email protected]>
---
arch/ia64/hp/common/sba_iommu.c | 6 +++---
arch/ia64/kernel/machine_kexec.c | 2 +-
arch/ia64/kernel/palinfo.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 9148ddbf02e5..84a410f3e68f 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -139,7 +139,7 @@

#ifdef ASSERT_PDIR_SANITY
#define ASSERT(expr) \
- if(!(expr)) { \
+ if (!(expr)) { \
printk( "\n" __FILE__ ":%d: Assertion " #expr " failed!\n",__LINE__); \
panic(#expr); \
}
@@ -510,7 +510,7 @@ sba_search_bitmap(struct ioc *ioc, struct device *dev,

if (likely(bits_wanted == 1)) {
unsigned int bitshiftcnt;
- for(; res_ptr < res_end ; res_ptr++) {
+ for (; res_ptr < res_end ; res_ptr++) {
if (likely(*res_ptr != ~0UL)) {
bitshiftcnt = ffz(*res_ptr);
*res_ptr |= (1UL << bitshiftcnt);
@@ -538,7 +538,7 @@ sba_search_bitmap(struct ioc *ioc, struct device *dev,
mask = base_mask << bitshiftcnt;

DBG_RES("%s() o %ld %p", __func__, o, res_ptr);
- for(; res_ptr < res_end ; res_ptr++)
+ for (; res_ptr < res_end ; res_ptr++)
{
DBG_RES(" %p %lx %lx\n", res_ptr, mask, *res_ptr);
ASSERT(0 != mask);
diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c
index efc9b568401c..8de286450578 100644
--- a/arch/ia64/kernel/machine_kexec.c
+++ b/arch/ia64/kernel/machine_kexec.c
@@ -137,7 +137,7 @@ void machine_kexec(struct kimage *image)
{
BUG_ON(!image);
unw_init_running(ia64_machine_kexec, image);
- for(;;);
+ for (;;);
}

void arch_crash_save_vmcoreinfo(void)
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 78fa6579c9ea..ec2ff3e510c0 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -155,7 +155,7 @@ static void bitregister_process(struct seq_file *m, u64 *reg_info, int max)

value >>= i = begin = ffs(value) - 1;

- for(; i < max; i++ ) {
+ for (; i < max; i++ ) {

if (i != 0 && (i%64) == 0) value = *++reg_info;

@@ -523,7 +523,7 @@ static void feature_set_info(struct seq_file *m, u64 avail, u64 status, u64 cont
int i;

vf = v = proc_features[set];
- for(i=0; i < 64; i++, avail >>=1, status >>=1, control >>=1) {
+ for (i=0; i < 64; i++, avail >>=1, status >>=1, control >>=1) {

if (!(control)) /* No remaining bits set */
break;
@@ -613,7 +613,7 @@ static int bus_info(struct seq_file *m)
status = st.pal_bus_features_val;
control = ct.pal_bus_features_val;

- for(i=0; i < 64; i++, v++, avail >>=1, status >>=1, control >>=1) {
+ for (i=0; i < 64; i++, v++, avail >>=1, status >>=1, control >>=1) {
if ( ! *v )
continue;
seq_printf(m, "%-48s : %s%s %s\n", *v,
--
2.29.2


Subject: Re: [PATCH] ia64: Fix style guide breakage

Hi Amy!

On 2/5/21 11:06 PM, Amy Parker wrote:
> Some statements do not have proper spacing between their C
> keywords (commonly if and for) throughout files in the ia64 tree.
> This patch corrects this to follow the kernel code style guide.
>
> Signed-off-by: Amy Parker <[email protected]>

I never noticed. Does the kernel coding style guideline actually require
space after "for" and "if" and similar statements but not before function
names?

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - [email protected]
`. `' Freie Universitaet Berlin - [email protected]
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

2021-02-06 19:33:18

by Amy Parker

[permalink] [raw]
Subject: Re: [PATCH] ia64: Fix style guide breakage

On Sat, Feb 6, 2021 at 8:07 AM John Paul Adrian Glaubitz
<[email protected]> wrote:
>
> Hi Amy!
>
> On 2/5/21 11:06 PM, Amy Parker wrote:
> > Some statements do not have proper spacing between their C
> > keywords (commonly if and for) throughout files in the ia64 tree.
> > This patch corrects this to follow the kernel code style guide.
> >
> > Signed-off-by: Amy Parker <[email protected]>
>
> I never noticed. Does the kernel coding style guideline actually require
> space after "for" and "if" and similar statements but not before function
> names?

Yes it does, actually!

> So use a space after these keywords:
> if, switch, case, for, do, while

> int system_is_up(void)
> {
> return system_state == SYSTEM_RUNNING;
> }


-Amy IP

2021-02-08 00:06:10

by David Sterba

[permalink] [raw]
Subject: Re: [PATCH] ia64: Fix style guide breakage

On Fri, Feb 05, 2021 at 02:06:18PM -0800, Amy Parker wrote:
> Some statements do not have proper spacing between their C
> keywords (commonly if and for) throughout files in the ia64 tree.
> This patch corrects this to follow the kernel code style guide.
>
> Signed-off-by: Amy Parker <[email protected]>
> ---
> arch/ia64/hp/common/sba_iommu.c | 6 +++---
> arch/ia64/kernel/machine_kexec.c | 2 +-
> arch/ia64/kernel/palinfo.c | 6 +++---

ia64 got orphaned and not maintained in 96ec72a3425d1515b6, it's just
not really worth the time to spend the time cleaning up the code base.