From nobody Thu Feb 16 07:15:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHR6P1lsYz3pGbK; Thu, 16 Feb 2023 07:15:09 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHR6N2tQzz3DhC; Thu, 16 Feb 2023 07:15:08 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1676531705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lBeg3bRGOBPQJ33XTpCK/pt/ZEZZQQFl+ecnpBjs+tc=; b=WdMK31hkcvoBdlfrwaY45qxXJOEP3Kx1FiSnwIL7j/KUd3e4aXWZ9X+lqqjnsHgIm76mud evBXv7uu+yrM5iIU7+y9RNwJEzJRVJ5Iv2dExAKS/ZsmhXfiLla8lbJLaW0x7gUEJw6W1W KAew7LWZ6TjCQMJWKcFMDgp7/6Jee0o= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 3cc80d8a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 16 Feb 2023 07:15:05 +0000 (UTC) Date: Thu, 16 Feb 2023 08:15:01 +0100 From: Emmanuel Vadot To: Jessica Clarke Cc: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: b1a9e570fe2d - main - linuxkpi: Add `strscpy_pad()` to Message-Id: <20230216081501.506e86584558eeb315a9314f@bidouilliste.com> In-Reply-To: References: <202302152226.31FMQQV8093715@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PHR6N2tQzz3DhC X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, 15 Feb 2023 22:27:31 +0000 Jessica Clarke wrote: > On 15 Feb 2023, at 22:26, Jean-S=E9bastien P=E9dron wrote: > >=20 > > The branch main has been updated by dumbbell (ports committer): > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db1a9e570fe2da0a43c41327d= 7ce21b27bf8257b8 > >=20 > > commit b1a9e570fe2da0a43c41327d7ce21b27bf8257b8 > > Author: Jean-S=E9bastien P=E9dron > > AuthorDate: 2023-02-14 23:46:13 +0000 > > Commit: Jean-S=E9bastien P=E9dron > > CommitDate: 2023-02-15 22:19:41 +0000 > >=20 > > linuxkpi: Add `strscpy_pad()` to > >=20 > > It's the same as `strscpy()` except that it fills the rest of the > > destination buffer with zeroes if the source buffer is shorter. > >=20 > > Reviewed by: manu > > Approved by: manu > > --- > > sys/compat/linuxkpi/common/include/linux/string.h | 9 +++++++++ > > 1 file changed, 9 insertions(+) > >=20 > > diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/co= mpat/linuxkpi/common/include/linux/string.h > > index 65422cac629c..20c3729aaf12 100644 > > --- a/sys/compat/linuxkpi/common/include/linux/string.h > > +++ b/sys/compat/linuxkpi/common/include/linux/string.h > > @@ -207,6 +207,15 @@ strscpy(char* dst, const char* src, size_t len) > > return (-E2BIG); > > } > >=20 > > +static inline ssize_t > > +strscpy_pad(char* dst, const char* src, size_t len) > > +{ > > + >=20 > style(9) doesn?t need this blank line any more, please stop including > them in your commits. >=20 > Jess style(9) says that it's optional and we have them in a lot of files (including in some of the functions in this file). If you really hate them you should see how to update style(9) to say that we should never include a blank line. Making something optional is perfect to ensure that you will have both ways of doing thing in the code. > > + bzero(dst, len); > > + > > + return (strscpy(dst, src, len)); > > +} > > + > > static inline void * > > memset32(uint32_t *b, uint32_t c, size_t len) > > { >=20 --=20 Emmanuel Vadot