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:50 +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 09/11] ARM: orion5x: 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/arm/mach-orion5x/board-d2net.c      | 2 +-
 arch/arm/mach-orion5x/dns323-setup.c     | 2 +-
 arch/arm/mach-orion5x/ls_hgl-setup.c     | 2 +-
 arch/arm/mach-orion5x/mv2120-setup.c     | 2 +-
 arch/arm/mach-orion5x/net2big-setup.c    | 2 +-
 arch/arm/mach-orion5x/rd88f5182-setup.c  | 2 +-
 arch/arm/mach-orion5x/ts409-setup.c      | 2 +-
 arch/arm/mach-orion5x/wrt350n-v2-setup.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-orion5x/board-d2net.c b/arch/arm/mach-orion5x/board-d2net.c
index a89376a..8791a22 100644
--- a/arch/arm/mach-orion5x/board-d2net.c
+++ b/arch/arm/mach-orion5x/board-d2net.c
@@ -54,7 +54,7 @@
 #define D2NET_GPIO_BLUE_LED_BLINK_CTRL	16
 #define D2NET_GPIO_BLUE_LED_OFF		23
 
-static struct gpio_led d2net_leds[] = {
+static const struct gpio_led d2net_leds[] __initconst = {
 	{
 		.name = "d2net:blue:sata",
 		.default_trigger = "default-on",
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index cd483bf..70eb340 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -221,7 +221,7 @@ static int __init dns323_read_mac_addr(void)
 };
 
 
-static struct gpio_led dns323c_leds[] = {
+static const struct gpio_led dns323c_leds[] __initconst = {
 	{
 		.name = "power:blue",
 		.gpio = DNS323C_GPIO_LED_POWER,
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index 47ba6e0..f5410e0 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -86,7 +86,7 @@
 #define LS_HGL_GPIO_LED_PWR     0
 
 
-static struct gpio_led ls_hgl_led_pins[] = {
+static const struct gpio_led ls_hgl_led_pins[] __initconst = {
 	{
 		.name	   = "alarm:red",
 		.gpio	   = LS_HGL_GPIO_LED_ALARM,
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index 2bf8ec7..957095a 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -136,7 +136,7 @@
 	.irq	= 0,
 };
 
-static struct gpio_led mv2120_led_pins[] = {
+static const struct gpio_led mv2120_led_pins[] __initconst = {
 	{
 		.name			= "mv2120:blue:health",
 		.gpio			= 0,
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index bf6be4c..f8ca382 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -214,7 +214,7 @@ static void __init net2big_sata_power_init(void)
 #define NET2BIG_GPIO_SATA0_BLUE_LED	17
 #define NET2BIG_GPIO_SATA1_BLUE_LED	13
 
-static struct gpio_led net2big_leds[] = {
+static const struct gpio_led net2big_leds[] __initconst = {
 	{
 		.name = "net2big:red:power",
 		.gpio = NET2BIG_GPIO_PWR_RED_LED,
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index fe3e67c..6376ae1 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -83,7 +83,7 @@
 
 #define RD88F5182_GPIO_LED		0
 
-static struct gpio_led rd88f5182_gpio_led_pins[] = {
+static const struct gpio_led rd88f5182_gpio_led_pins[] __initconst = {
 	{
 		.name		= "rd88f5182:cpu",
 		.default_trigger = "cpu0",
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index a77613b..6d88d2f 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -169,7 +169,7 @@ static int __init qnap_ts409_pci_init(void)
  * LEDs attached to GPIO
  ****************************************************************************/
 
-static struct gpio_led ts409_led_pins[] = {
+static const struct gpio_led ts409_led_pins[] __initconst = {
 	{
 		.name		= "ts409:red:sata1",
 		.gpio		= 4,
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 9250bb2..40adfd8 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -29,7 +29,7 @@
 /*
  * LEDs attached to GPIO
  */
-static struct gpio_led wrt350n_v2_led_pins[] = {
+static const struct gpio_led wrt350n_v2_led_pins[] __initconst = {
 	{
 		.name		= "wrt350nv2:green:power",
 		.gpio		= 0,
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