lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Dec 2017 14:17:43 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     nsekhar@...com, khilman@...nel.org, linux@...linux.org.uk,
        kaloz@...nwrt.org, khalasa@...p.pl, aaro.koskinen@....fi,
        tony@...mide.com, jason@...edaemon.net, andrew@...n.ch,
        sebastian.hesselbarth@...il.com,
        gregory.clement@...e-electrons.com, daniel@...que.org,
        haojian.zhuang@...il.com, robert.jarzmik@...e.fr,
        marek.vasut@...il.com, slapin@...fans.org, jic23@....ac.uk,
        kgene@...nel.org, krzk@...nel.org, ralf@...ux-mips.org,
        ysato@...rs.sourceforge.jp, dalias@...c.org, tglx@...utronix.de,
        mingo@...hat.com, hpa@...or.com
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH 02/11] MIPS: AR7: constify gpio_led

gpio_led are not supposed to change at runtime.
struct gpio_led_platform_data working with const gpio_led
provided by <linux/leds.h>. So mark the non-const structs
as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 arch/mips/ar7/platform.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index 4674f1e..343a897 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -346,7 +346,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 /*****************************************************************************
  * LEDs
  ****************************************************************************/
-static struct gpio_led default_leds[] = {
+static const struct gpio_led default_leds[] __initconst = {
 	{
 		.name			= "status",
 		.gpio			= 8,
@@ -354,12 +354,12 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 	},
 };
 
-static struct gpio_led titan_leds[] = {
+static const struct gpio_led titan_leds[] __initconst = {
 	{ .name = "status", .gpio = 8, .active_low = 1, },
 	{ .name = "wifi", .gpio = 13, .active_low = 1, },
 };
 
-static struct gpio_led dsl502t_leds[] = {
+static const  struct gpio_led dsl502t_leds[] __initconst = {
 	{
 		.name			= "status",
 		.gpio			= 9,
@@ -377,7 +377,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 	},
 };
 
-static struct gpio_led dg834g_leds[] = {
+static const struct gpio_led dg834g_leds[] __initconst = {
 	{
 		.name			= "ppp",
 		.gpio			= 6,
@@ -406,7 +406,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 	},
 };
 
-static struct gpio_led fb_sl_leds[] = {
+static const struct gpio_led fb_sl_leds[] __initconst = {
 	{
 		.name			= "1",
 		.gpio			= 7,
@@ -433,7 +433,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 	},
 };
 
-static struct gpio_led fb_fon_leds[] = {
+static const struct gpio_led fb_fon_leds[] __initconst = {
 	{
 		.name			= "1",
 		.gpio			= 8,
@@ -459,7 +459,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 	},
 };
 
-static struct gpio_led gt701_leds[] = {
+static const struct gpio_led gt701_leds[] __initconst = {
 	{
 		.name			= "inet:green",
 		.gpio			= 13,
-- 
1.9.1

Powered by blists - more mailing lists