2023-03-15 13:45:11

by Menna Mahmoud

[permalink] [raw]
Subject: [PATCH v2 1/2] staging: vme_user: add space around operators

add a space before and after the operator, for readability.

Reported By checkpatch script:

" CHECK: spaces preferred around that '+', '<<' and '>>' ".

Signed-off-by: Menna Mahmoud <[email protected]>
----
changes in v2:
edit commit message
---
drivers/staging/vme_user/vme_tsi148.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index 482049cfc664..bfa604043355 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -737,7 +737,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
return 0;

if (!image->bus_resource.name) {
- image->bus_resource.name = kmalloc(VMENAMSIZ+3, GFP_ATOMIC);
+ image->bus_resource.name = kmalloc(VMENAMSIZ + 3, GFP_ATOMIC);
if (!image->bus_resource.name) {
retval = -ENOMEM;
goto err_name;
@@ -983,7 +983,7 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
goto err_aspace;
}

- temp_ctl &= ~(3<<4);
+ temp_ctl &= ~(3 << 4);
if (cycle & VME_SUPER)
temp_ctl |= TSI148_LCSR_OTAT_SUP;
if (cycle & VME_PROG)
@@ -2187,14 +2187,14 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,

/* Ensure that the CR/CSR is configured at the correct offset */
cbar = ioread32be(bridge->base + TSI148_CBAR);
- cbar = (cbar & TSI148_CRCSR_CBAR_M)>>3;
+ cbar = (cbar & TSI148_CRCSR_CBAR_M) >> 3;

vstat = tsi148_slot_get(tsi148_bridge);

if (cbar != vstat) {
cbar = vstat;
dev_info(tsi148_bridge->parent, "Setting CR/CSR offset\n");
- iowrite32be(cbar<<3, bridge->base + TSI148_CBAR);
+ iowrite32be(cbar << 3, bridge->base + TSI148_CBAR);
}
dev_info(tsi148_bridge->parent, "CR/CSR Offset: %d\n", cbar);

--
2.34.1



2023-03-15 13:45:14

by Menna Mahmoud

[permalink] [raw]
Subject: [PATCH v2 2/2] staging: vme_user: remove unnecessary blank lines

remove unnecessary blank lines before a close brace
as reported by checkpatch script

"CHECK: Blank lines aren't necessary before a close brace '}'"

Signed-off-by: Menna Mahmoud <[email protected]>
----
changes in v2:
edit commit message
---
drivers/staging/vme_user/vme_tsi148.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index bfa604043355..2f5eafd50934 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -1023,7 +1023,6 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
err_res:
err_window:
return retval;
-
}

