From owner-svn-src-all@freebsd.org Wed Dec 11 09:26:17 2019 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 79DE01D1D91; Wed, 11 Dec 2019 09:26:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Xs4T2j6fz3NNN; Wed, 11 Dec 2019 09:26:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3AAB816949; Wed, 11 Dec 2019 09:26:17 +0000 (UTC) Date: Wed, 11 Dec 2019 09:26:17 +0000 From: Alexey Dokuchaev To: Hans Petter Selasky Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20191211092617.GA10000@FreeBSD.org> References: <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 11 Dec 2019 09:26:17 -0000 On Tue, Dec 10, 2019 at 11:09:41PM +0100, Hans Petter Selasky wrote: > On 2019-12-10 22:58, John Baldwin wrote: > > While here, add to the manpage. > > FYI: > > Linux guys eliminated the "void *c_arg" in their timer implementation by > using container_of() to get callback argument. We could possibly do the > same! #define container_of(ptr, type, member) ({ \ void *__mptr = (void *)(ptr); \ BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ !__same_type(*(ptr), void), \ "pointer type mismatch in container_of()"); \ ((type *)(__mptr - offsetof(type, member))); }) That's one of those things that make Linux so unpleasant to work with. Frankly, I don't think we want that for FreeBSD. ./danfe