From owner-svn-src-all@freebsd.org Tue Jun 2 11:38:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 472CE333100; Tue, 2 Jun 2020 11:38:25 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49bqmb3ZZQz4ZkF; Tue, 2 Jun 2020 11:38:22 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1591097900; 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=PE0SyJ1VvT6OyaJgrFR54B937j6vW2L39RueGrhjmYA=; b=M86ePsvyEBUbGjJskzTfyhS0SR5s5P8D0wloP8gUJdpI4VGOnOU5Tuk1JNgq/dufQzY+nt Axc/qqRvXtwQVIbaXGdQ37tNLa16H+kPLxmZLBuqxj1fgtMORoDnGkbDrR4O4FzZpCbC3q zIMDRJultbDHX37kKi45UBPeLfJlWp0= Received: from skull.home.blih.net (lfbn-idf2-1-900-181.w86-238.abo.wanadoo.fr [86.238.131.181]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 21d75498 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 2 Jun 2020 11:38:20 +0000 (UTC) Date: Tue, 2 Jun 2020 13:38:19 +0200 From: Emmanuel Vadot To: "Bjoern A. Zeeb" Cc: "Hans Petter Selasky" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361723 - head/sys/compat/linuxkpi/common/include/linux Message-Id: <20200602133819.ca4e9e508ba3334b77d24ee4@bidouilliste.com> In-Reply-To: References: <202006021019.052AJjxk060018@repo.freebsd.org> <20200602123612.fc6dbafe55c2c981cb0ec9a1@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49bqmb3ZZQz4ZkF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=M86ePsvy; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.04 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.04)[-1.039]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.46)[-0.463]; NEURAL_HAM_MEDIUM(-1.03)[-1.034]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2020 11:38:25 -0000 On Tue, 02 Jun 2020 11:31:58 +0000 "Bjoern A. Zeeb" wrote: > On 2 Jun 2020, at 10:36, Emmanuel Vadot wrote: >=20 > > Hello Hans, > > > > On Tue, 2 Jun 2020 10:19:45 +0000 (UTC) > > Hans Petter Selasky wrote: > > > >> Author: hselasky > >> Date: Tue Jun 2 10:19:45 2020 > >> New Revision: 361723 > >> URL: https://svnweb.freebsd.org/changeset/base/361723 > >> > >> Log: > >> Implement struct_size() function macro in the LinuxKPI. > >> > >> MFC after: 1 week > >> Sponsored by: Mellanox Technologies > >> > >> Modified: > >> head/sys/compat/linuxkpi/common/include/linux/kernel.h > >> > >> Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jun 2= =20 > >> 09:45:43 2020 (r361722) > >> +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jun 2= =20 > >> 10:19:45 2020 (r361723) > >> @@ -555,4 +555,10 @@ linux_ratelimited(linux_ratelimit_t *rl) > >> return (ppsratecheck(&rl->lasttime, &rl->counter, 1)); > >> } > >> > >> +#define struct_size(ptr, field, num) ({ \ > >> + const size_t __size =3D offsetof(__typeof(*(ptr)), field); \ > >> + const size_t __max =3D (SIZE_MAX - __size) / sizeof((ptr)->field[0])= ;=20 > >> \ > >> + ((num) > __max) ? SIZE_MAX : (__size + sizeof((ptr)->field[0]) *=20 > >> (num)); \ > >> +}) > >> + > >> #endif /* _LINUX_KERNEL_H_ */ > > > > Can you bump FreeBSD_version so I can fix > > https://github.com/freebsd/drm-kmod/ and update the > > graphics/drm-devel-kmod port please ? >=20 > I almost wonder if we want a ?linuxkkpi version? to check instead. > If there?s a lot more ?work? on the linuxkpi we might not want to=20 > bump __FreeBSD_version for every change which can conflict/affect=20 > external code? >=20 > /bz >=20 There is a LINUXKPI_VERSION but that's for Linux version compliance. It's not easy to add a linuxkpi_version like freebsd_version because you cannot check it in the port makefile. But that might help when mfc'ing linuxkpi stuff. FreeBSD_version is cheap enough to bump. --=20 Emmanuel Vadot