mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Aleksey Makarov <aleksey.makarov@linaro.org>,
	Joe Perches <joe@perches.com>, Ming Lei <ming.lei@canonical.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 3.18 25/63] braille-console: Fix value returned by _braille_console_setup
Date: Sat, 3 Mar 2018 22:33:24 +0000	[thread overview]
Message-ID: <20180303223228.27323-25-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180303223228.27323-1-alexander.levin@microsoft.com>

From: Samuel Thibault <samuel.thibault@ens-lyon.org>

[ Upstream commit 2ed2b8621be2708c0f6d61fe9841e9ad8b9753f0 ]

commit bbeddf52adc1 ("printk: move braille console support into
separate braille.[ch] files") introduced _braille_console_setup()
to outline the braille initialization code.  There was however some
confusion over the value it was supposed to return. commit 2cfe6c4ac7ee
("printk: Fix return of braille_register_console()") tried to fix it
but failed to.

This fixes and documents the returned value according to the use
in printk.c: non-zero return means a parsing error, and thus this
console configuration should be ignored.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Aleksey Makarov <aleksey.makarov@linaro.org>
Cc: Joe Perches <joe@perches.com>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 kernel/printk/braille.c | 15 ++++++++-------
 kernel/printk/braille.h | 13 ++++++++++---
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c
index 276762f3a460..e035876af5e2 100644
--- a/kernel/printk/braille.c
+++ b/kernel/printk/braille.c
@@ -2,12 +2,13 @@
 
 #include <linux/kernel.h>
 #include <linux/console.h>
+#include <linux/errno.h>
 #include <linux/string.h>
 
 #include "console_cmdline.h"
 #include "braille.h"
 
-char *_braille_console_setup(char **str, char **brl_options)
+int _braille_console_setup(char **str, char **brl_options)
 {
 	if (!memcmp(*str, "brl,", 4)) {
 		*brl_options = "";
@@ -15,14 +16,14 @@ char *_braille_console_setup(char **str, char **brl_options)
 	} else if (!memcmp(str, "brl=", 4)) {
 		*brl_options = *str + 4;
 		*str = strchr(*brl_options, ',');
-		if (!*str)
+		if (!*str) {
 			pr_err("need port name after brl=\n");
-		else
-			*((*str)++) = 0;
-	} else
-		return NULL;
+			return -EINVAL;
+		}
+		*((*str)++) = 0;
+	}
 
-	return *str;
+	return 0;
 }
 
 int
diff --git a/kernel/printk/braille.h b/kernel/printk/braille.h
index 769d771145c8..749a6756843a 100644
--- a/kernel/printk/braille.h
+++ b/kernel/printk/braille.h
@@ -9,7 +9,14 @@ braille_set_options(struct console_cmdline *c, char *brl_options)
 	c->brl_options = brl_options;
 }
 
-char *
+/*
+ * Setup console according to braille options.
+ * Return -EINVAL on syntax error, 0 on success (or no braille option was
+ * actually given).
+ * Modifies str to point to the serial options
+ * Sets brl_options to the parsed braille options.
+ */
+int
 _braille_console_setup(char **str, char **brl_options);
 
 int
@@ -25,10 +32,10 @@ braille_set_options(struct console_cmdline *c, char *brl_options)
 {
 }
 
-static inline char *
+static inline int
 _braille_console_setup(char **str, char **brl_options)
 {
-	return NULL;
+	return 0;
 }
 
 static inline int
