Skip to contentSkip to conversation

staging: greybus: declare struct of_device_id as const

PATCH Superseded Eva Rachel Retuya 2 participants 5 messages Sep 21, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover staging: greybus: declare struct of_device_id as const

Address the following checkpatch warning:
WARNING: struct of_device_id should be normally const

Eva Rachel Retuya (2):
staging: greybus: arche-apb-ctrl: declare struct of_device_id as const
staging: greybus: arche-platform: declare struct of_device_id as const

 drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
 drivers/staging/greybus/arche-platform.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 staging: greybus: arche-apb-ctrl: declare struct of_device_id as const

Change the declaration of the structure of_device_id arche_apb_ctrl_of_match into const as suggested by checkpatch.

WARNING: struct of_device_id should be normally const

---
 drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/arche-apb-ctrl.c +1 -1
index 59d9d42..70323aa 100644
@@ -495,7 +495,7 @@ static void arche_apb_ctrl_shutdown(struct platform_device *pdev)
 static SIMPLE_DEV_PM_OPS(arche_apb_ctrl_pm_ops, arche_apb_ctrl_suspend,
 			 arche_apb_ctrl_resume);
 
-static struct of_device_id arche_apb_ctrl_of_match[] = {
+static const struct of_device_id arche_apb_ctrl_of_match[] = {
 	{ .compatible = "usbffff,2", },
 	{ },
 };
Signature · 1 line
2.7.4
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/2] staging: greybus: arche-apb-ctrl: declare struct of_device_id as const

Quoted 2 lines · Eva Rachel Retuya

Change the declaration of the structure of_device_id arche_apb_ctrl_of_match into const as suggested by checkpatch.

The same for this one.

julia

Quoted 31 lines

WARNING: struct of_device_id should be normally const

---
 drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/arche-apb-ctrl.c +1 -2
index 59d9d42..70323aa 100644
@@ -495,7 +495,7 @@ static void arche_apb_ctrl_shutdown(struct platform_device *pdev)
 static SIMPLE_DEV_PM_OPS(arche_apb_ctrl_pm_ops, arche_apb_ctrl_suspend,
 			 arche_apb_ctrl_resume);
 
-static struct of_device_id arche_apb_ctrl_of_match[] = {
+static const struct of_device_id arche_apb_ctrl_of_match[] = {
 	{ .compatible = "usbffff,2", },
 	{ },
 };
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474449487-9524-2-git-send-email-eraretuya%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw

PATCH 2/2 staging: greybus: arche-platform: declare struct of_device_id as const

In reply to Eva Rachel Retuya

Constify of_device_id structure declarations as suggested by checkpatch.

WARNING: struct of_device_id should be normally const

---
 drivers/staging/greybus/arche-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/arche-platform.c +2 -2
index d6b3609..e36ee98 100644
@@ -776,12 +776,12 @@ static SIMPLE_DEV_PM_OPS(arche_platform_pm_ops,
 			arche_platform_suspend,
 			arche_platform_resume);
 
-static struct of_device_id arche_platform_of_match[] = {
+static const struct of_device_id arche_platform_of_match[] = {
 	{ .compatible = "google,arche-platform", }, /* Use PID/VID of SVC device */
 	{ },
 };
 
-static struct of_device_id arche_combined_id[] = {
+static const struct of_device_id arche_combined_id[] = {
 	{ .compatible = "google,arche-platform", }, /* Use PID/VID of SVC device */
 	{ .compatible = "usbffff,2", },
 	{ },
Signature · 1 line
2.7.4
#4 lore raw

Re: [Outreachy kernel] [PATCH 2/2] staging: greybus: arche-platform: declare struct of_device_id as const

Quoted 1 line · Eva Rachel Retuya

Constify of_device_id structure declarations as suggested by checkpatch.

It would be good to describe why the change is correct in this particular case. How is the array used in this code?

julia

Quoted 37 lines

WARNING: struct of_device_id should be normally const

---
 drivers/staging/greybus/arche-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/arche-platform.c +2 -3
index d6b3609..e36ee98 100644
@@ -776,12 +776,12 @@ static SIMPLE_DEV_PM_OPS(arche_platform_pm_ops,
 			arche_platform_suspend,
 			arche_platform_resume);
 
-static struct of_device_id arche_platform_of_match[] = {
+static const struct of_device_id arche_platform_of_match[] = {
 	{ .compatible = "google,arche-platform", }, /* Use PID/VID of SVC device */
 	{ },
 };
 
-static struct of_device_id arche_combined_id[] = {
+static const struct of_device_id arche_combined_id[] = {
 	{ .compatible = "google,arche-platform", }, /* Use PID/VID of SVC device */
 	{ .compatible = "usbffff,2", },
 	{ },
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474449487-9524-3-git-send-email-eraretuya%40gmail.com.
For more options, visit https://groups.google.com/d/optout.