stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH 3.18 02/39] tty: remove platform_sysrq_reset_seq
Date: Thu, 11 May 2017 15:02:37 +0200	[thread overview]
Message-ID: <20170511130238.592314582@linuxfoundation.org> (raw)
In-Reply-To: <20170511130238.045434679@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit ffb6e0c9a0572f8e5f8e9337a1b40ac2ec1493a1 upstream.

The platform_sysrq_reset_seq code was intended as a way for an embedded
platform to provide its own sysrq sequence at compile time. After over two
years, nobody has started using it in an upstream kernel, and the platforms
that were interested in it have moved on to devicetree, which can be used
to configure the sequence without requiring kernel changes. The method is
also incompatible with the way that most architectures build support for
multiple platforms into a single kernel.

Now the code is producing warnings when built with gcc-5.1:

drivers/tty/sysrq.c: In function 'sysrq_init':
drivers/tty/sysrq.c:959:33: warning: array subscript is above array bounds [-Warray-bounds]
   key = platform_sysrq_reset_seq[i];

We could fix this, but it seems unlikely that it will ever be used, so
let's just remove the code instead. We still have the option to pass the
sequence either in DT, using the kernel command line, or using the
/sys/module/sysrq/parameters/reset_seq file.

Fixes: 154b7a489a ("Input: sysrq - allow specifying alternate reset sequence")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/tty/sysrq.c |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -55,9 +55,6 @@
 static int __read_mostly sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;
 static bool __read_mostly sysrq_always_enabled;
 
-unsigned short platform_sysrq_reset_seq[] __weak = { KEY_RESERVED };
-int sysrq_reset_downtime_ms __weak;
-
 static bool sysrq_on(void)
 {
 	return sysrq_enabled || sysrq_always_enabled;
@@ -567,6 +564,7 @@ void handle_sysrq(int key)
 EXPORT_SYMBOL(handle_sysrq);
 
 #ifdef CONFIG_INPUT
+static int sysrq_reset_downtime_ms;
 
 /* Simple translation table for the SysRq keys */
 static const unsigned char sysrq_xlate[KEY_CNT] =
@@ -947,23 +945,8 @@ static bool sysrq_handler_registered;
 
 static inline void sysrq_register_handler(void)
 {
-	unsigned short key;
 	int error;
-	int i;
-
-	/* First check if a __weak interface was instantiated. */
-	for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) {
-		key = platform_sysrq_reset_seq[i];
-		if (key == KEY_RESERVED || key > KEY_MAX)
-			break;
-
-		sysrq_reset_seq[sysrq_reset_seq_len++] = key;
-	}
 
-	/*
-	 * DT configuration takes precedence over anything that would
-	 * have been defined via the __weak interface.
-	 */
 	sysrq_of_get_keyreset_config();
 
 	error = input_register_handler(&sysrq_handler);

  parent reply	other threads:[~2017-05-11 13:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 13:02 [PATCH 3.18 00/39] 3.18.53-stable review Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 01/39] 9p: fix a potential acl leak Greg Kroah-Hartman
2017-05-11 13:02 ` Greg Kroah-Hartman [this message]
2017-05-11 13:02 ` [PATCH 3.18 03/39] mtd: cfi: reduce stack size Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 04/39] ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 05/39] cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 06/39] powerpc/powernv: Fix opal_exit tracepoint opcode Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 07/39] power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLING Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 08/39] power: supply: bq24190_charger: Call set_mode_host() on pm_resume() Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 09/39] ARM: OMAP5 / DRA7: Fix HYP mode boot for thumb2 build Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 10/39] mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 11/39] mwifiex: Avoid skipping WEP key deletion for AP Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 13/39] kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 14/39] x86/platform/intel-mid: Correct MSI IRQ line for watchdog device Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 16/39] usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 17/39] usb: host: ohci-exynos: " Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 18/39] USB: serial: keyspan_pda: fix receive sanity checks Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 19/39] USB: serial: digi_acceleport: fix incomplete rx sanity check Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 20/39] USB: serial: ssu100: fix control-message error handling Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 21/39] USB: serial: io_edgeport: fix epic-descriptor handling Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 22/39] USB: serial: ti_usb_3410_5052: fix control-message error handling Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 23/39] USB: serial: ark3116: fix open " Greg Kroah-Hartman
2017-05-11 13:02 ` [PATCH 3.18 24/39] USB: serial: ftdi_sio: fix latency-timer " Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 25/39] USB: serial: quatech2: fix control-message " Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 26/39] USB: serial: mct_u232: fix modem-status " Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 27/39] USB: serial: io_edgeport: fix descriptor " Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 28/39] USB: serial: sierra: fix bogus alternate-setting assumption Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 29/39] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 30/39] brcmfmac: Ensure pointer correctly set if skb data location changes Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 31/39] brcmfmac: Make skb header writable before use Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 32/39] staging: emxx_udc: remove incorrect __init annotations Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 33/39] tcp: do not underestimate skb->truesize in tcp_trim_head() Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 34/39] ipv4, ipv6: ensure raw socket message is big enough to hold an IP header Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 35/39] ipv6: initialize route null entry in addrconf_init() Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 36/39] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 37/39] tcp: fix wraparound issue in tcp_lp Greg Kroah-Hartman
2017-05-11 13:03 ` [PATCH 3.18 38/39] f2fs: sanity check segment count Greg Kroah-Hartman
2017-05-11 21:16 ` [PATCH 3.18 00/39] 3.18.53-stable review Guenter Roeck
2017-05-11 21:31   ` Matthijs van Duin
2017-05-11 21:46     ` Tony Lindgren
2017-05-12  9:37       ` Greg Kroah-Hartman
2017-05-12 10:15         ` Arnd Bergmann
2017-05-12 10:44           ` Greg Kroah-Hartman
2017-05-12 15:23 ` Shuah Khan
2017-05-12 19:47 ` Guenter Roeck
2017-05-14 10:56   ` Greg Kroah-Hartman
2017-05-14 14:02     ` Guenter Roeck
2017-05-14 20:58       ` Greg Kroah-Hartman
2017-05-14 23:38         ` Guenter Roeck
2017-05-15  6:17           ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170511130238.592314582@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).