2023-10-18 07:25:11

by Calvince Otieno

[permalink] [raw]
Subject: [PATCH] staging: vme_user: fix coding style - remove CamelCasing

This patch addresses coding style errors identified by checkpatch. The
changes include converting camel case names in constant variables to
UPPERCASE. These changes align with the coding style guidelines.


Signed-off-by: Calvince Otieno <[email protected]>
---
drivers/staging/vme_user/vme.h | 12 ++--
drivers/staging/vme_user/vme_fake.c | 8 +--
drivers/staging/vme_user/vme_tsi148.c | 88 +++++++++++++--------------
3 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
index fbcbd0204453..0b40859fee23 100644
--- a/drivers/staging/vme_user/vme.h
+++ b/drivers/staging/vme_user/vme.h
@@ -33,13 +33,13 @@ enum vme_resource_type {
#define VME_SCT 0x1
#define VME_BLT 0x2
#define VME_MBLT 0x4
-#define VME_2eVME 0x8
-#define VME_2eSST 0x10
-#define VME_2eSSTB 0x20
+#define VME_2EVME 0x8
+#define VME_2ESST 0x10
+#define VME_2ESSTB 0x20

-#define VME_2eSST160 0x100
-#define VME_2eSST267 0x200
-#define VME_2eSST320 0x400
+#define VME_2ESST160 0x100
+#define VME_2ESST267 0x200
+#define VME_2ESST320 0x400

#define VME_SUPER 0x1000
#define VME_USER 0x2000
diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
index ae802d6dda7e..0e02c194298d 100644
--- a/drivers/staging/vme_user/vme_fake.c
+++ b/drivers/staging/vme_user/vme_fake.c
@@ -1108,8 +1108,8 @@ static int __init fake_init(void)
master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
VME_A64;
master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
- VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
- VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+ VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
+ VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
VME_PROG | VME_DATA;
master_image->width_attr = VME_D16 | VME_D32;
memset(&master_image->bus_resource, 0,
@@ -1135,8 +1135,8 @@ static int __init fake_init(void)
VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
VME_USER3 | VME_USER4;
slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
- VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
- VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+ VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
+ VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
VME_PROG | VME_DATA;
list_add_tail(&slave_image->list,
&fake_bridge->slave_resources);
diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index d549c22da534..859298aa1313 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -551,14 +551,14 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,

/* Setup 2eSST speeds */
temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M;
- switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
- case VME_2eSST160:
+ switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
+ case VME_2ESST160:
temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_160;
break;
- case VME_2eSST267:
+ case VME_2ESST267:
temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_267;
break;
- case VME_2eSST320:
+ case VME_2ESST320:
temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_320;
break;
}
@@ -569,11 +569,11 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
temp_ctl |= TSI148_LCSR_ITAT_BLT;
if (cycle & VME_MBLT)
temp_ctl |= TSI148_LCSR_ITAT_MBLT;
- if (cycle & VME_2eVME)
+ if (cycle & VME_2EVME)
temp_ctl |= TSI148_LCSR_ITAT_2eVME;
- if (cycle & VME_2eSST)
+ if (cycle & VME_2ESST)
temp_ctl |= TSI148_LCSR_ITAT_2eSST;
- if (cycle & VME_2eSSTB)
+ if (cycle & VME_2ESSTB)
temp_ctl |= TSI148_LCSR_ITAT_2eSSTB;

/* Setup address space */
@@ -673,22 +673,22 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
*size = (unsigned long long)((vme_bound - *vme_base) + granularity);

if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
- *cycle |= VME_2eSST160;
+ *cycle |= VME_2ESST160;
if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
- *cycle |= VME_2eSST267;
+ *cycle |= VME_2ESST267;
if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_320)
- *cycle |= VME_2eSST320;
+ *cycle |= VME_2ESST320;

if (ctl & TSI148_LCSR_ITAT_BLT)
*cycle |= VME_BLT;
if (ctl & TSI148_LCSR_ITAT_MBLT)
*cycle |= VME_MBLT;
if (ctl & TSI148_LCSR_ITAT_2eVME)
- *cycle |= VME_2eVME;
+ *cycle |= VME_2EVME;
if (ctl & TSI148_LCSR_ITAT_2eSST)
- *cycle |= VME_2eSST;
+ *cycle |= VME_2ESST;
if (ctl & TSI148_LCSR_ITAT_2eSSTB)
- *cycle |= VME_2eSSTB;
+ *cycle |= VME_2ESSTB;

if (ctl & TSI148_LCSR_ITAT_SUPR)
*cycle |= VME_SUPER;
@@ -895,14 +895,14 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,

