All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: chromeos_laptop: make chromeos_laptop const
@ 2017-08-05  8:20 Bhumika Goyal
  2017-08-15  6:59 ` Benson Leung
  0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-08-05  8:20 UTC (permalink / raw)
  To: julia.lawall, bleung, olof, linux-kernel; +Cc: Bhumika Goyal

Declare chromeos_laptop structures as const as they are only used during
a copy operation. As their value is never modified during runtime, they
can be made const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/platform/chrome/chromeos_laptop.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
index d859973..6dec6ab 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -423,7 +423,7 @@ static int chromeos_laptop_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static struct chromeos_laptop samsung_series_5_550 = {
+static const struct chromeos_laptop samsung_series_5_550 = {
 	.i2c_peripherals = {
 		/* Touchpad. */
 		{ .add = setup_cyapa_tp, I2C_ADAPTER_SMBUS },
@@ -432,14 +432,14 @@ static int chromeos_laptop_probe(struct platform_device *pdev)
 	},
 };
 
-static struct chromeos_laptop samsung_series_5 = {
+static const struct chromeos_laptop samsung_series_5 = {
 	.i2c_peripherals = {
 		/* Light Sensor. */
 		{ .add = setup_tsl2583_als, I2C_ADAPTER_SMBUS },
 	},
 };
 
-static struct chromeos_laptop chromebook_pixel = {
+static const struct chromeos_laptop chromebook_pixel = {
 	.i2c_peripherals = {
 		/* Touch Screen. */
 		{ .add = setup_atmel_1664s_ts, I2C_ADAPTER_PANEL },
@@ -450,14 +450,14 @@ static int chromeos_laptop_probe(struct platform_device *pdev)
 	},
 };
 
-static struct chromeos_laptop hp_chromebook_14 = {
+static const struct chromeos_laptop hp_chromebook_14 = {
 	.i2c_peripherals = {
 		/* Touchpad. */
 		{ .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
 	},
 };
 
-static struct chromeos_laptop dell_chromebook_11 = {
+static const struct chromeos_laptop dell_chromebook_11 = {
 	.i2c_peripherals = {
 		/* Touchpad. */
 		{ .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
@@ -466,28 +466,28 @@ static int chromeos_laptop_probe(struct platform_device *pdev)
 	},
 };
 
-static struct chromeos_laptop toshiba_cb35 = {
+static const struct chromeos_laptop toshiba_cb35 = {
 	.i2c_peripherals = {
 		/* Touchpad. */
 		{ .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
 	},
 };
 
-static struct chromeos_laptop acer_c7_chromebook = {
+static const struct chromeos_laptop acer_c7_chromebook = {
 	.i2c_peripherals = {
 		/* Touchpad. */
 		{ .add = setup_cyapa_tp, I2C_ADAPTER_SMBUS },
 	},
 };
 
-static struct chromeos_laptop acer_ac700 = {
+static const struct chromeos_laptop acer_ac700 = {
 	.i2c_peripherals = {
 		/* Light Sensor. */
 		{ .add = setup_tsl2563_als, I2C_ADAPTER_SMBUS },
 	},
 };
 
-static struct chromeos_laptop acer_c720 = {
+static const struct chromeos_laptop acer_c720 = {
 	.i2c_peripherals = {
 		/* Touchscreen. */
 		{ .add = setup_atmel_1664s_ts, I2C_ADAPTER_DESIGNWARE_1 },
@@ -500,14 +500,14 @@ static int chromeos_laptop_probe(struct platform_device *pdev)
 	},
 };
 
-static struct chromeos_laptop hp_pavilion_14_chromebook = {
+static const struct chromeos_laptop hp_pavilion_14_chromebook = {
 	.i2c_peripherals = {
 		/* Touchpad. */
 		{ .add = setup_cyapa_tp, I2C_ADAPTER_SMBUS },
 	},
 };
 
-static struct chromeos_laptop cr48 = {
+static const struct chromeos_laptop cr48 = {
 	.i2c_peripherals = {
 		/* Light Sensor. */
 		{ .add = setup_tsl2563_als, I2C_ADAPTER_SMBUS },
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: chromeos_laptop: make chromeos_laptop const
  2017-08-05  8:20 [PATCH] platform/chrome: chromeos_laptop: make chromeos_laptop const Bhumika Goyal
@ 2017-08-15  6:59 ` Benson Leung
  0 siblings, 0 replies; 2+ messages in thread
From: Benson Leung @ 2017-08-15  6:59 UTC (permalink / raw)
  To: Bhumika Goyal; +Cc: julia.lawall, bleung, olof, linux-kernel, bleung

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

Hi Bhumika,


On Sat, Aug 05, 2017 at 01:50:42PM +0530, Bhumika Goyal wrote:
> Declare chromeos_laptop structures as const as they are only used during
> a copy operation. As their value is never modified during runtime, they
> can be made const.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Applied. Thanks for the patch!

Benson

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-15  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-05  8:20 [PATCH] platform/chrome: chromeos_laptop: make chromeos_laptop const Bhumika Goyal
2017-08-15  6:59 ` Benson Leung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.