Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp845242imu; Tue, 11 Dec 2018 08:25:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vc5MQ0vTiUmUMRARu2rdY0NbzzjXG43tZQDNV3ileOxM08z9RNnvN63MHDno1mXiFAMKS/ X-Received: by 2002:a62:e30d:: with SMTP id g13mr16802755pfh.151.1544545535736; Tue, 11 Dec 2018 08:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544545535; cv=none; d=google.com; s=arc-20160816; b=WxX8nCsySVd2nnqVxy5Ejg35GiZXPqBj6EE85R3CQezpN9E57If/ZhRqYfXa3axx3u oygoquVIxkv+ymdTdDp+UwGRha3ghGC3DSk8YawQV7rtsWtO333jKQ1+hRClOXbyAVcf cTH+Tz/9Oiqb0i7K7MvEIfBBQ6O2JwMs2cTqOpNMY6R4+XbPZqO3l6RDH1U+tNXUJhNf Hi0431RU99FOEMl/zTDcZzy62OW+DBEV8kqN5rrnDyc/AEJl50SnjJwXEh/NNlpSnY1l rGK7XeJzU9MA9SDqPhkP75wRmnwGsNU16X/waOfzJuNiQLIGEcvtjWT7mdsPVr3PSE07 ApTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O0cq9hjRHDpIK9kXsIiydRiqbaQ9Et4ad4ehli44NWE=; b=OZh7ggGQdIUsM8kkXcp/x57rurfBLIbVEFecAAZlxlyymLnMrtbYhvSJOIeva5OQ8Q scquO391E8uYvckqme2uEz0d2t9ncHHV/1sQWdhA/4sZgEHBfsydl4tMU21hnJ+2nLk2 ZVRSpfCUngotuci147u0qcW5QylseIGOg2wmDcEQ2ReYIfEk+azJsECKRp6Cty9Xnjo9 UNGf8EnI8gG8JKcSYCFTI9OvUbOySE1IPaJQ65oFWE5Y/5M4yvWDzxRWONgPeC5rV8er 3zAIuTg5S/6UdrdPleme5RMuFNRV5p/uTUpT69dnmiVaE3xbYx7+tArNGc5EOozi4+sO z0eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EJ6jtAMv; 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 r14si11566392pgh.39.2018.12.11.08.25.20; Tue, 11 Dec 2018 08:25:35 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=EJ6jtAMv; 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 S1727532AbeLKPn2 (ORCPT + 99 others); Tue, 11 Dec 2018 10:43:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:59928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727489AbeLKPn0 (ORCPT ); Tue, 11 Dec 2018 10:43:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B78920855; Tue, 11 Dec 2018 15:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543005; bh=lHxqwt+J4nPPFMZkFlTOQ/RMcQVAvd7l7e4FkIkqS7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EJ6jtAMvXeGfzC/pQgewGVD7DAvw2hJdEOF10Lg48hLsMjIZyomrq0pqpOrCkzWck Te/HWK7OjswkzU3GllQ8hwtTRkQz/3B1ynV50lJUvbsPSdKW4MT6WoeqCVR0pkrc6x Qq6+01bVg28Nu1vWJrGfmPYi2VCzOCpeoMm41Hnk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Laura Abbott Subject: [PATCH 3.18 30/54] kgdboc: Fix warning with module build Date: Tue, 11 Dec 2018 16:41:18 +0100 Message-Id: <20181211151547.817465116@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151546.010073210@linuxfoundation.org> References: <20181211151546.010073210@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laura Abbott commit 1cd25cbb2fedbc777f3a8c3cb1ba69b645aeaa64 upstream. After 2dd453168643 ("kgdboc: Fix restrict error"), kgdboc_option_setup is now only used when built in, resulting in a warning when compiled as a module: drivers/tty/serial/kgdboc.c:134:12: warning: 'kgdboc_option_setup' defined but not used [-Wunused-function] static int kgdboc_option_setup(char *opt) ^~~~~~~~~~~~~~~~~~~ Move the function under the appropriate ifdef for builtin only. Fixes: 2dd453168643 ("kgdboc: Fix restrict error") Reported-by: Stephen Rothwell Signed-off-by: Laura Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/kgdboc.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -131,24 +131,6 @@ static void kgdboc_unregister_kbd(void) #define kgdboc_restore_input() #endif /* ! CONFIG_KDB_KEYBOARD */ -static int kgdboc_option_setup(char *opt) -{ - if (!opt) { - pr_err("kgdboc: config string not provided\n"); - return -EINVAL; - } - - if (strlen(opt) >= MAX_CONFIG_LEN) { - printk(KERN_ERR "kgdboc: config string too long\n"); - return -ENOSPC; - } - strcpy(config, opt); - - return 0; -} - -__setup("kgdboc=", kgdboc_option_setup); - static void cleanup_kgdboc(void) { if (kgdb_unregister_nmi_console()) @@ -316,6 +298,25 @@ static struct kgdb_io kgdboc_io_ops = { }; #ifdef CONFIG_KGDB_SERIAL_CONSOLE +static int kgdboc_option_setup(char *opt) +{ + if (!opt) { + pr_err("config string not provided\n"); + return -EINVAL; + } + + if (strlen(opt) >= MAX_CONFIG_LEN) { + pr_err("config string too long\n"); + return -ENOSPC; + } + strcpy(config, opt); + + return 0; +} + +__setup("kgdboc=", kgdboc_option_setup); + + /* This is only available if kgdboc is a built in for early debugging */ static int __init kgdboc_early_init(char *opt) {