Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp456983ybt; Fri, 19 Jun 2020 06:03:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpBnGD3NaKsXaU4sPaHu/K+jrM9foGxv/UuDavO5r3nGv6kqA4ZPyjcOoZnDpr45HkNJeQ X-Received: by 2002:a17:906:3e0c:: with SMTP id k12mr3419554eji.441.1592571783869; Fri, 19 Jun 2020 06:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592571783; cv=none; d=google.com; s=arc-20160816; b=HcaqnQT8ZCWJekHfoYc2UajhLtHQ07ydhZ59l7CxWS669Bef2qobVQKImolVHgN8VH 5YaOiZMFTTve+EW+0mGPZlQvZhEDYpE9IpbISViCliVZ4UsN4AstnQ+MWTRi6fNRBsVE KpNh5FEkzfZX0pLmrOf0RBkY+H3+iLvG94ntKKxd+6A/qAShFXk8EmbCvqqc7GN/4c8o rCVIvS9981uG2q1umKWir5Dv3YvVWuc5CqPF99zfJZZKlpPC1yRmWn+HF8OgsK376brK xrU37LWA0k9b4ssemwTSauuZeqqW+F9DDioX5tLbpp2Dw0N0XzINC0UFa9dFpgrCME7g 4xDg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=sVf/pNzXSyUQrqnDGsFlO/JH4NIqkzDquTFpNEgb9NQ=; b=VaeU4Mxvflf0oIT/BkjEYHKBv9Ae3M9IAJ5z4chWdBficUEn6PqfIRga9+y1/ts5y7 18NhwUXUafa/Atd8376/6j9Sx1FNBxH2z/K65t5Lcjtu+mmHLGJpHmXJnQjsHjcvQIfR C3gcJWcdD+6kYVOdNbmLMYEBq41eMO6pd24zDATj9XEayoRUtarpqziJW20SyiC4MZSZ aj+KFWm0CjhPb/+xgzbB5o3sn3FHfNA4MZqnldNhlK4Wt76uVI4NIcZHzsTNESPt6+yr 153/dgz2AmGl5WdNTNcAZ3hgsyQo3VWrGdlLMsK3py+FgZ1/8FQDXzcbsl5WHfPcYVSS neoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o93si4205054edd.280.2020.06.19.06.02.41; Fri, 19 Jun 2020 06:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732121AbgFSM3W (ORCPT + 99 others); Fri, 19 Jun 2020 08:29:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:42186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730934AbgFSM3W (ORCPT ); Fri, 19 Jun 2020 08:29:22 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 13B45206C3; Fri, 19 Jun 2020 12:29:20 +0000 (UTC) Date: Fri, 19 Jun 2020 08:29:19 -0400 From: Steven Rostedt To: John Ogness Cc: kernel test robot , Petr Mladek , kbuild-all@lists.01.org, Peter Zijlstra , Sergey Senozhatsky , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Paul McKenney , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] printk: _printk_rb_static_dict can be static Message-ID: <20200619082919.5d604e58@oasis.local.home> In-Reply-To: <871rmbim8e.fsf@vostro.fn.ogness.net> References: <20200618144919.9806-4-john.ogness@linutronix.de> <20200618182323.GA72993@4e49555bcca1> <871rmbim8e.fsf@vostro.fn.ogness.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Jun 2020 08:49:21 +0200 John Ogness wrote: > > +++ b/kernel/printk/printk.c > > @@ -434,7 +434,7 @@ static u32 log_buf_len = __LOG_BUF_LEN; > > */ > > #define PRB_AVGBITS 5 /* 32 character average length */ > > > > -_DECLARE_PRINTKRB(printk_rb_static, CONFIG_LOG_BUF_SHIFT - PRB_AVGBITS, > > +static _DECLARE_PRINTKRB(printk_rb_static, CONFIG_LOG_BUF_SHIFT - PRB_AVGBITS, > > PRB_AVGBITS, PRB_AVGBITS, &__log_buf[0]); > > _DECLARE_PRINTKRB declares multiple variables, so this patch will not > work as intended. I would like to declare the variables static but am > not sure how best to go about it. > > In the Linux source I see examples of macros just desclaring the > variables static. And I see examples of the macros providing a parameter > where the "static" keyword can be specified. > > Since the ringbuffer was created exclusively to serve printk, I would > prefer to just have _DECLARE_PRINTKRB (and DECLARE_PRINTKRB) declare all > the variables as static. Haven written macros that do such things, I agree with your last statement. Just have the macro declare all the variables static. -- Steve