Skip to contentSkip to conversation

Input: drv260x/drv2665/drv2667 - Constify reg_default tables

PATCH Applied Axel Lin 2 participants 2 messages Jul 7, 2015 – Jul 8, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 Input: drv260x/drv2665/drv2667 - Constify reg_default tables

These reg_default tables are not modified after initialized, so make them const.

---
 drivers/input/misc/drv260x.c | 2 +-
 drivers/input/misc/drv2665.c | 2 +-
 drivers/input/misc/drv2667.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/input/misc/drv260x.c +1 -1
index e5d60ec..0e3af55 100644
@@ -204,7 +204,7 @@ struct drv260x_data {
 	int overdrive_voltage;
 };
 
-static struct reg_default drv260x_reg_defs[] = {
+static const struct reg_default drv260x_reg_defs[] = {
 	{ DRV260X_STATUS, 0xe0 },
 	{ DRV260X_MODE, 0x40 },
 	{ DRV260X_RT_PB_IN, 0x00 },
drivers/input/misc/drv2665.c +1 -1
index 0afaa33..e9501fd 100644
@@ -74,7 +74,7 @@ static const u8 drv2665_sine_wave_form[] = {
 	0x9b, 0x9f, 0xa5, 0xad, 0xb8, 0xc4, 0xd2, 0xe0, 0xf0, 0x00,
 };
 
-static struct reg_default drv2665_reg_defs[] = {
+static const struct reg_default drv2665_reg_defs[] = {
 	{ DRV2665_STATUS, 0x02 },
 	{ DRV2665_CTRL_1, 0x28 },
 	{ DRV2665_CTRL_2, 0x40 },
drivers/input/misc/drv2667.c +1 -1
index fc0fddf..a231342 100644
@@ -116,7 +116,7 @@ struct drv2667_data {
 	u32 frequency;
 };
 
-static struct reg_default drv2667_reg_defs[] = {
+static const struct reg_default drv2667_reg_defs[] = {
 	{ DRV2667_STATUS, 0x02 },
 	{ DRV2667_CTRL_1, 0x28 },
 	{ DRV2667_CTRL_2, 0x40 },
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Axel Lin

These reg_default tables are not modified after initialized, so make them const.

Applied, thank you.

Quoted 50 lines
---
 drivers/input/misc/drv260x.c | 2 +-
 drivers/input/misc/drv2665.c | 2 +-
 drivers/input/misc/drv2667.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/input/misc/drv260x.c +1 -1
index e5d60ec..0e3af55 100644
@@ -204,7 +204,7 @@ struct drv260x_data {
 	int overdrive_voltage;
 };
 
-static struct reg_default drv260x_reg_defs[] = {
+static const struct reg_default drv260x_reg_defs[] = {
 	{ DRV260X_STATUS, 0xe0 },
 	{ DRV260X_MODE, 0x40 },
 	{ DRV260X_RT_PB_IN, 0x00 },
drivers/input/misc/drv2665.c +1 -1
index 0afaa33..e9501fd 100644
@@ -74,7 +74,7 @@ static const u8 drv2665_sine_wave_form[] = {
 	0x9b, 0x9f, 0xa5, 0xad, 0xb8, 0xc4, 0xd2, 0xe0, 0xf0, 0x00,
 };
 
-static struct reg_default drv2665_reg_defs[] = {
+static const struct reg_default drv2665_reg_defs[] = {
 	{ DRV2665_STATUS, 0x02 },
 	{ DRV2665_CTRL_1, 0x28 },
 	{ DRV2665_CTRL_2, 0x40 },
drivers/input/misc/drv2667.c +1 -1
index fc0fddf..a231342 100644
@@ -116,7 +116,7 @@ struct drv2667_data {
 	u32 frequency;
 };
 
-static struct reg_default drv2667_reg_defs[] = {
+static const struct reg_default drv2667_reg_defs[] = {
 	{ DRV2667_STATUS, 0x02 },
 	{ DRV2667_CTRL_1, 0x28 },
 	{ DRV2667_CTRL_2, 0x40 },
Signature · 1 line
2.1.0
Signature · 1 line
Dmitry