Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4337451pxf; Tue, 30 Mar 2021 05:35:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylvH8v/EwEfVb75YMGWRmoUZJq9f/VLJr8o4XdSKWy0Srbfgk6GiJdsvq1xP7mPWtjRART X-Received: by 2002:a50:ee19:: with SMTP id g25mr34041236eds.351.1617107717993; Tue, 30 Mar 2021 05:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617107717; cv=none; d=google.com; s=arc-20160816; b=GGG3FZBMtgLxvhXDpAcgqdjT4EX2TlMDhhOvblsPCexMkJ+vIoGeejcbkhdwoNut4R kHjMiF8vUXn3rLDgHhL0ksb5QKEjwBO2SaW4kTzgIEektmn+yrTtc5YpOkM2+0RwvMil Aw+WVZND7AYZie1NDCLgNjrBaAPm+u4lcPADNCvLp1l7mjzxo2mG3H7+wo+r0AOxB/G+ tzTT6m6o9pL9ncNRDwDzhvlBFZltiG+UOMkcq1D5VOjvUgqyFJScyKIg6Sxq+28TO588 gQfZczRbtSb9VLCn8r0y98zojGT7yTWzDkR2bD1geDKakrQnnJMWjV0pvUEiuQwFknah PCeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+KozPiJQTytzSNBU+UR3a9N/8P0fhe+v0pQLK/6Wv4I=; b=KNwljS42+SEaup8QklxOv3lO9J7Z3qg614op891nMC0yZELZtF9AzojC1YHDAvSWrZ ucoDJue72tXhf8khQShyMJTUt+QwUU3tOgU6cgw/+B0AAmZyH6stzTmTsb/i5Dam7X7g mZtKTWBXJ9fT2eHFlMzosfJhgjUjIYKQp7SI9D4XlkoKSyPbAK70nAYUE0UhVv5f+e3Q RWqE8ORgzNKfd5AAkGQoM6/4dTf7rhFuSa2HvmGc9PxSP/2DisQPHS2F7UwSCw6bm9h+ f5b2GlrfYHMwBJ2ll/JPAWAUKr7XKcVb87QDM+NyeFCK7sEck7IvK8O7kQ2sIgBoI7Iw vqpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="ibIP/N6f"; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 13si15803895edx.282.2021.03.30.05.34.55; Tue, 30 Mar 2021 05:35:17 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b="ibIP/N6f"; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231933AbhC3MdY (ORCPT + 99 others); Tue, 30 Mar 2021 08:33:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:53576 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbhC3Mc5 (ORCPT ); Tue, 30 Mar 2021 08:32:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1617107576; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+KozPiJQTytzSNBU+UR3a9N/8P0fhe+v0pQLK/6Wv4I=; b=ibIP/N6fgCM6UuobdxTRUPeNd21KLYB2zq8vzg4ub2Yek4ky1z54IdsW6Fr9JZn+qtmbVz OllGw7jLaRZOwbgfO1s1HAC46OToVcRvMmKK2lWBYOiYhEe1HD8+OMolwmKbI9c6z4dSvX mwoXsQ6MQZH4S6cWdeQAEgXD3rlcXmw= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 51546B2F4; Tue, 30 Mar 2021 12:32:56 +0000 (UTC) Date: Tue, 30 Mar 2021 14:32:55 +0200 From: Petr Mladek To: Rasmus Villemoes , John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: rename vprintk_func to vprintk Message-ID: References: <20210323144201.486050-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323144201.486050-1-linux@rasmusvillemoes.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2021-03-23 15:42:01, Rasmus Villemoes wrote: > The printk code is already hard enough to understand. Remove an > unnecessary indirection by renaming vprintk_func to vprintk (adding > the asmlinkage annotation), and removing the vprintk definition from > printk.c. That way, printk is implemented in terms of vprintk as one > would expect, and there's no "vprintk_func, what's that? Some function > pointer that gets set where?" > > The declaration of vprintk in linux/printk.h already has the > __printf(1,0) attribute, there's no point repeating that with the > definition - it's for diagnostics in callers. > > linux/printk.h already contains a static inline {return 0;} definition > of vprintk when !CONFIG_PRINTK. > > Since the corresponding stub definition of vprintk_func was not marked > "static inline", any translation unit including internal.h would get a > definition of vprintk_func - it just so happens that for > !CONFIG_PRINTK, there is precisely one such TU, namely printk.c. Had > there been more, it would be a link error; now it's just a silly waste > of a few bytes of .text, which one must assume are rather precious to > anyone disabling PRINTK. > > $ objdump -dr kernel/printk/printk.o > 00000330 : > 330: 31 c0 xor %eax,%eax > 332: c3 ret > 333: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi > 33a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi > > Signed-off-by: Rasmus Villemoes Nice clean up! Reviewed-by: Petr Mladek John, it conflicts with the patchset removing printk safe buffers[1]. Would you prefer to queue this into the patchset? Or should I push it into printk/linux.git, printk-rework and you would base v2 on top of it? Best Regards, Petr