Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3804448ybl; Mon, 3 Feb 2020 06:53:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwTzYXCI/nROpdWnU6zokCDLRo9lWK3DsHYoW/XRbU/AjDXOqLx4MzanGHgbZcJTdCpVsNW X-Received: by 2002:aca:72cd:: with SMTP id p196mr14061811oic.99.1580741598094; Mon, 03 Feb 2020 06:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580741598; cv=none; d=google.com; s=arc-20160816; b=Xt5tuioLV99AxOA7SftfZvwaZwn2/keUDD9Y//6+aKuk48G29TQhG26F2Ev2VO8Xs2 /y5jMwbBOjnx79Bxc9hXw1QD6bjnBK6OnQMpi+unFE1pQjtDMzDHFvfG9P+RcN/H3VYQ 3dLFE+SRmcB61Kxh4L9qHZy7MvyAJmR1fHje8gfn4BDpJFrvrY2jfl/+dBRZaVO7yIJt GKe1z0CBpVlVPpmVbjzm9StwjN8QVaHrH1l62Zm2FXTaycQp0coaNwuYT0GWZZor9PNX gzLHakDwdUl2dGlFr85Jsu22btZsOHq+3StwX0+doNWAO/7ulUJrPlyuaG0gMz6fM2Fl 6TJQ== 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 :message-id:date:subject:cc:to:from; bh=N1x/yGY3tQPH7XTixuvC+6grhk5mYHYmGJPf1/Jn1sg=; b=gDGFvLYzEVGcKymjamC6QdN4iYQXh0xSamEqoBUKVFwzXEGB/OQ5v8NTSArwSyuNM6 h8H+AKIooM1EzHeC47VixTe8RFj1KhdDcTVycJs4RV7KQyQROnkhHv0sIigkev4Z3xAS bam/or4Q02geFj9eIQZZLSK6JfxEUGoIm6UpHks7pgnSz/X48k4XVw/7nGge5/9V29CZ sYwczUVFXOx77Id+xyZoWIiIlqkHC77mILzMHg+K19b+v7hGlLRe/8GEbH5Tty3pjUM5 RXrVwvXQsgC6H0iZRn9pqX1OOu4cG3K4XpRpaT0yOErt51GimajPkPPVZHa+nk8TeIKq YqhA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si8902140otp.124.2020.02.03.06.53.05; Mon, 03 Feb 2020 06:53:18 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728189AbgBCNPc (ORCPT + 99 others); Mon, 3 Feb 2020 08:15:32 -0500 Received: from mga07.intel.com ([134.134.136.100]:15733 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727899AbgBCNPc (ORCPT ); Mon, 3 Feb 2020 08:15:32 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 05:15:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,397,1574150400"; d="scan'208";a="337145773" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 03 Feb 2020 05:15:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 22E1514E; Mon, 3 Feb 2020 15:15:28 +0200 (EET) From: Andy Shevchenko To: Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Steven Rostedt Cc: Andy Shevchenko Subject: [PATCH v1] printk: Declare log_wait as external variable Date: Mon, 3 Feb 2020 15:15:28 +0200 Message-Id: <20200203131528.52825-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Static analyzer is not happy: kernel/printk/printk.c:421:1: warning: symbol 'log_wait' was not declared. Should it be static? This is due to usage of log_wait in the other module without announcing its declaration to the world. I wasn't able to dug into deep history of reasons why it is so, and thus decide to make less invasive change, i.e. declaring log_wait as external variable to make static analyzer happy. Note the above is done if and only if the CONFIG_PROC_FS is enabled, otherwise we fallback to static variable. Signed-off-by: Andy Shevchenko --- kernel/printk/printk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 633f41a11d75..43b5cb88c607 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -418,7 +418,14 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); } while (0) #ifdef CONFIG_PRINTK + +#ifdef CONFIG_PROC_FS +extern wait_queue_head_t log_wait; /* Used in fs/proc/kmsg.c */ DECLARE_WAIT_QUEUE_HEAD(log_wait); +#else +static DECLARE_WAIT_QUEUE_HEAD(log_wait); +#endif /* CONFIG_PROC_FS */ + /* the next printk record to read by syslog(READ) or /proc/kmsg */ static u64 syslog_seq; static u32 syslog_idx; -- 2.24.1