Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752579AbdGGXD0 (ORCPT ); Fri, 7 Jul 2017 19:03:26 -0400 Received: from smtprelay0120.hostedemail.com ([216.40.44.120]:33100 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751100AbdGGXDY (ORCPT ); Fri, 7 Jul 2017 19:03:24 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30,2,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2689:2692:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:4419:4605:5007:6119:7903:10010:10400:10848:11232:11658:11914:12296:12740:12760:12895:13069:13071:13311:13357:13439:14096:14097:14180:14181:14659:14721:21060:21080:21433:21627:30012:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:1:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: trick15_57ba43c6a9d36 X-Filterd-Recvd-Size: 2289 Message-ID: <1499468601.20988.7.camel@perches.com> Subject: Re: [PATCH] printk: Modify operators of printed_len From: Joe Perches To: pierre kuo Cc: pmladek@suse.com, Sergey Senozhatsky , rostedt@goodmis.org, linux-kernel@vger.kernel.org Date: Fri, 07 Jul 2017 16:03:21 -0700 In-Reply-To: References: <1499445024-23524-1-git-send-email-vichy.kuo@gmail.com> <1499447553.20988.3.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1310 Lines: 35 On Sat, 2017-07-08 at 04:32 +0800, pierre kuo wrote: > hi Joe: Hello Pierre. > 2017-07-08 1:12 GMT+08:00 Joe Perches : > > On Sat, 2017-07-08 at 00:30 +0800, Pierre Kuo wrote: > > > In 8b1742c9c207, we remove printk-recursion detection code in > > > vprintk_emit(), where it is the first place that printed_len calculated. > > > After removing above detection, it seems we can directly assign the > > > result of log_output to printed_len. > > > > [] > > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > > > [] > > > @@ -1754,7 +1754,7 @@ asmlinkage int vprintk_emit(int facility, int level, > > > if (dict) > > > lflags |= LOG_PREFIX|LOG_NEWLINE; > > > > > > - printed_len += log_output(facility, level, lflags, dict, dictlen, text, text_len); > > > + printed_len = log_output(facility, level, lflags, dict, dictlen, text, text_len); > > > > If this is appropriate, this should also remove the > > initialization of printed_len and perhaps rename it too. > > I cannot quite understand the reason why need to rename. > printed_len seems meet the meaning we expect for here. Verbosity. To me, len would be adequate. Anyway, the real point was the declaration of printed_len could remove the " = 0" as it's now only set once. cheers, Joe