From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C949C433DB for ; Tue, 30 Mar 2021 14:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40351619C8 for ; Tue, 30 Mar 2021 14:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231897AbhC3Odz (ORCPT ); Tue, 30 Mar 2021 10:33:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:54172 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbhC3Od1 (ORCPT ); Tue, 30 Mar 2021 10:33:27 -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=1617114806; 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=wBgZ8tlZn3Xixh8yXIPbPVU7d9PQptM+o2bcwOjOm30=; b=BTzZdQ9MYcl7OPDNQG625jiwI2Vw3U2cUsGpzLB4NG1ERtogcEinUyPJnWqchFiYSjbvyf 6dkcFb64RlHf4Io+xSlyrtNH+LH0uy3P4JptrUNoF9BYbKKv6pWxB60ZJzn/XRiSKljnGG N9iRDSVqa04MfRFx4UIrxxFh4QUKP/8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0F1B6B312; Tue, 30 Mar 2021 14:33:26 +0000 (UTC) Date: Tue, 30 Mar 2021 16:33:25 +0200 From: Petr Mladek To: John Ogness Cc: Rasmus Villemoes , 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> <87k0po4x1o.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k0po4x1o.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2021-03-30 14:59:31, John Ogness wrote: > On 2021-03-30, Petr Mladek wrote: > > 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? > > Please push it to printk-rework. I will base my v2 on top of it. The patch is committed in printk/linux.git, branch printk-rework. It is queued for 5.13. Best Regards, Petr