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-next>] [day] [month] [year] [list]
Date:   Thu, 2 May 2019 00:43:05 -0700
From:   Nikitas Angelinas <nikitas.angelinas@...il.com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     nikitas.angelinas@...il.com
Subject: [PATCH] power/poweroff.c: mark variables with __initdata and
 __maybe_unused

There is no need to keep sysrq_poweroff_op after initialization, so mark
it with __initdata. Mark some of the function parameters with __maybe_unused
to avoid compilation warnings.

Signed-off-by: Nikitas Angelinas <nikitas.angelinas@...il.com>
---
 kernel/power/poweroff.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/power/poweroff.c b/kernel/power/poweroff.c
index 7ef6866..d507152 100644
--- a/kernel/power/poweroff.c
+++ b/kernel/power/poweroff.c
@@ -11,26 +11,27 @@
 #include <linux/workqueue.h>
 #include <linux/reboot.h>
 #include <linux/cpumask.h>
+#include <linux/compiler_attributes.h>
 
 /*
  * When the user hits Sys-Rq o to power down the machine this is the
  * callback we use.
  */
 
-static void do_poweroff(struct work_struct *dummy)
+static void do_poweroff(struct work_struct *dummy __maybe_unused)
 {
 	kernel_power_off();
 }
 
 static DECLARE_WORK(poweroff_work, do_poweroff);
 
-static void handle_poweroff(int key)
+static void handle_poweroff(int key __maybe_unused)
 {
 	/* run sysrq poweroff on boot cpu */
 	schedule_work_on(cpumask_first(cpu_online_mask), &poweroff_work);
 }
 
-static struct sysrq_key_op	sysrq_poweroff_op = {
+static struct sysrq_key_op sysrq_poweroff_op __initdata = {
 	.handler        = handle_poweroff,
 	.help_msg       = "poweroff(o)",
 	.action_msg     = "Power Off",
-- 
2.10.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