Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5918645ybe; Tue, 17 Sep 2019 16:04:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiD5nsWRVlOEeoWJ2D6FOecoZCtPpe/YDrQghBn7pf8PQxSbeZ9NDDQqtqT3pBwFcoJTbJ X-Received: by 2002:aa7:d295:: with SMTP id w21mr139261edq.302.1568761499547; Tue, 17 Sep 2019 16:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568761499; cv=none; d=google.com; s=arc-20160816; b=KNlXvwytwouXyM3oPuxL5t35vsO/tDKxibQvmGfmETNyA4uWtN7gdC+roZKDlwz2fB 5AmJbCcr/2k6fxhTHw/LABkmOG8SZpEMXDYLZgxYBoBE6zouEkROSPVrLCVLn7lfDkLU svw/2R5TARQ6iUGa6mrh3ufctYCHPDY8BDWcuEX/NexzP+cJ7OJGIfK4ZaI0TR9o/mRN J7CQBS8v8n9eDV+vT1T0MhCiDs/fFT3fL2SGMrjuZdMdlbZUfa3hBP0ns9kgsATMsLNX 7LYQO9fX7W98qox0JZAIsKDTgIKDgZsdy5GqD2oaQKea/4cMkV2CBnNEHGc349V3HLAj nWaw== 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=S6k/QaGygzYAeuWmmB+e88YRe53Bv2TvMGDvvK9E/I0=; b=L7sCUazA+Xbxa1phozsukUyRK7s94p7iRDlf0LhWGV8GvHMkV82zH62E9z5UwrQIfd 2zzKoM6juqPZd0TKeRJKjk7aPovvP6CyfEx0OLBH6BPaj2NXdfHGingvH3Tmsp1+PwOW PoQeFGZtDLKRPFje07SfqU+AOQK0OzRCawveIVNOjUNfTMH4Zo8B3jiWiBRlj37X7cba K3iPHipiPUfcRo9ePTGyIBnLdlA7VOu7l/GF/1od2guwqLJAS1R1D/aXF8CukN2CWES+ JwdIVn/aOH56NY18p/LrZYv2CvzaSdVfouiYzwsQHCgF+VKBjBwUZYdMA8sp+9xjkXAf 0eBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K4UliqZK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14si1988928ejq.70.2019.09.17.16.04.33; Tue, 17 Sep 2019 16:04:59 -0700 (PDT) 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=@kernel.org header.s=default header.b=K4UliqZK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbfIQNMH (ORCPT + 99 others); Tue, 17 Sep 2019 09:12:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:54832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbfIQNMH (ORCPT ); Tue, 17 Sep 2019 09:12:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A48C9214AF; Tue, 17 Sep 2019 13:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568725926; bh=r2S4lynJJ6O9qN2X1R+bVDf3htiFuzgHM7G+DZQKv/4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K4UliqZKz9k7SLXGwzNEniFLuQ3+KXOTy+qv8CrijzV76bU/dsAQuGB+JBEBZdEat V4Gl1yDuf+gkoCpLGRAa6dDIlNSJ4sRbaX7sunAMRj8FFLSyq3h0BjtRzT2ICxRpSv NvqlYtfwYtFIs1z0R6y7P5layOyBRNGianGurRxU= Date: Tue, 17 Sep 2019 15:12:04 +0200 From: Greg Kroah-Hartman To: Steven Rostedt Cc: Petr Mladek , Daniel Vetter , AndreaParri , Sergey Senozhatsky , Sergey Senozhatsky , Brendan Higgins , Paul Turner , Tetsuo Handa , Peter Zijlstra , John Ogness , Thomas Gleixner , LinusTorvalds , Theodore Ts'o , PraritBhargava , LKML Subject: Re: printk meeting at LPC Message-ID: <20190917131204.GA745680@kroah.com> References: <20190905143118.GP2349@hirez.programming.kicks-ass.net> <20190905121101.60c78422@oasis.local.home> <87k1acz5rx.fsf@linutronix.de> <20190916104624.n3jh363z37ah2kxa@pathway.suse.cz> <20190916094314.6053f988@gandalf.local.home> <20190917075216.agzoy6cnol5eio6y@pathway.suse.cz> <20190917090254.46131564@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917090254.46131564@gandalf.local.home> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 17, 2019 at 09:02:54AM -0400, Steven Rostedt wrote: > On Tue, 17 Sep 2019 09:52:16 +0200 > Petr Mladek wrote: > > > Heh, I did some grepping and the return value is actually used on > > three locations: > > > > $> git grep "= printk(" > > drivers/scsi/aic7xxx/aic79xx_core.c: printed = printk("%s[0x%x]", name, value); > > drivers/scsi/aic7xxx/aic79xx_core.c: printed += printk(" "); > > drivers/scsi/aic7xxx/aic79xx_core.c: printed += printk("%s%s", > > drivers/scsi/aic7xxx/aic79xx_core.c: printed += printk(") "); > > drivers/scsi/aic7xxx/aic79xx_core.c: printed += printk(" "); > > drivers/scsi/aic7xxx/aic79xx_core.c: cur_col = printk("\n%3d FIFO_USE[0x%x] ", SCB_GET_TAG(scb), > > drivers/scsi/aic7xxx/aic79xx_core.c: cur_col += printk("SHADDR = 0x%x%x, SHCNT = 0x%x ", > > drivers/scsi/aic7xxx/aic79xx_core.c: cur_col += printk("HADDR = 0x%x%x, HCNT = 0x%x ", > > drivers/scsi/aic7xxx/aic7xxx_core.c: printed = printk("%s[0x%x]", name, value); > > drivers/scsi/aic7xxx/aic7xxx_core.c: printed += printk(" "); > > drivers/scsi/aic7xxx/aic7xxx_core.c: printed += printk("%s%s", > > drivers/scsi/aic7xxx/aic7xxx_core.c: printed += printk(") "); > > drivers/scsi/aic7xxx/aic7xxx_core.c: printed += printk(" "); > > drivers/scsi/aic7xxx/aic7xxx_core.c: cur_col = printk("\n%3d ", i); > > drivers/scsi/aic7xxx/aic7xxx_core.c: cur_col = printk("\n%3d ", scb->hscb->tag); All of those can be removed as none of the returned values are used. What a mess. > > drivers/scsi/libsas/sas_ata.c: r = printk("%s" SAS_FMT "ata%u: %s: %pV", return value is also ignored, this can be fixed. > > kernel/locking/lockdep.c: len += printk("%*s %s", depth, "", usage_str[bit]); > > kernel/locking/lockdep.c: len += printk(KERN_CONT " at:\n"); That seems to be the only semi-legitimate use, but if it _really_ needs it, it can just create the string ahead of time, and use the length then after it printks it out. > > It is probably not a big deal. For example, lockdep uses the value > > just for formatting (extra spaces) when printing backtrace. > > > > I agree that it does not make sense to return the value if it > > complicates the code too much. Well, we will need to count > > the string length also from another reason (reservation). > > Well, it's being used. I was thinking of dropping it if it was not. > Let's keep it then. I think it should be dropped, only one user of the kernel is using it in a legitimate way, which kind of implies it isn't needed. thanks, greg k-h