-- 
2.14.1

  parent reply	other threads:[~2018-03-03 22:33 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03 22:33 [PATCH AUTOSEL for 3.18 01/63] Input: tsc2007 - check for presence and power down tsc2007 during probe Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 02/63] kretprobes: Ensure probe location is at function entry Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 03/63] HID: reject input outside logical range only if null state is set Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 04/63] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 05/63] PCI/MSI: Stop disabling MSI/MSI-X in pci_device_shutdown() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 07/63] perf tools: Make perf_event__synthesize_mmap_events() scale Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 06/63] selinux: check for address length in selinux_socket_bind() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 08/63] drivers: net: xgene: Fix hardware checksum setting Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 10/63] ath10k: disallow DFS simulation if DFS channel is not enabled Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 09/63] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off) Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 12/63] ARM: dts: Adjust moxart IRQ controller and flags Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 11/63] HID: clamp input to logical range if no null state Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 13/63] batman-adv: handle race condition for claims between gateways Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 15/63] scsi: ipr: Fix missed EH wakeup Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 14/63] of: fix of_device_get_modalias returned length when truncating buffers Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 16/63] [media] media: i2c/soc_camera: fix ov6650 sensor getting wrong clock Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 17/63] timers, sched_clock: Update timeout for clock wrap Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 18/63] sched: act_csum: don't mangle TCP and UDP GSO packets Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 19/63] spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 20/63] tcp: sysctl: Fix a race to avoid unexpected 0 window from space Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 21/63] powerpc/xmon: Fix an unexpected xmon on/off state change Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 22/63] mm: Fix false-positive VM_BUG_ON() in page_cache_{get,add}_speculative() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 23/63] blk-throttle: make sure expire time isn't too big Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 24/63] ARM: DRA7: hwmod_data: Prevent wait_target_disable error for usb_otg_ss Sasha Levin
2018-03-03 22:33 ` Sasha Levin [this message]
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 26/63] ARM: dts: r8a7790: Correct parent of SSI[0-9] clocks Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 27/63] ARM: dts: r8a7791: " Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 28/63] powerpc: Avoid taking a data miss on every userspace instruction miss Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 30/63] reiserfs: Make cancel_old_flush() reliable Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 29/63] net/faraday: Add missing include of of.h Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 31/63] fm10k: correctly check if interface is removed Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 32/63] apparmor: Make path_max parameter readonly Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 33/63] iommu/iova: Fix underflow bug in __alloc_and_insert_iova_range Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 35/63] video: ARM CLCD: fix dma allocation size Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 34/63] ARM: dts: rockchip: disable arm-global-timer for rk3188 Sasha Levin
2018-03-04 23:20   ` Alexander Kochetkov
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 37/63] MIPS: BPF: Quit clobbering callee saved registers in JIT code Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 36/63] drm/radeon: Fail fb creation from imported dma-bufs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 38/63] regulator: isl9305: fix array size Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 39/63] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 40/63] perf inject: Copy events when reordering events in pipe mode Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 42/63] scsi: sg: check for valid direction before starting the request Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 41/63] perf session: Don't rely on evlist in pipe mode Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 43/63] scsi: sg: close race condition in sg_remove_sfp_usercontext() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 44/63] kprobes/x86: Fix kprobe-booster not to boost far call instructions Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 45/63] kprobes/x86: Set kprobes pages read-only Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 46/63] wil6210: fix memory access violation in wil_memcpy_from/toio_32 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 47/63] HID: elo: clear BTN_LEFT mapping Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 48/63] sched: Stop resched_cpu() from sending IPIs to offline CPUs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 49/63] net: xfrm: allow clearing socket xfrm policies Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 50/63] mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 52/63] ARM: dts: omap3-n900: Fix the audio CODEC's reset pin Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 51/63] ARM: dts: am335x-pepper: " Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 53/63] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 54/63] ASoC: tlv320aic31xx: Handle inverted BCLK in non-DSP modes Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 55/63] tools/usbip: fixes build with musl libc toolchain Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 56/63] spi: sun6i: disable/unprepare clocks on remove Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 57/63] scsi: devinfo: apply to HP XP the same flags as Hitachi VSP Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 58/63] media: cpia2: Fix a couple off by one bugs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 60/63] mac80211: remove BUG() when interface type is invalid Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 59/63] veth: set peer GSO values Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 61/63] ASoC: nuc900: Fix a loop timeout test Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 62/63] rcutorture/configinit: Fix build directory error message Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 63/63] ima: relax requiring a file signature for new files with zero length Sasha Levin

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=20180303223228.27323-25-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=aleksey.makarov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=rostedt@goodmis.org \
    --cc=samuel.thibault@ens-lyon.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

all inboxes | Powered by JetHome®