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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCB47C433F5 for ; Mon, 31 Jan 2022 10:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358159AbiAaK0T (ORCPT ); Mon, 31 Jan 2022 05:26:19 -0500 Received: from mga17.intel.com ([192.55.52.151]:38123 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358132AbiAaK0R (ORCPT ); Mon, 31 Jan 2022 05:26:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643624778; x=1675160778; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rnpGhLBeO/HdBBinrNjhSH3ZdFwzc3ZAIZeFErKuU6A=; b=SkcJ7eA6RZTlScMiOO024trJbZNNtkF46WMRtc2T2aFFxeynxquzaHMG GhnJnnYlvl14f/ZDy0DtaeKE0lvPuhPRWlXvxUSqS3asEStOYSn7IqF7I uIN57GTBjzXVJeEqWPILmoFwjpYuN02ISa1hUgjUepUy/0ztd1JyiEoD9 bJTa7VtP8nlsxJ9Fwby4r24R8edKGLqyUIn+3pcAE23OxEHfKTeOKq2jt 2pwzLcWHD7EmiwPWG2PO9LtV4L9MzLlFZCN6ZnU1Y9joQXMA6uh7iCKuz f25Ge8H6B1ZAycugVAwCfF/19f4sB1sI3VjMkcTYag0xSaIVe1HeAAhoZ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10243"; a="228097216" X-IronPort-AV: E=Sophos;i="5.88,330,1635231600"; d="scan'208";a="228097216" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2022 02:26:17 -0800 X-IronPort-AV: E=Sophos;i="5.88,330,1635231600"; d="scan'208";a="598799829" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2022 02:26:13 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nETrx-00GpLQ-JX; Mon, 31 Jan 2022 12:25:09 +0200 Date: Mon, 31 Jan 2022 12:25:09 +0200 From: Andy Shevchenko To: David Rientjes Cc: Waiman Long , Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Ira Weiny , Rafael Aquini Subject: Re: [PATCH v2 1/3] lib/vsprintf: Avoid redundant work with 0 size Message-ID: References: <20220129205315.478628-1-longman@redhat.com> <20220129205315.478628-2-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 30, 2022 at 12:49:37PM -0800, David Rientjes wrote: > On Sat, 29 Jan 2022, Waiman Long wrote: > > > For *scnprintf(), vsnprintf() is always called even if the input size is > > 0. That is a waste of time, so just return 0 in this case. Why do you think it's not legit? -- With Best Regards, Andy Shevchenko