/*
@@ -1741,7 +1740,6 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
list);
prev->descriptor.dnlau = cpu_to_be32(address_high);
prev->descriptor.dnlal = cpu_to_be32(address_low);
-
}

return 0;
@@ -1773,7 +1771,6 @@ static int tsi148_dma_busy(struct vme_bridge *tsi148_bridge, int channel)
return 0;
else
return 1;
-
}

/*
@@ -2220,7 +2217,6 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
}

return 0;
-
}

static void tsi148_crcsr_exit(struct vme_bridge *tsi148_bridge,
@@ -2530,7 +2526,6 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
kfree(tsi148_bridge);
err_struct:
return retval;
-
}

static void tsi148_remove(struct pci_dev *pdev)
--
2.34.1


2023-03-15 13:46:33

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: vme_user: remove unnecessary blank lines



On Wed, 15 Mar 2023, Menna Mahmoud wrote:

> remove unnecessary blank lines before a close brace
> as reported by checkpatch script
>
> "CHECK: Blank lines aren't necessary before a close brace '}'"
>
> Signed-off-by: Menna Mahmoud <[email protected]>
> ----

This should be three -s, not four.

> changes in v2:
> edit commit message
> ---

-s aren't needed here.

julia

> drivers/staging/vme_user/vme_tsi148.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
> index bfa604043355..2f5eafd50934 100644
> --- a/drivers/staging/vme_user/vme_tsi148.c
> +++ b/drivers/staging/vme_user/vme_tsi148.c
> @@ -1023,7 +1023,6 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
> err_res:
> err_window:
> return retval;
> -
> }
>
> /*
> @@ -1741,7 +1740,6 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
> list);
> prev->descriptor.dnlau = cpu_to_be32(address_high);
> prev->descriptor.dnlal = cpu_to_be32(address_low);
> -
> }
>
> return 0;
> @@ -1773,7 +1771,6 @@ static int tsi148_dma_busy(struct vme_bridge *tsi148_bridge, int channel)
> return 0;
> else
> return 1;
> -
> }
>
> /*
> @@ -2220,7 +2217,6 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
> }
>
> return 0;
> -
> }
>
> static void tsi148_crcsr_exit(struct vme_bridge *tsi148_bridge,
> @@ -2530,7 +2526,6 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> kfree(tsi148_bridge);
> err_struct:
> return retval;
> -
> }
>
> static void tsi148_remove(struct pci_dev *pdev)
> --
> 2.34.1
>
>
>

2023-03-15 13:50:32

by Menna Mahmoud

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: vme_user: remove unnecessary blank lines


On ١٥‏/٣‏/٢٠٢٣ ١٥:٤٥, Julia Lawall wrote:
>
> On Wed, 15 Mar 2023, Menna Mahmoud wrote:
>
>> remove unnecessary blank lines before a close brace
>> as reported by checkpatch script
>>
>> "CHECK: Blank lines aren't necessary before a close brace '}'"
>>
>> Signed-off-by: Menna Mahmoud <[email protected]>
>> ----
> This should be three -s, not four.
>
>> changes in v2:
>> edit commit message
>> ---
> -s aren't needed here.
>
> julia


I see, Thanks Julia

Menna


>
>> drivers/staging/vme_user/vme_tsi148.c | 5 -----
>> 1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
>> index bfa604043355..2f5eafd50934 100644
>> --- a/drivers/staging/vme_user/vme_tsi148.c
>> +++ b/drivers/staging/vme_user/vme_tsi148.c
>> @@ -1023,7 +1023,6 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
>> err_res:
>> err_window:
>> return retval;
>> -
>> }
>>
>> /*
>> @@ -1741,7 +1740,6 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
>> list);
>> prev->descriptor.dnlau = cpu_to_be32(address_high);
>> prev->descriptor.dnlal = cpu_to_be32(address_low);
>> -
>> }
>>
>> return 0;
>> @@ -1773,7 +1771,6 @@ static int tsi148_dma_busy(struct vme_bridge *tsi148_bridge, int channel)
>> return 0;
>> else
>> return 1;
>> -
>> }
>>
>> /*
>> @@ -2220,7 +2217,6 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
>> }
>>
>> return 0;
>> -
>> }
>>
>> static void tsi148_crcsr_exit(struct vme_bridge *tsi148_bridge,
>> @@ -2530,7 +2526,6 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>> kfree(tsi148_bridge);
>> err_struct:
>> return retval;
>> -
>> }
>>
>> static void tsi148_remove(struct pci_dev *pdev)
>> --
>> 2.34.1
>>
>>
>>

2023-03-15 19:22:48

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: vme_user: remove unnecessary blank lines

Menna Mahmoud wrote:
>
> On ١٥‏/٣‏/٢٠٢٣ ١٥:٤٥, Julia Lawall wrote:
> >
> > On Wed, 15 Mar 2023, Menna Mahmoud wrote:
> >
> >> remove unnecessary blank lines before a close brace
> >> as reported by checkpatch script
> >>
> >> "CHECK: Blank lines aren't necessary before a close brace '}'"
> >>
> >> Signed-off-by: Menna Mahmoud <[email protected]>
> >> ----
> > This should be three -s, not four.
> >
> >> changes in v2:
> >> edit commit message
> >> ---
> > -s aren't needed here.
> >
> > julia
>
>
> I see, Thanks Julia

I agree with Julia that they are not needed here but they also don't hurt
anything. git format-patch (or b4 etc) add another '---' to the commit
message automatically.

https://lore.kernel.org/all/[email protected]/

So assuming you had something like ...

<quote>
----
changes in v2:
edit commit message
</quote>

... in the patch commit message. That is perfectly ok and I would not
worry about the tools adding a second '---'.

But as Julia said you must make sure to have only 3 '-'s. :-D

Ira