/* Setup 2eSST speeds */
temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M;
- switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
- case VME_2eSST160:
+ switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
+ case VME_2ESST160:
temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_160;
break;
- case VME_2eSST267:
+ case VME_2ESST267:
temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_267;
break;
- case VME_2eSST320:
+ case VME_2ESST320:
temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_320;
break;
}
@@ -916,15 +916,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
temp_ctl |= TSI148_LCSR_OTAT_TM_MBLT;
}
- if (cycle & VME_2eVME) {
+ if (cycle & VME_2EVME) {
temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
temp_ctl |= TSI148_LCSR_OTAT_TM_2eVME;
}
- if (cycle & VME_2eSST) {
+ if (cycle & VME_2ESST) {
temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
temp_ctl |= TSI148_LCSR_OTAT_TM_2eSST;
}
- if (cycle & VME_2eSSTB) {
+ if (cycle & VME_2ESSTB) {
dev_warn(tsi148_bridge->parent, "Currently not setting Broadcast Select Registers\n");
temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
temp_ctl |= TSI148_LCSR_OTAT_TM_2eSSTB;
@@ -1100,11 +1100,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,

/* Setup 2eSST speeds */
if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_160)
- *cycle |= VME_2eSST160;
+ *cycle |= VME_2ESST160;
if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_267)
- *cycle |= VME_2eSST267;
+ *cycle |= VME_2ESST267;
if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_320)
- *cycle |= VME_2eSST320;
+ *cycle |= VME_2ESST320;

/* Setup cycle types */
if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_SCT)
@@ -1114,11 +1114,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_MBLT)
*cycle |= VME_MBLT;
if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eVME)
- *cycle |= VME_2eVME;
+ *cycle |= VME_2EVME;
if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSST)
- *cycle |= VME_2eSST;
+ *cycle |= VME_2ESST;
if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSSTB)
- *cycle |= VME_2eSSTB;
+ *cycle |= VME_2ESSTB;

if (ctl & TSI148_LCSR_OTAT_SUP)
*cycle |= VME_SUPER;
@@ -1406,14 +1406,14 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
val = be32_to_cpu(*attr);

/* Setup 2eSST speeds */
- switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
- case VME_2eSST160:
+ switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
+ case VME_2ESST160:
val |= TSI148_LCSR_DSAT_2eSSTM_160;
break;
- case VME_2eSST267:
+ case VME_2ESST267:
val |= TSI148_LCSR_DSAT_2eSSTM_267;
break;
- case VME_2eSST320:
+ case VME_2ESST320:
val |= TSI148_LCSR_DSAT_2eSSTM_320;
break;
}
@@ -1428,13 +1428,13 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
if (cycle & VME_MBLT)
val |= TSI148_LCSR_DSAT_TM_MBLT;

- if (cycle & VME_2eVME)
+ if (cycle & VME_2EVME)
val |= TSI148_LCSR_DSAT_TM_2eVME;

- if (cycle & VME_2eSST)
+ if (cycle & VME_2ESST)
val |= TSI148_LCSR_DSAT_TM_2eSST;

- if (cycle & VME_2eSSTB) {
+ if (cycle & VME_2ESSTB) {
dev_err(dev, "Currently not setting Broadcast Select Registers\n");
val |= TSI148_LCSR_DSAT_TM_2eSSTB;
}
@@ -1504,14 +1504,14 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
val = be32_to_cpu(*attr);

/* Setup 2eSST speeds */
- switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
- case VME_2eSST160:
+ switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
+ case VME_2ESST160:
val |= TSI148_LCSR_DDAT_2eSSTM_160;
break;
- case VME_2eSST267:
+ case VME_2ESST267:
val |= TSI148_LCSR_DDAT_2eSSTM_267;
break;
- case VME_2eSST320:
+ case VME_2ESST320:
val |= TSI148_LCSR_DDAT_2eSSTM_320;
break;
}
@@ -1526,13 +1526,13 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
if (cycle & VME_MBLT)
val |= TSI148_LCSR_DDAT_TM_MBLT;

- if (cycle & VME_2eVME)
+ if (cycle & VME_2EVME)
val |= TSI148_LCSR_DDAT_TM_2eVME;

- if (cycle & VME_2eSST)
+ if (cycle & VME_2ESST)
val |= TSI148_LCSR_DDAT_TM_2eSST;

