Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4401934ybl; Mon, 3 Feb 2020 18:19:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwsjJ85Hp7+sivS8g3XTaZEvzuv6TpPavxVveCcZ7S2v1g3RAtjjys0AXecUZl4xW+AKt9O X-Received: by 2002:aca:5248:: with SMTP id g69mr1670951oib.106.1580782745644; Mon, 03 Feb 2020 18:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580782745; cv=none; d=google.com; s=arc-20160816; b=cVUqiqW8E818k9wb299XAlsWzLa5SBpuHaxTuerboQxUdbbbMJgqv30uhfRu22zmSt CB7B1zVPUKv+dkQ0ZV8yhzSUd5JkLNszQZf0jWAUV4xYtTozeSO3qXPYWVi7l7Hka+iT fNBe4fgWgQdhkPmYBzxKEN5hkA4t2hoSuagnS41hjy+qrlIBSIzA8fJSyPE5Ansts4ih kqIgWeYVqFTooBpoT4jdosotgex35LXfyctri/W2hi2s+100upgXPhrdOd9tEAyCsyDw /EslCQvLIWWbWDziBP8CAa7XcQHlxh7hNom7ni69IEqSxRmPxHBM7U56FQDpaxhUG6cE HXXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QH6t5+P9IvjHew1g3+ZZFvveJFDwCjcHV2ml4p3nTPg=; b=n12QefZOJeGBkJgsdVK5sM2kR41VsOK9VEfUaiOq17PxvE2naHEMgMVaVcOwkGX/qf d93ElP3eSymRw0kmRaFYFhBEgc/zGjCt2w2s1NNAl+U/bUZTjIqEegqHMy3jTQM7Kfqi QpGlT2JMggOYBTpskKvmyVZykbSknlvbaEcP2zjmpS+QWKZW235MDHjejUth4+fpSNQv x+8pilFMOubiBCp/ITUJ0TK57b6wOWpVTGb8GkejBpEP39/IE6YgN7IlhDgONlaODc6y eWFQr5MmkE3GlkW+yW9nzePh5H8SXY3FbEhJ4UfG4l6KckizSi8KepbC14O7/xXfSPiA hkxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eozpiRxf; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o15si10866702otp.314.2020.02.03.18.18.52; Mon, 03 Feb 2020 18:19:05 -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=@gmail.com header.s=20161025 header.b=eozpiRxf; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgBDCQY (ORCPT + 99 others); Mon, 3 Feb 2020 21:16:24 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44015 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbgBDCQY (ORCPT ); Mon, 3 Feb 2020 21:16:24 -0500 Received: by mail-pf1-f194.google.com with SMTP id s1so8608618pfh.10 for ; Mon, 03 Feb 2020 18:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QH6t5+P9IvjHew1g3+ZZFvveJFDwCjcHV2ml4p3nTPg=; b=eozpiRxf1ifzipl/Fgd3fvIqP2hdE/FX1LeJgVDf44CUROE3vz1QaKnniZ1qT7Aj16 6AChhuW2rNu52u+DvKIV8aKwXeHTlgB1ekN2Tf0ZOgGrbEnI71mFV1QUsThfvmcRh3ho 000MtGIG3o4WdZfGtS93vreC3xN1/FbLyR0v40NzvNHNxtXAblWqYXdUxQPDrQeOEZ4Z 1PkZjEKuuXbkioEyuiJnEO2HXDTu3XnQbSB7oCClZRrj2L1fTAVG4m1WGq4qoVcrkd8P 5qr5BV86idf/vtK4/KYNdjSRi8neOXG+pn9Y+Uf12rkE2u4V3KIYRO08CbRxcCathKr1 unhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QH6t5+P9IvjHew1g3+ZZFvveJFDwCjcHV2ml4p3nTPg=; b=sKky7TVl5q51oRhF11QZPVeVOINXkXqqh4XLytUJtgx4uSvhWx5c1dbs7SggK/zejM XVYy7GHIOBrXqw/2mutPLS+gIFY5Ue1Wd4+6wUEwHLZ1PCotl56lEOj5Q3xVHk5RuQtJ /1b8xQw+tGAyTEHp44A77F+E8Xhl7buUpQEgbWde4e/PGYO7GWNOGb0E9mOStaE5ELs7 adkTlimUDiJ4BBEP0Im7ystFan9viFCs+t55mbqlmA4j+PpKhFIcRLtQEJI5Yp9GHCHj 2e1AMDxB9z40Q3GKO5OeZdBY/JhknhyzOlHoVI78cvFOGCZy6ryrSLpyqa4zAzQQfvb+ 5cvA== X-Gm-Message-State: APjAAAUu8DBFgyv+1Rh3LsyrupTcmP8uWszGfYUfCrQXLizD5O4W3uW7 nOActJ3oudwpwCy253Hb5gHhMslX X-Received: by 2002:aa7:9a0b:: with SMTP id w11mr8842662pfj.4.1580782583373; Mon, 03 Feb 2020 18:16:23 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id w131sm22534230pfc.16.2020.02.03.18.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 18:16:22 -0800 (PST) Date: Tue, 4 Feb 2020 11:16:20 +0900 From: Sergey Senozhatsky To: Andy Shevchenko 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: <20200204021620.GD41358@google.com> References: <20200203131528.52825-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200203131528.52825-1-andriy.shevchenko@linux.intel.com> 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 (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), then I guess I wouldn't mind it if fs/proc/kmsg would just relocate to printk, next to devksmg implementation. Just saying. -ss