Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp841206imu; Tue, 11 Dec 2018 08:21:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOqoBh82CN2nESX+tDuRer3+rGASAAK52f8a/fbXRxoJp+G0dZ8Y/u39nIKkEUpdiXaEiC X-Received: by 2002:a63:b649:: with SMTP id v9mr15271644pgt.436.1544545318502; Tue, 11 Dec 2018 08:21:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544545318; cv=none; d=google.com; s=arc-20160816; b=iVN1fAKAyv0nSKqtCe/hTB4Vv54UxiEQFCcv9oBaJyyc73QSJHYRUgv20C+N32m0lJ Uom6ryVi1rV3e5jKhkQT+L630WXNAZ8Cpk9ZG7GXKD/xWnLUcLIvi1hGhrwQcEclCYod i90pvJXirpGqt19wam3ZfQyylzOIPtwGof16B3iekVs0Wrn6vVm1hwoqGh+98VzXFo03 JV/YSlb3+u7amTbylhjFiuJiw/W/hwa37cYtZrlWheXb+toE5hI6IVqwCDuz8+W+nequ HyRIkN4CuVOFBx2P0e03MdZmqj0kKytNGH0JG5HEm+1L9auILao4XUC6xI1xkKZlY0e6 N1kw== 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=FY0wD2UkXwBMAhrvr3pnyT+7HafPZz09VcYHFJbiKOg=; b=TJHEA1gExaSY9OE33NRopFPF1quimhcXdtE/Z8xXjYGyUe7wG873jpC9kPbLRELATL 7u+eD/rr4IuhYVrk3InbLgwTJpdV4f3pEYOdnVq5iryUDn9o24tAmvU/AYoAxM6dGdh4 f8UxfM8xxKzPKwfjLujA3VyDA92zNcR2aC13M5ZSpS/zEkuaBDW0zWRgg9L0RdoYsoov KpffesLb0SgMTixX9u58606cDt9tqCVkJmGcSoKtgPvT5ugTkvvU6pa92BfcURui1Xfn cdPJ6eN+ibAvUvTyAKjBjBr0E1c9W3jAuzUhZSpKZA4/dLJ/O4rbv3A2ZeSi6E1nat+2 yb4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VsnnDUNc; 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 n78si13424973pfi.235.2018.12.11.08.21.43; Tue, 11 Dec 2018 08:21:58 -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=VsnnDUNc; 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 S1728309AbeLKPqS (ORCPT + 99 others); Tue, 11 Dec 2018 10:46:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:34688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727498AbeLKPqQ (ORCPT ); Tue, 11 Dec 2018 10:46:16 -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 9AF9520870; Tue, 11 Dec 2018 15:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543176; bh=ztas7Ka7ipXF9UKQEdjTl3lruFoAOYv4sK7vJlVFfRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VsnnDUNcX7Z0/bYcLSefwVjjds8FB+rzzZoUDZRzCThEwAgZlsHR/xlV41FkSt9/9 KIdxhCz5QFMnOhXuqgSmBnzeTTWFvkAdUohEDzCECDhbmFhkkq5s1sOTbwaS686Aqk y09M4J1ZaHB6FPIpneeykEBKIer/RkmdoF3f2Jxg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Laura Abbott Subject: [PATCH 4.4 41/91] kgdboc: Fix warning with module build Date: Tue, 11 Dec 2018 16:41:00 +0100 Message-Id: <20181211151609.288618598@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@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 4.4-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) {