- if (cycle & VME_2eSSTB) {
+ if (cycle & VME_2ESSTB) {
dev_err(dev, "Currently not setting Broadcast Select Registers\n");
val |= TSI148_LCSR_DDAT_TM_2eSSTB;
}
@@ -2359,8 +2359,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
VME_USER3 | VME_USER4;
master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
- VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
- VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+ VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
+ VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
VME_PROG | VME_DATA;
master_image->width_attr = VME_D16 | VME_D32;
memset(&master_image->bus_resource, 0,
@@ -2384,8 +2384,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
VME_A64;
slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
- VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
- VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+ VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
+ VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
VME_PROG | VME_DATA;
list_add_tail(&slave_image->list,
&tsi148_bridge->slave_resources);
--
2.34.1


2023-10-18 07:28:03

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH] staging: vme_user: fix coding style - remove CamelCasing



On Wed, 18 Oct 2023, Calvince Otieno wrote:

> This patch addresses coding style errors identified by checkpatch. The
> changes include converting camel case names in constant variables to
> UPPERCASE. These changes align with the coding style guidelines.

Did someone suggest this? It looks like the lowercase e might be related
to something in the device documentation?

julia

>
>
> Signed-off-by: Calvince Otieno <[email protected]>
> ---
> drivers/staging/vme_user/vme.h | 12 ++--
> drivers/staging/vme_user/vme_fake.c | 8 +--
> drivers/staging/vme_user/vme_tsi148.c | 88 +++++++++++++--------------
> 3 files changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
> index fbcbd0204453..0b40859fee23 100644
> --- a/drivers/staging/vme_user/vme.h
> +++ b/drivers/staging/vme_user/vme.h
> @@ -33,13 +33,13 @@ enum vme_resource_type {
> #define VME_SCT 0x1
> #define VME_BLT 0x2
> #define VME_MBLT 0x4
> -#define VME_2eVME 0x8
> -#define VME_2eSST 0x10
> -#define VME_2eSSTB 0x20
> +#define VME_2EVME 0x8
> +#define VME_2ESST 0x10
> +#define VME_2ESSTB 0x20
>
> -#define VME_2eSST160 0x100
> -#define VME_2eSST267 0x200
> -#define VME_2eSST320 0x400
> +#define VME_2ESST160 0x100
> +#define VME_2ESST267 0x200
> +#define VME_2ESST320 0x400
>
> #define VME_SUPER 0x1000
> #define VME_USER 0x2000
> diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
> index ae802d6dda7e..0e02c194298d 100644
> --- a/drivers/staging/vme_user/vme_fake.c
> +++ b/drivers/staging/vme_user/vme_fake.c
> @@ -1108,8 +1108,8 @@ static int __init fake_init(void)
> master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> VME_A64;
> master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> master_image->width_attr = VME_D16 | VME_D32;
> memset(&master_image->bus_resource, 0,
> @@ -1135,8 +1135,8 @@ static int __init fake_init(void)
> VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
> VME_USER3 | VME_USER4;
> slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> list_add_tail(&slave_image->list,
> &fake_bridge->slave_resources);
> diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
> index d549c22da534..859298aa1313 100644
> --- a/drivers/staging/vme_user/vme_tsi148.c
> +++ b/drivers/staging/vme_user/vme_tsi148.c
> @@ -551,14 +551,14 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
>
> /* Setup 2eSST speeds */
> temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M;
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_320;
> break;
> }
> @@ -569,11 +569,11 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
> temp_ctl |= TSI148_LCSR_ITAT_BLT;
> if (cycle & VME_MBLT)
> temp_ctl |= TSI148_LCSR_ITAT_MBLT;
> - if (cycle & VME_2eVME)
> + if (cycle & VME_2EVME)
> temp_ctl |= TSI148_LCSR_ITAT_2eVME;
> - if (cycle & VME_2eSST)
> + if (cycle & VME_2ESST)
> temp_ctl |= TSI148_LCSR_ITAT_2eSST;
> - if (cycle & VME_2eSSTB)
> + if (cycle & VME_2ESSTB)
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTB;
>
> /* Setup address space */
> @@ -673,22 +673,22 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
> *size = (unsigned long long)((vme_bound - *vme_base) + granularity);
>
> if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
> - *cycle |= VME_2eSST160;
> + *cycle |= VME_2ESST160;
> if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
> - *cycle |= VME_2eSST267;
> + *cycle |= VME_2ESST267;
> if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_320)
> - *cycle |= VME_2eSST320;
> + *cycle |= VME_2ESST320;
>
> if (ctl & TSI148_LCSR_ITAT_BLT)
> *cycle |= VME_BLT;
> if (ctl & TSI148_LCSR_ITAT_MBLT)
> *cycle |= VME_MBLT;
> if (ctl & TSI148_LCSR_ITAT_2eVME)
> - *cycle |= VME_2eVME;
> + *cycle |= VME_2EVME;
> if (ctl & TSI148_LCSR_ITAT_2eSST)
> - *cycle |= VME_2eSST;
> + *cycle |= VME_2ESST;
> if (ctl & TSI148_LCSR_ITAT_2eSSTB)
> - *cycle |= VME_2eSSTB;
> + *cycle |= VME_2ESSTB;
>
> if (ctl & TSI148_LCSR_ITAT_SUPR)
> *cycle |= VME_SUPER;
> @@ -895,14 +895,14 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
>
> /* Setup 2eSST speeds */
> temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M;
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_320;
> break;
> }
> @@ -916,15 +916,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_MBLT;
> }
> - if (cycle & VME_2eVME) {
> + if (cycle & VME_2EVME) {
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_2eVME;
> }
> - if (cycle & VME_2eSST) {
> + if (cycle & VME_2ESST) {
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_2eSST;
> }
> - if (cycle & VME_2eSSTB) {
> + if (cycle & VME_2ESSTB) {
> dev_warn(tsi148_bridge->parent, "Currently not setting Broadcast Select Registers\n");
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_2eSSTB;
> @@ -1100,11 +1100,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
>
> /* Setup 2eSST speeds */
> if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_160)
> - *cycle |= VME_2eSST160;
> + *cycle |= VME_2ESST160;
> if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_267)
> - *cycle |= VME_2eSST267;
> + *cycle |= VME_2ESST267;
> if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_320)
> - *cycle |= VME_2eSST320;
> + *cycle |= VME_2ESST320;
>
> /* Setup cycle types */
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_SCT)
> @@ -1114,11 +1114,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_MBLT)
> *cycle |= VME_MBLT;
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eVME)
> - *cycle |= VME_2eVME;
> + *cycle |= VME_2EVME;
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSST)
> - *cycle |= VME_2eSST;
> + *cycle |= VME_2ESST;
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSSTB)
> - *cycle |= VME_2eSSTB;
> + *cycle |= VME_2ESSTB;
>
> if (ctl & TSI148_LCSR_OTAT_SUP)
> *cycle |= VME_SUPER;
> @@ -1406,14 +1406,14 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
> val = be32_to_cpu(*attr);
>
> /* Setup 2eSST speeds */
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> val |= TSI148_LCSR_DSAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> val |= TSI148_LCSR_DSAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> val |= TSI148_LCSR_DSAT_2eSSTM_320;
> break;
> }
> @@ -1428,13 +1428,13 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
> if (cycle & VME_MBLT)
> val |= TSI148_LCSR_DSAT_TM_MBLT;
>
> - if (cycle & VME_2eVME)
> + if (cycle & VME_2EVME)
> val |= TSI148_LCSR_DSAT_TM_2eVME;
>
> - if (cycle & VME_2eSST)
> + if (cycle & VME_2ESST)
> val |= TSI148_LCSR_DSAT_TM_2eSST;
>
> - if (cycle & VME_2eSSTB) {
> + if (cycle & VME_2ESSTB) {
> dev_err(dev, "Currently not setting Broadcast Select Registers\n");
> val |= TSI148_LCSR_DSAT_TM_2eSSTB;
> }
> @@ -1504,14 +1504,14 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
> val = be32_to_cpu(*attr);
>
> /* Setup 2eSST speeds */
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> val |= TSI148_LCSR_DDAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> val |= TSI148_LCSR_DDAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> val |= TSI148_LCSR_DDAT_2eSSTM_320;
> break;
> }
> @@ -1526,13 +1526,13 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
> if (cycle & VME_MBLT)
> val |= TSI148_LCSR_DDAT_TM_MBLT;
>
> - if (cycle & VME_2eVME)
> + if (cycle & VME_2EVME)
> val |= TSI148_LCSR_DDAT_TM_2eVME;
>
> - if (cycle & VME_2eSST)
> + if (cycle & VME_2ESST)
> val |= TSI148_LCSR_DDAT_TM_2eSST;
>
> - if (cycle & VME_2eSSTB) {
> + if (cycle & VME_2ESSTB) {
> dev_err(dev, "Currently not setting Broadcast Select Registers\n");
> val |= TSI148_LCSR_DDAT_TM_2eSSTB;
> }
> @@ -2359,8 +2359,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
> VME_USER3 | VME_USER4;
> master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> master_image->width_attr = VME_D16 | VME_D32;
> memset(&master_image->bus_resource, 0,
> @@ -2384,8 +2384,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> VME_A64;
> slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> list_add_tail(&slave_image->list,
> &tsi148_bridge->slave_resources);
> --
> 2.34.1
>
>

2023-10-18 07:29:37

by Calvince Otieno

[permalink] [raw]
Subject: Re: [PATCH] staging: vme_user: fix coding style - remove CamelCasing

On Wed, Oct 18, 2023 at 10:27 AM Julia Lawall <[email protected]> wrote:
>
>
>
> On Wed, 18 Oct 2023, Calvince Otieno wrote:
>
> > This patch addresses coding style errors identified by checkpatch. The
> > changes include converting camel case names in constant variables to
> > UPPERCASE. These changes align with the coding style guidelines.
>
> Did someone suggest this? It looks like the lowercase e might be related
> to something in the device documentation?
>
> julia
>
> >
> >
> > Signed-off-by: Calvince Otieno <[email protected]>
> > ---
> > drivers/staging/vme_user/vme.h | 12 ++--
> > drivers/staging/vme_user/vme_fake.c | 8 +--
> > drivers/staging/vme_user/vme_tsi148.c | 88 +++++++++++++--------------
> > 3 files changed, 54 insertions(+), 54 deletions(-)
> >
> > diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
> > index fbcbd0204453..0b40859fee23 100644
> > --- a/drivers/staging/vme_user/vme.h
> > +++ b/drivers/staging/vme_user/vme.h
> > @@ -33,13 +33,13 @@ enum vme_resource_type {
> > #define VME_SCT 0x1
> > #define VME_BLT 0x2
> > #define VME_MBLT 0x4
> > -#define VME_2eVME 0x8
> > -#define VME_2eSST 0x10
> > -#define VME_2eSSTB 0x20
> > +#define VME_2EVME 0x8
> > +#define VME_2ESST 0x10
> > +#define VME_2ESSTB 0x20
> >
> > -#define VME_2eSST160 0x100
> > -#define VME_2eSST267 0x200
> > -#define VME_2eSST320 0x400
> > +#define VME_2ESST160 0x100
> > +#define VME_2ESST267 0x200
> > +#define VME_2ESST320 0x400
> >
> > #define VME_SUPER 0x1000
> > #define VME_USER 0x2000
> > diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
> > index ae802d6dda7e..0e02c194298d 100644
> > --- a/drivers/staging/vme_user/vme_fake.c
> > +++ b/drivers/staging/vme_user/vme_fake.c
> > @@ -1108,8 +1108,8 @@ static int __init fake_init(void)
> > master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> > VME_A64;
> > master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> > - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> > - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> > + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> > + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> > VME_PROG | VME_DATA;
> > master_image->width_attr = VME_D16 | VME_D32;
> > memset(&master_image->bus_resource, 0,
> > @@ -1135,8 +1135,8 @@ static int __init fake_init(void)
> > VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
> > VME_USER3 | VME_USER4;
> > slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> > - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> > - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> > + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> > + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> > VME_PROG | VME_DATA;
> > list_add_tail(&slave_image->list,
> > &fake_bridge->slave_resources);
> > diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
> > index d549c22da534..859298aa1313 100644
> > --- a/drivers/staging/vme_user/vme_tsi148.c
> > +++ b/drivers/staging/vme_user/vme_tsi148.c
> > @@ -551,14 +551,14 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
> >
> > /* Setup 2eSST speeds */
> > temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M;
> > - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> > - case VME_2eSST160:
> > + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> > + case VME_2ESST160:
> > temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_160;
> > break;
> > - case VME_2eSST267:
> > + case VME_2ESST267:
> > temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_267;
> > break;
> > - case VME_2eSST320:
> > + case VME_2ESST320:
> > temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_320;
> > break;
> > }
> > @@ -569,11 +569,11 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
> > temp_ctl |= TSI148_LCSR_ITAT_BLT;
> > if (cycle & VME_MBLT)
> > temp_ctl |= TSI148_LCSR_ITAT_MBLT;
> > - if (cycle & VME_2eVME)
> > + if (cycle & VME_2EVME)
> > temp_ctl |= TSI148_LCSR_ITAT_2eVME;
> > - if (cycle & VME_2eSST)
> > + if (cycle & VME_2ESST)
> > temp_ctl |= TSI148_LCSR_ITAT_2eSST;
> > - if (cycle & VME_2eSSTB)
> > + if (cycle & VME_2ESSTB)
> > temp_ctl |= TSI148_LCSR_ITAT_2eSSTB;
> >
> > /* Setup address space */
> > @@ -673,22 +673,22 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
> > *size = (unsigned long long)((vme_bound - *vme_base) + granularity);
> >
> > if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
> > - *cycle |= VME_2eSST160;
> > + *cycle |= VME_2ESST160;
> > if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
> > - *cycle |= VME_2eSST267;
> > + *cycle |= VME_2ESST267;
> > if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_320)
> > - *cycle |= VME_2eSST320;
> > + *cycle |= VME_2ESST320;
> >
> > if (ctl & TSI148_LCSR_ITAT_BLT)
> > *cycle |= VME_BLT;
> > if (ctl & TSI148_LCSR_ITAT_MBLT)
> > *cycle |= VME_MBLT;
> > if (ctl & TSI148_LCSR_ITAT_2eVME)
> > - *cycle |= VME_2eVME;
> > + *cycle |= VME_2EVME;
> > if (ctl & TSI148_LCSR_ITAT_2eSST)
> > - *cycle |= VME_2eSST;
> > + *cycle |= VME_2ESST;
> > if (ctl & TSI148_LCSR_ITAT_2eSSTB)
> > - *cycle |= VME_2eSSTB;
> > + *cycle |= VME_2ESSTB;
> >
> > if (ctl & TSI148_LCSR_ITAT_SUPR)
> > *cycle |= VME_SUPER;
> > @@ -895,14 +895,14 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
> >
> > /* Setup 2eSST speeds */
> > temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M;
> > - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> > - case VME_2eSST160:
> > + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> > + case VME_2ESST160:
> > temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_160;
> > break;
> > - case VME_2eSST267:
> > + case VME_2ESST267:
> > temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_267;
> > break;
> > - case VME_2eSST320:
> > + case VME_2ESST320:
> > temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_320;
> > break;
> > }
> > @@ -916,15 +916,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
> > temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> > temp_ctl |= TSI148_LCSR_OTAT_TM_MBLT;
> > }
> > - if (cycle & VME_2eVME) {
> > + if (cycle & VME_2EVME) {
> > temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> > temp_ctl |= TSI148_LCSR_OTAT_TM_2eVME;
> > }
> > - if (cycle & VME_2eSST) {
> > + if (cycle & VME_2ESST) {
> > temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> > temp_ctl |= TSI148_LCSR_OTAT_TM_2eSST;
> > }
> > - if (cycle & VME_2eSSTB) {
> > + if (cycle & VME_2ESSTB) {
> > dev_warn(tsi148_bridge->parent, "Currently not setting Broadcast Select Registers\n");
> > temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> > temp_ctl |= TSI148_LCSR_OTAT_TM_2eSSTB;
> > @@ -1100,11 +1100,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
> >
> > /* Setup 2eSST speeds */
> > if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_160)
> > - *cycle |= VME_2eSST160;
> > + *cycle |= VME_2ESST160;
> > if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_267)
> > - *cycle |= VME_2eSST267;
> > + *cycle |= VME_2ESST267;
> > if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_320)
> > - *cycle |= VME_2eSST320;
> > + *cycle |= VME_2ESST320;
> >
> > /* Setup cycle types */
> > if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_SCT)
> > @@ -1114,11 +1114,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
> > if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_MBLT)
> > *cycle |= VME_MBLT;
> > if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eVME)
> > - *cycle |= VME_2eVME;
> > + *cycle |= VME_2EVME;
> > if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSST)
> > - *cycle |= VME_2eSST;
> > + *cycle |= VME_2ESST;
> > if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSSTB)
> > - *cycle |= VME_2eSSTB;
> > + *cycle |= VME_2ESSTB;
> >
> > if (ctl & TSI148_LCSR_OTAT_SUP)
> > *cycle |= VME_SUPER;
> > @@ -1406,14 +1406,14 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
> > val = be32_to_cpu(*attr);
> >
> > /* Setup 2eSST speeds */
> > - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> > - case VME_2eSST160:
> > + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> > + case VME_2ESST160:
> > val |= TSI148_LCSR_DSAT_2eSSTM_160;
> > break;
> > - case VME_2eSST267:
> > + case VME_2ESST267:
> > val |= TSI148_LCSR_DSAT_2eSSTM_267;
> > break;
> > - case VME_2eSST320:
> > + case VME_2ESST320:
> > val |= TSI148_LCSR_DSAT_2eSSTM_320;
> > break;
> > }
> > @@ -1428,13 +1428,13 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
> > if (cycle & VME_MBLT)
> > val |= TSI148_LCSR_DSAT_TM_MBLT;
> >
> > - if (cycle & VME_2eVME)
> > + if (cycle & VME_2EVME)
> > val |= TSI148_LCSR_DSAT_TM_2eVME;
> >
> > - if (cycle & VME_2eSST)
> > + if (cycle & VME_2ESST)
> > val |= TSI148_LCSR_DSAT_TM_2eSST;
> >
> > - if (cycle & VME_2eSSTB) {
> > + if (cycle & VME_2ESSTB) {
> > dev_err(dev, "Currently not setting Broadcast Select Registers\n");
> > val |= TSI148_LCSR_DSAT_TM_2eSSTB;
> > }
> > @@ -1504,14 +1504,14 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
> > val = be32_to_cpu(*attr);
> >
> > /* Setup 2eSST speeds */
> > - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> > - case VME_2eSST160:
> > + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> > + case VME_2ESST160:
> > val |= TSI148_LCSR_DDAT_2eSSTM_160;
> > break;
> > - case VME_2eSST267:
> > + case VME_2ESST267:
> > val |= TSI148_LCSR_DDAT_2eSSTM_267;
> > break;
> > - case VME_2eSST320:
> > + case VME_2ESST320:
> > val |= TSI148_LCSR_DDAT_2eSSTM_320;
> > break;
> > }
> > @@ -1526,13 +1526,13 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
> > if (cycle & VME_MBLT)
> > val |= TSI148_LCSR_DDAT_TM_MBLT;
> >
> > - if (cycle & VME_2eVME)
> > + if (cycle & VME_2EVME)
> > val |= TSI148_LCSR_DDAT_TM_2eVME;
> >
> > - if (cycle & VME_2eSST)
> > + if (cycle & VME_2ESST)
> > val |= TSI148_LCSR_DDAT_TM_2eSST;
> >
> > - if (cycle & VME_2eSSTB) {
> > + if (cycle & VME_2ESSTB) {
> > dev_err(dev, "Currently not setting Broadcast Select Registers\n");
> > val |= TSI148_LCSR_DDAT_TM_2eSSTB;
> > }
> > @@ -2359,8 +2359,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> > VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
> > VME_USER3 | VME_USER4;
> > master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> > - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> > - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> > + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> > + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> > VME_PROG | VME_DATA;
> > master_image->width_attr = VME_D16 | VME_D32;
> > memset(&master_image->bus_resource, 0,
> > @@ -2384,8 +2384,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> > slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> > VME_A64;
> > slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> > - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> > - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> > + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> > + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> > VME_PROG | VME_DATA;
> > list_add_tail(&slave_image->list,
> > &tsi148_bridge->slave_resources);
> > --
> > 2.34.1
> >
> >


As description states, checkpatch recommendation
--
Kind regards,
Calvince Otieno

2023-10-18 07:40:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: vme_user: fix coding style - remove CamelCasing

On Wed, Oct 18, 2023 at 10:22:50AM +0300, Calvince Otieno wrote:
> This patch addresses coding style errors identified by checkpatch. The
> changes include converting camel case names in constant variables to
> UPPERCASE. These changes align with the coding style guidelines.
>
>
> Signed-off-by: Calvince Otieno <[email protected]>
> ---
> drivers/staging/vme_user/vme.h | 12 ++--
> drivers/staging/vme_user/vme_fake.c | 8 +--
> drivers/staging/vme_user/vme_tsi148.c | 88 +++++++++++++--------------
> 3 files changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
> index fbcbd0204453..0b40859fee23 100644
> --- a/drivers/staging/vme_user/vme.h
> +++ b/drivers/staging/vme_user/vme.h
> @@ -33,13 +33,13 @@ enum vme_resource_type {
> #define VME_SCT 0x1
> #define VME_BLT 0x2
> #define VME_MBLT 0x4
> -#define VME_2eVME 0x8
> -#define VME_2eSST 0x10
> -#define VME_2eSSTB 0x20
> +#define VME_2EVME 0x8
> +#define VME_2ESST 0x10
> +#define VME_2ESSTB 0x20

Checkpatch is wrong here, this should stay as-is.

thanks,

greg k-h

2023-10-18 07:47:35

by Karolina Stolarek

[permalink] [raw]
Subject: Re: [PATCH] staging: vme_user: fix coding style - remove CamelCasing

On 18.10.2023 09:22, Calvince Otieno wrote:
> This patch addresses coding style errors identified by checkpatch. The
> changes include converting camel case names in constant variables to
> UPPERCASE. These changes align with the coding style guidelines.
>
>
> Signed-off-by: Calvince Otieno <[email protected]>
About the subject line -- I'd drop "fix coding style" and wrote about
the specific change you did in the patch (macro rename? Variable
rename?). "CamelCasing" should be simply "CamelCase", I think.

And a small nit -- just one blank line between the commit message and
SoB will suffice.

> ---
> drivers/staging/vme_user/vme.h | 12 ++--
> drivers/staging/vme_user/vme_fake.c | 8 +--
> drivers/staging/vme_user/vme_tsi148.c | 88 +++++++++++++--------------
> 3 files changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
> index fbcbd0204453..0b40859fee23 100644
> --- a/drivers/staging/vme_user/vme.h
> +++ b/drivers/staging/vme_user/vme.h
> @@ -33,13 +33,13 @@ enum vme_resource_type {
> #define VME_SCT 0x1
> #define VME_BLT 0x2
> #define VME_MBLT 0x4
> -#define VME_2eVME 0x8
> -#define VME_2eSST 0x10
> -#define VME_2eSSTB 0x20
> +#define VME_2EVME 0x8
> +#define VME_2ESST 0x10
> +#define VME_2ESSTB 0x20
>
> -#define VME_2eSST160 0x100
> -#define VME_2eSST267 0x200
> -#define VME_2eSST320 0x400
> +#define VME_2ESST160 0x100
> +#define VME_2ESST267 0x200
> +#define VME_2ESST320 0x400
>
> #define VME_SUPER 0x1000
> #define VME_USER 0x2000
> diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
> index ae802d6dda7e..0e02c194298d 100644
> --- a/drivers/staging/vme_user/vme_fake.c
> +++ b/drivers/staging/vme_user/vme_fake.c
> @@ -1108,8 +1108,8 @@ static int __init fake_init(void)
> master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> VME_A64;
> master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;

I just did a quick search, and it seems like "2eSST320", "2eSST233" and
"2eSST160" refer to bus names, so I'd keep them as they are in the code.

For the future, if you're not certain the meaning of a definition in a
driver, you can always look it up. If you're lucky, you might find
documentation for the hardware, or some article about it.

All the best,
Karolina

> master_image->width_attr = VME_D16 | VME_D32;
> memset(&master_image->bus_resource, 0,
> @@ -1135,8 +1135,8 @@ static int __init fake_init(void)
> VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
> VME_USER3 | VME_USER4;
> slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> list_add_tail(&slave_image->list,
> &fake_bridge->slave_resources);
> diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
> index d549c22da534..859298aa1313 100644
> --- a/drivers/staging/vme_user/vme_tsi148.c
> +++ b/drivers/staging/vme_user/vme_tsi148.c
> @@ -551,14 +551,14 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
>
> /* Setup 2eSST speeds */
> temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M;
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_320;
> break;
> }
> @@ -569,11 +569,11 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
> temp_ctl |= TSI148_LCSR_ITAT_BLT;
> if (cycle & VME_MBLT)
> temp_ctl |= TSI148_LCSR_ITAT_MBLT;
> - if (cycle & VME_2eVME)
> + if (cycle & VME_2EVME)
> temp_ctl |= TSI148_LCSR_ITAT_2eVME;
> - if (cycle & VME_2eSST)
> + if (cycle & VME_2ESST)
> temp_ctl |= TSI148_LCSR_ITAT_2eSST;
> - if (cycle & VME_2eSSTB)
> + if (cycle & VME_2ESSTB)
> temp_ctl |= TSI148_LCSR_ITAT_2eSSTB;
>
> /* Setup address space */
> @@ -673,22 +673,22 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
> *size = (unsigned long long)((vme_bound - *vme_base) + granularity);
>
> if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
> - *cycle |= VME_2eSST160;
> + *cycle |= VME_2ESST160;
> if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
> - *cycle |= VME_2eSST267;
> + *cycle |= VME_2ESST267;
> if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_320)
> - *cycle |= VME_2eSST320;
> + *cycle |= VME_2ESST320;
>
> if (ctl & TSI148_LCSR_ITAT_BLT)
> *cycle |= VME_BLT;
> if (ctl & TSI148_LCSR_ITAT_MBLT)
> *cycle |= VME_MBLT;
> if (ctl & TSI148_LCSR_ITAT_2eVME)
> - *cycle |= VME_2eVME;
> + *cycle |= VME_2EVME;
> if (ctl & TSI148_LCSR_ITAT_2eSST)
> - *cycle |= VME_2eSST;
> + *cycle |= VME_2ESST;
> if (ctl & TSI148_LCSR_ITAT_2eSSTB)
> - *cycle |= VME_2eSSTB;
> + *cycle |= VME_2ESSTB;
>
> if (ctl & TSI148_LCSR_ITAT_SUPR)
> *cycle |= VME_SUPER;
> @@ -895,14 +895,14 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
>
> /* Setup 2eSST speeds */
> temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M;
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_320;
> break;
> }
> @@ -916,15 +916,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_MBLT;
> }
> - if (cycle & VME_2eVME) {
> + if (cycle & VME_2EVME) {
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_2eVME;
> }
> - if (cycle & VME_2eSST) {
> + if (cycle & VME_2ESST) {
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_2eSST;
> }
> - if (cycle & VME_2eSSTB) {
> + if (cycle & VME_2ESSTB) {
> dev_warn(tsi148_bridge->parent, "Currently not setting Broadcast Select Registers\n");
> temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
> temp_ctl |= TSI148_LCSR_OTAT_TM_2eSSTB;
> @@ -1100,11 +1100,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
>
> /* Setup 2eSST speeds */
> if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_160)
> - *cycle |= VME_2eSST160;
> + *cycle |= VME_2ESST160;
> if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_267)
> - *cycle |= VME_2eSST267;
> + *cycle |= VME_2ESST267;
> if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_320)
> - *cycle |= VME_2eSST320;
> + *cycle |= VME_2ESST320;
>
> /* Setup cycle types */
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_SCT)
> @@ -1114,11 +1114,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_MBLT)
> *cycle |= VME_MBLT;
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eVME)
> - *cycle |= VME_2eVME;
> + *cycle |= VME_2EVME;
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSST)
> - *cycle |= VME_2eSST;
> + *cycle |= VME_2ESST;
> if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSSTB)
> - *cycle |= VME_2eSSTB;
> + *cycle |= VME_2ESSTB;
>
> if (ctl & TSI148_LCSR_OTAT_SUP)
> *cycle |= VME_SUPER;
> @@ -1406,14 +1406,14 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
> val = be32_to_cpu(*attr);
>
> /* Setup 2eSST speeds */
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> val |= TSI148_LCSR_DSAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> val |= TSI148_LCSR_DSAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> val |= TSI148_LCSR_DSAT_2eSSTM_320;
> break;
> }
> @@ -1428,13 +1428,13 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
> if (cycle & VME_MBLT)
> val |= TSI148_LCSR_DSAT_TM_MBLT;
>
> - if (cycle & VME_2eVME)
> + if (cycle & VME_2EVME)
> val |= TSI148_LCSR_DSAT_TM_2eVME;
>
> - if (cycle & VME_2eSST)
> + if (cycle & VME_2ESST)
> val |= TSI148_LCSR_DSAT_TM_2eSST;
>
> - if (cycle & VME_2eSSTB) {
> + if (cycle & VME_2ESSTB) {
> dev_err(dev, "Currently not setting Broadcast Select Registers\n");
> val |= TSI148_LCSR_DSAT_TM_2eSSTB;
> }
> @@ -1504,14 +1504,14 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
> val = be32_to_cpu(*attr);
>
> /* Setup 2eSST speeds */
> - switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
> - case VME_2eSST160:
> + switch (cycle & (VME_2ESST160 | VME_2ESST267 | VME_2ESST320)) {
> + case VME_2ESST160:
> val |= TSI148_LCSR_DDAT_2eSSTM_160;
> break;
> - case VME_2eSST267:
> + case VME_2ESST267:
> val |= TSI148_LCSR_DDAT_2eSSTM_267;
> break;
> - case VME_2eSST320:
> + case VME_2ESST320:
> val |= TSI148_LCSR_DDAT_2eSSTM_320;
> break;
> }
> @@ -1526,13 +1526,13 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
> if (cycle & VME_MBLT)
> val |= TSI148_LCSR_DDAT_TM_MBLT;
>
> - if (cycle & VME_2eVME)
> + if (cycle & VME_2EVME)
> val |= TSI148_LCSR_DDAT_TM_2eVME;
>
> - if (cycle & VME_2eSST)
> + if (cycle & VME_2ESST)
> val |= TSI148_LCSR_DDAT_TM_2eSST;
>
> - if (cycle & VME_2eSSTB) {
> + if (cycle & VME_2ESSTB) {
> dev_err(dev, "Currently not setting Broadcast Select Registers\n");
> val |= TSI148_LCSR_DDAT_TM_2eSSTB;
> }
> @@ -2359,8 +2359,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
> VME_USER3 | VME_USER4;
> master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> master_image->width_attr = VME_D16 | VME_D32;
> memset(&master_image->bus_resource, 0,
> @@ -2384,8 +2384,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> VME_A64;
> slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
> - VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
> - VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
> + VME_2EVME | VME_2ESST | VME_2ESSTB | VME_2ESST160 |
> + VME_2ESST267 | VME_2ESST320 | VME_SUPER | VME_USER |
> VME_PROG | VME_DATA;
> list_add_tail(&slave_image->list,
> &tsi148_bridge->slave_resources);

2023-10-18 08:13:47

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH] staging: vme_user: fix coding style - remove CamelCasing

> As description states, checkpatch recommendation

This comment should be just under my text, that you are responding to, not
at the end of the patch.

CamelCase is not just the mixture of uppercase and lowercase letters. It
means that the things with upper and lowercase letters are real words,
LikeThis. In the case of this driver, the lowercase letter was not part
of an English word, so one can be suspicious that it has some other
meaning. Checkpatch doesn't know what are real English words, so it makes
the suggestions whenever there is a mixture of uppercase and lowercase
letters.

julia