Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5536745pxb; Wed, 26 Jan 2022 14:26:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5/tSznNwb7PZW4BsBT+3dxL3arfBAnxR0JgU5rsHSmhcRD7wM/bk5afvWqSgU87JiODaJ X-Received: by 2002:a05:6402:1d56:: with SMTP id dz22mr1130772edb.82.1643235985756; Wed, 26 Jan 2022 14:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643235985; cv=none; d=google.com; s=arc-20160816; b=FQyRQdNAqyvm1imNlXVzqWwKo0dygAqDc5Qklm35NmbXFpgGANJdG72r3JzuDzCJv4 oAooXsqrpzfrwSI3LAF2jKx2lWQ63q3IYdMfDOm0a35iNMdrqwmavPhU3sLNZ+lrVKBa 1DKSCy21OtEi8V3klVnhGEHdUaHhcGd0hLKubziP2Hp6vM+oXCnU9LD8H2ciStJOm301 J3ZPCfJ5es47TDb7PqSnS1FnEcMvLAPmm8u9X+0OeUi2GPCuh3gGFgEzs0CHgLOK+ADw jEsgHXV14L8NAv8FCgTwM8gebedIs1K0T/xEhIFF1Rq0uJrbiICJEKxes+JNDFcBngNi 9Keg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HRNHpVyCbzi+yiw/a01MBWc9rmUu1pBxftuN0ANk488=; b=J89MgmGuBPVZCTG5aarMxJD17Gi+hPoTXT105bMvwFeIE3MNQT3dWcAp3olnCcI+Ij kWGolIpThExMsJcNVD7MsuN9vCKV0s1zBcOTyyN2KXWyG69tbc38qAl0cfPzPqyF7ImP P9V49kc/kQdGEPX+zciVUuyNgc/qxoZ8aQ+D8l/1gPDqPS14JoxYtAXHWO4zRAPpr/+1 D54DrSNNU1Q55dVjV9iUJkoeA11/wUWPN4mqIWY/JISV+p1GzaUV4f6pG9/t1L5cKIoG Abv6ZMIabRMgn52cfm/1fyzyM8XCWvG+2QwU1cvJ0OuVcmf2Oqzowyz9SG6vTA54ULn0 m2fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CbP8hA3M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si312969ejn.293.2022.01.26.14.25.58; Wed, 26 Jan 2022 14:26:25 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=CbP8hA3M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244097AbiAZSGH (ORCPT + 99 others); Wed, 26 Jan 2022 13:06:07 -0500 Received: from mga06.intel.com ([134.134.136.31]:52782 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbiAZSGH (ORCPT ); Wed, 26 Jan 2022 13:06:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643220367; x=1674756367; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=mOvdaqkpM7nB64Fyioa8p769KOkoDPOpvSTh4Zg379c=; b=CbP8hA3M4YBs5c9XmO7elBWhkV0tio2cxV8phHh8Kd5iMJGpkuQ4nsfb 3uPfOtUWDk5vG7UzKgy5zMG9j+DCb9H7UC9BJKwVW/UGnV4kdDvXQGhIc 6SGrn6B4eWtTKaG5+PvTAUbXjVy2rzD23mwbPGjHtIE4HdqVDfVAAQ7d5 ro5QQ8M9lJSwInrCZqAcaAMVCqdth3E0A8ZRY/IEGPDtDhyhDaQcb5c6i mTnX4YFjL/u9UFcWq48QVLe1I0+mWw7CPYsbBgxH2Aic76Xe8YP2g+UrY PLeZtLsZIsYbnLBKJDwt9N1abfO5ZE5HIKk90jgLC7jKIkBBOUeysmOKh w==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="307327008" X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="307327008" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 10:06:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="618040579" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 10:06:01 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nCmf8-00Ehb6-S3; Wed, 26 Jan 2022 20:04:54 +0200 Date: Wed, 26 Jan 2022 20:04:54 +0200 From: Andy Shevchenko To: Nathan Chancellor Cc: Kees Cook , Francis Laniel , Petr Mladek , linux-kernel@vger.kernel.org, Andy Shevchenko , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , kernel test robot , Nick Desaulniers , Nathan Chancellor Subject: Re: [PATCH v3 1/3] string: Make stpcpy() possible to use Message-ID: References: <20220126141917.75399-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 Wed, Jan 26, 2022 at 09:38:02AM -0700, Nathan Chancellor wrote: > On Wed, Jan 26, 2022 at 04:19:15PM +0200, Andy Shevchenko wrote: > > It is a good rule to avoid submitting code without users. > > While I agree with the sentiment in the general case, I don't think that > it applies in this case and this comment should be dropped. The message > of the commit this fixes and the comment right above the declaration > both make it pretty obvious why this interface was added with no in-tree > users and why the declaration was placed right above the definition. Thanks for accenting on this. Yes, I see now the reasoning and I don't know which way is better. As a consumer of this API it shows a room for micro-optimizations (I dunno if GCC and/or Clang able to replace the two by stpcpy(), as done in the patch, at compile time). That said, depending on the others' opinions let see how to proceed. > > Currently the stpcpy() is unusable due to missed declaration. > > Any attempts to use it will bring something like: > > > > error: implicit declaration of function ‘stpcpy’ [-Werror=implicit-function-declaration] > > > > Move declaration to the header and guard it as other string functions. > > > > Fixes: 1e1b6d63d634 ("lib/string.c: implement stpcpy") > > Reported-by: kernel test robot > > Cc: Nick Desaulniers > > Cc: Nathan Chancellor > > Signed-off-by: Andy Shevchenko > > Regardless, the commit itself seems fine from a technical standpoint. I > won't comment on whether or not this interface should be opened up. > > Reviewed-by: Nathan Chancellor Thanks! -- With Best Regards, Andy Shevchenko