Received: by 10.213.65.68 with SMTP id h4csp1766157imn; Mon, 19 Mar 2018 12:39:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELtHE3+DMHtU/LtGyYl0VLjQqx425Sj8r9FXLT4OS5uPELVuOZqWpBt2Jh44qfBKyNXL9JmW X-Received: by 2002:a17:902:744b:: with SMTP id e11-v6mr13698311plt.351.1521488387769; Mon, 19 Mar 2018 12:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521488387; cv=none; d=google.com; s=arc-20160816; b=vl1bhm+3sLuSc+pjhbWUDPJTd89EfquxqYsooTfmKEwQ94nmNiIiN3lO/mrcf8ToWu Cgt4rPJEYmyKOdBDTRA+FBeizeqQNH8vWoD6oVh1XlxnFHsLLPnnIJIujctemay+hdU8 30DgHLbu6qW/4+ThBz+35AXdAiyqsEslGWHLXE3kJfZcVp5aR2VlpxkHiUu2/wIIgqAI 7VzbfDGwhRCYGkMtDvXhdKcaIPvb3gZGZFtFTQRYJgKMqxQpXa1miv4EZKFqArFGOjjo vrVBxPVPQXFNhohGnOs+xl1gV0wx/W07F3g5aMjNIboCXF/BVRwZw1MOJkkZrQrKqy4A ZaUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wRQY5zZAt9j1vPYhAZvF2ClU3e2JGqzrHatUMXS1Mz4=; b=q9Nwq1p9YuiZckF/M77FZsBqO5nvIOKWWRUrbSK12Lccmx1WadQRXdq+V3nljnf6ri dpzTem28ZGmLLzWoFros6IkQjvusIbpzRASFNGa0E46+fw4WvZJpdpaZFn8J35kVOXNj KAH//dNs60TrI2E/V0BfGrS7jqWEeLvW4tKNnJIkq/KLctYGHi4tvTfEYlHkFn9GJrgd chw2WPvBjvjlVdgRUAQ/T0QozL/MDWR7569fHNVrmm2+6DT2EWYaExMeQh5J5VpYglFe u7wZoD2y4zO40mV2Qdj6DvwbIpWCsBzVA+EIc1TN4vlQVEnyIi+hTg4z9jRJfUBTPXjQ h4cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v41-v6si491213plg.686.2018.03.19.12.39.32; Mon, 19 Mar 2018 12:39:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031202AbeCSSWF (ORCPT + 99 others); Mon, 19 Mar 2018 14:22:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48262 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969566AbeCSSVq (ORCPT ); Mon, 19 Mar 2018 14:21:46 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0CC141283; Mon, 19 Mar 2018 18:21:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Thibault , Aleksey Makarov , Joe Perches , Ming Lei , Steven Rostedt , Petr Mladek , Sasha Levin Subject: [PATCH 4.9 087/241] braille-console: Fix value returned by _braille_console_setup Date: Mon, 19 Mar 2018 19:05:52 +0100 Message-Id: <20180319180754.812195591@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Samuel Thibault [ 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 Cc: Aleksey Makarov Cc: Joe Perches Cc: Ming Lei Cc: Steven Rostedt Acked-by: Petr Mladek Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/printk/braille.c | 15 ++++++++------- kernel/printk/braille.h | 13 ++++++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) --- a/kernel/printk/braille.c +++ b/kernel/printk/braille.c @@ -2,12 +2,13 @@ #include #include +#include #include #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 (!strncmp(*str, "brl,", 4)) { *brl_options = ""; @@ -15,14 +16,14 @@ char *_braille_console_setup(char **str, } else if (!strncmp(*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 --- a/kernel/printk/braille.h +++ b/kernel/printk/braille.h @@ -9,7 +9,14 @@ braille_set_options(struct console_cmdli 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_cmdli { } -static inline char * +static inline int _braille_console_setup(char **str, char **brl_options) { - return NULL; + return 0; } static inline int