Received: by 10.213.65.68 with SMTP id h4csp39503imn; Mon, 19 Mar 2018 18:50:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELsRGkbypclcVHeF+/AZh6STGFPr1NoZL8QUireaUnf7g5Jo3p5xehm+3+9T3Okei07wDyg+ X-Received: by 10.101.66.132 with SMTP id j4mr8682231pgp.47.1521510631230; Mon, 19 Mar 2018 18:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510631; cv=none; d=google.com; s=arc-20160816; b=Qq8CeBn1MckGA8BI8/KkfXXHzbL5+zCnsx2mTv3LRlRNLAi+Sb4DMST9BL+kFxpdr/ mt5u0lRpjk9X9Lzh8B78HMfTUO1ll7uCLEAkbyt3Psofo9JGd2HmqM8HWvXnRAvHxKAB pkTfBuXCy/XbahHUDqxvSthTla+7o7+5/01Iun8wYRCU3p1b03P5fSKEiARdLJkBjukH QefJ63r/vSP0wQB3ceQdTO1UzM2ThmHZ1sE0jmZnVyIyaZfrukLZ6IRxNrjLrjXKDoOo juwV4QCBfb9T70TTNA9I1s37Obyzty0n1EWPoSTpLPumJ3Z9pGtXVEUlOXTmX6GGeFZg piaQ== 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=TOeV8o4CuQ9wwLCRRoo1ryUuhX2Qvmse8XrEb2UAMe8=; b=M6wXBWnGqdN11K6rGhv8OqAVy7Xkf7MruZ2eNRwrZjKfBUSpfkpccEDjfcM8D1WM6f 22VG+s7XvvZAWGpFGQd9RugDmomZ9ybdxVBwhNlFnbV/Nw9yroMM6nR250oUUUQ6oKT3 o8EyvFepouD5sxVdysI/sfC1xyHOsNrZtJ9agM3HCzx45hA7jtwZ1f6d5fL8rO6ciOAZ dTDZYoeALGPXgwIQoLit8M8UDS5vA+nETL58VM7b2zLW2xX8tIamTL4CdmVgjGIMKkoo nUOpDOYtz5ChkNt9tlnx4fVXz8tveRGIOh5Lx13QI05uQSCtjF8HMsc1hjf4wtEvggAe hnBQ== 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 3-v6si515325pll.585.2018.03.19.18.50.17; Mon, 19 Mar 2018 18:50:31 -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 S1030907AbeCSUUZ (ORCPT + 99 others); Mon, 19 Mar 2018 16:20:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44466 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030744AbeCSSPG (ORCPT ); Mon, 19 Mar 2018 14:15:06 -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 239D3F40; Mon, 19 Mar 2018 18:15:05 +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.4 042/134] braille-console: Fix value returned by _braille_console_setup Date: Mon, 19 Mar 2018 19:05:25 +0100 Message-Id: <20180319171855.461834353@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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