Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2927708pxa; Tue, 18 Aug 2020 01:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGtCW5LCKQnArAMl1JdW3ujfGfs15+05ldb6ImOltFSe7HYytbBHb+WnGH0hgQHSwmShzk X-Received: by 2002:a05:6402:1a46:: with SMTP id bf6mr18401410edb.284.1597739775565; Tue, 18 Aug 2020 01:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597739775; cv=none; d=google.com; s=arc-20160816; b=tNWCaBwt+QGsTlqOXA3wRwPmfp3MUllTWLZr0x2cn4aDz4xx7DZ+myhYrCynNvJAbV EzxvLFKjoq0A93dF8yHmqXIGYRRMIQ9w2uyoHAgXEZ0yQfnf9q9NFYHHdUPqViRO2Aji fS0u7Ps/iT3BLQoqkJdVp2217RP4xK21QXElChRe9Y9Nqox+iXRqTy6uXolqunLdJEtG za/a90PiYFaQtLRnH0mzhW33Hr6fx7f0OTZrnRKEAw7uQlStqCJiKaW+6tO+UZ3KTSgP hy8XhzcsK8drS6ogemW/Lq8kRjq6OOAKqnIDBNkPEdRs4hVmt1GolhF8EwQtNQ6L/1U1 HPIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=cUjZiK5F2zDGuQf3C8IhgO3CI6NIciNgxqwShQBflsc=; b=gHy8k6vsO6S51aahPitb4EmWkmUKNW2/5he85qvj7sssFXV9VFKk5O/dV9DGhQG7Bz 36xjjNlPiZHQTS0V0V07WXMuOvoWrLevGGws5ZZbTAXCKi1DrL4Vce7w1b/cdVXwutBA DSIGb/Tbn3IBKMXOF+Fmc99ZDEglguhwc3uCYdUCKSqhtRMKC0/JwoeFCfIp9wRCSd7Y xwJq8/smjWn47yv6EN4OoUNOtUmJ0gzzcmi9g513T9S7hENS1NwvRKE/3gjz9I75yO41 UVMqBXrqYeyvQ30jX9po4KC6aR2lUOBhVI8q8pija7MjYuZjn3Fir2xlor02akYmzDeK NP6A== 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 d17si12501128edp.462.2020.08.18.01.35.51; Tue, 18 Aug 2020 01:36:15 -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 S1726638AbgHRIcW (ORCPT + 99 others); Tue, 18 Aug 2020 04:32:22 -0400 Received: from smtprelay0109.hostedemail.com ([216.40.44.109]:35686 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726043AbgHRIcT (ORCPT ); Tue, 18 Aug 2020 04:32:19 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 92E4E18029129; Tue, 18 Aug 2020 08:32:17 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1538:1568:1593:1594:1711:1714:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3622:3866:3867:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6742:7576:7903:8985:9025:10004:10400:10848:11232:11658:11914:12043:12048:12296:12297:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21627:21788:21939:30054:30090: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:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: brick48_020b1d72701d X-Filterd-Recvd-Size: 2975 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Tue, 18 Aug 2020 08:32:14 +0000 (UTC) Message-ID: <3ae89ad82dca2cf0adeba9d7d07f3c76ce577c39.camel@perches.com> Subject: Re: [PATCH v2] lib/string.c: implement stpcpy From: Joe Perches To: David Laight , 'Nick Desaulniers' , Sami Tolvanen , Arvind Sankar , Kees Cook Cc: Sedat Dilek , Fangrui Song , Andrew Morton , =?ISO-8859-1?Q?D=E1vid_Bolvansk=FD?= , Eli Friedman , "# 3.4.x" , Vishal Verma , Dan Williams , Andy Shevchenko , "Joel Fernandes (Google)" , Daniel Axtens , Ingo Molnar , Yury Norov , Alexandru Ardelean , LKML , clang-built-linux , Rasmus Villemoes , Nathan Chancellor Date: Tue, 18 Aug 2020 01:32:12 -0700 In-Reply-To: <77557c29286140dea726cc334b4f59fc@AcuMS.aculab.com> References: <20200815014006.GB99152@rani.riverdale.lan> <20200815020946.1538085-1-ndesaulniers@google.com> <202008150921.B70721A359@keescook> <457a91183581509abfa00575d0392be543acbe07.camel@perches.com> <20200816001917.4krsnrik7hxxfqfm@google.com> <20200816150217.GA1306483@rani.riverdale.lan> <77557c29286140dea726cc334b4f59fc@AcuMS.aculab.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-08-18 at 08:24 +0000, David Laight wrote: > From: Nick Desaulniers > > Sent: 17 August 2020 19:37 > .. > > That said, this libcall optimization/transformation (sprintf->stpcpy) > > does look useful to me. > > I'd rather get a cow if I ask for a cow... > > Maybe checkpatch (etc) could report places where snprintf() > could be replaced by a simpler function. You mean sprintf no? Reminds me of seq_printf vs seq_puts... https://lkml.org/lkml/2013/3/16/79