Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4748705ybl; Tue, 4 Feb 2020 01:07:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxp6qE0pNnNwPHZzzxxaox4swM2Wl5SrNYkaldOH2Hnw2gh/Kvockb/r9ZuLVX4z1zJ7LFg X-Received: by 2002:aca:3542:: with SMTP id c63mr2779165oia.135.1580807228061; Tue, 04 Feb 2020 01:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580807228; cv=none; d=google.com; s=arc-20160816; b=fsbeMEbeI4EVdJ+xWMUaz4+qsQ2mg411Bi4/0bD/AQdPNS0X2d4odreDAmu/NUgfhh /WFaYCo9EN+RPpaCCDu+HOCsI3MHQJIUHZsCdx5reD8v07wnbRxX3kY4kspCqnat6FGV x/Yt8vtn7EQ7vnHoHEH1zwmG6HkRfIF9GPizvriPMcUQEXl9U5kpvImTzKDwQtqm5l1p ZDQO+bNJl4eOwH1jjiks70uKoiB1OhvaonWbWwZV49sfu4RwUysDvJxqLAcwI3e5MlW/ k6zovakgWHjkAtZ5dYz7J3OfBL1B/ooV+JPUgeLqy+Ph2NjwTVKHAHXJgL9szraZNOQv XWQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=esQJt+vcIHQRvYfdn5yEWtN/64LRPnIKgMjQS5d0iIo=; b=eAXoa6X0Vz+nGpAfmV6GqgQl6yCweYuqLKm0/3aIrPb8+b7jmSnRnRan7KoP2TXuOT 7J1MEbyXzZT2SLgp1GcP+TRQMPpW5lFErLthPIVQ7PLUAmRQaVw9xuiPFMpXpsPNtpin vxg8VxVWRM3auY4iI/uKWOUb8zBSQQT4dlDckmmA8bU9Z5HJwkRaYGT2LaCYrBxcb1/6 sQWoUjmBWZcYtTyQWZMtjF6ArjBfmwSD1sowpZP3YxcM606f/VKf82JYGicwnrNAZhqn +zchiohP6MTAiHEgN6WRAsgoZnSWxvDCzYCZCPIwoY48FvT/wlXFzHUf0KaeZMl+4uVB cFhg== 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 w29si13023913oth.313.2020.02.04.01.06.55; Tue, 04 Feb 2020 01:07:08 -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 S1726706AbgBDJFe (ORCPT + 99 others); Tue, 4 Feb 2020 04:05:34 -0500 Received: from mga03.intel.com ([134.134.136.65]:38191 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbgBDJFe (ORCPT ); Tue, 4 Feb 2020 04:05:34 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 01:05:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="403728065" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga005.jf.intel.com with ESMTP; 04 Feb 2020 01:05:32 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1iyu9F-0002I6-Qs; Tue, 04 Feb 2020 11:05:33 +0200 Date: Tue, 4 Feb 2020 11:05:33 +0200 From: Andy Shevchenko To: Sergey Senozhatsky Cc: Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH v1] printk: Declare log_wait as external variable Message-ID: <20200204090533.GM32742@smile.fi.intel.com> References: <20200203131528.52825-1-andriy.shevchenko@linux.intel.com> <20200204021620.GD41358@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200204021620.GD41358@google.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 04, 2020 at 11:16:20AM +0900, Sergey Senozhatsky wrote: > On (20/02/03 15:15), Andy Shevchenko wrote: > > 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. > > [..] > > > 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 */ > > [..] > > Since we are now introducing CONFIG_PROC_FS dependency to printk (and > proc/kmsg already has CONFIG_PRINTK dependency), I'm not sure I understood. The above does not introduce any dependencies. > then I guess I wouldn't > mind it if fs/proc/kmsg would just relocate to printk, next to devksmg > implementation. Just saying. -- With Best Regards, Andy Shevchenko