Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1377026ybk; Thu, 21 May 2020 05:35:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynIrSd64HprSAYbLnjxaUhoI/2VV/BEjMCCQ5+QwzJgwuS3nvZPI5AUhlOmNQoRablwUud X-Received: by 2002:a05:6402:150f:: with SMTP id f15mr7760822edw.36.1590064517817; Thu, 21 May 2020 05:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590064517; cv=none; d=google.com; s=arc-20160816; b=s8/C2e8BT4aZUMy0KQWChoyHIAU2Zf6uYvVb6avsu8WwTLyHPis1R2zHNQgTlx1VfV 9rtmin+nMB8IXx+USpeW/qLjywvZImP9Sjfdf18nR81HwAJGBCqFQMABBG3CsN+4tYST YfSLO/EhcUVlv9bbmuQ0RqEZRtdyK2wExvCrr18HDpTWIhmSZbDaaamzncuhTKYwouq+ J8TQOc24Su/l4lc+N0ebjkpk88t6ewq48xlQn7naWOrUC9hGWWGpR1fnvtR9jUlLCmmh Bw5zoJBVDOBHpFYp8aSmJA4cp8MICLDQXBLgYG8/yKIYgUPOm7pVh9iEbuzDkieGDBoA +wNw== 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; bh=tPBK6rPVeM5lj5rDEHlu57BU0CHxkkHAm8vqVhqQQSM=; b=kt8xrUQgs/z8FLikTkszFOh5vkcoxnx0gAERCDl1F9IAADSmewtNMlgZ1hrYdwIXts RIFdBlJqQBjoMssI6vubPoU4K/AJzHJHUHL1JkjX2C+oTJ2FUsqyOuEKB1b3EcCxA6Nn LqYZ+KGJ8xobR5Apppk24CgpkQvMs1Ofn0Dv1rHePgbv3qk7tqeKedIjcmarC7V3dScJ ZQI2J6PRk+UpXVTtCpWvm9S+4St/rviSQraAJycW8oxbFgHBUj2BOP+G5xBtfCCQwBOR GyAHl3EcKBOmJleiEDB4iT7PrPgKYOBhPspQeCrcjNqb4vVteL6z8bZSy1U+thJiq68K CE/Q== 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 b20si2937429edt.349.2020.05.21.05.34.54; Thu, 21 May 2020 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; 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 S1728258AbgEUMbV (ORCPT + 99 others); Thu, 21 May 2020 08:31:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:48482 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728037AbgEUMbU (ORCPT ); Thu, 21 May 2020 08:31:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3BCBCAC20; Thu, 21 May 2020 12:31:22 +0000 (UTC) Date: Thu, 21 May 2020 14:31:17 +0200 From: Petr Mladek To: Andrew Morton Cc: Sergey Senozhatsky , Joe Perches , Chenggang Wang , linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [RFC PATCH 2/2] init: Allow multi-line output of kernel command line Message-ID: <20200521123117.GD8397@linux-b0ei> References: <2b3832fed9370f0f8dfd1ea33dddb1d05a36e265.1589916689.git.joe@perches.com> <20200520044127.GB938@jagdpanzerIV.localdomain> <20200520121000.GF520@jagdpanzerIV.localdomain> <19a8c717f8d9dc76f2b09e6dd19f3fbb71bf29c5.camel@perches.com> <20200520180028.8fc1b7890774c6f92a6c2623@linux-foundation.org> <20200521043628.GB755@jagdpanzerIV.localdomain> <20200520214007.86f36f61e1fc0329b66758ed@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520214007.86f36f61e1fc0329b66758ed@linux-foundation.org> 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 Wed 2020-05-20 21:40:07, Andrew Morton wrote: > On Thu, 21 May 2020 13:36:28 +0900 Sergey Senozhatsky wrote: > > > On (20/05/20 18:00), Andrew Morton wrote: > > [..] > > > I'm wondering if we shold add a kernel puts() (putsk()? yuk) which can > > > puts() a string of any length. > > > > > > I'm counting around 150 instances of printk("%s", ...) and pr_foo("%s", > > > ...) which could perhaps be converted, thus saving an argument. > > > > Can you point me at some examples? > > > > ./arch/powerpc/kernel/udbg.c: printk("%s", s); > ./arch/powerpc/xmon/nonstdio.c: printk("%s", xmon_outbuf); > ./arch/um/os-Linux/drivers/ethertap_user.c: printk("%s", output); > ./arch/um/os-Linux/drivers/ethertap_user.c: printk("%s", output); > ./arch/um/os-Linux/drivers/tuntap_user.c: printk("%s", out > > etc. > > My point is, if we created a length-unlimited puts() function for printing the > kernel command line, it could be reused in such places, resulting in a > smaller kernel. Interesting idea. Well, such a generic function would need to be safe and do not modify the original string. We would need to implement printk() variant that would support strigs limited by size instead of the trailing '\0'. I am not sure if it is worth it. Best Regards, Petr