From owner-svn-src-head@freebsd.org Thu Feb 6 16:43:31 2020 Return-Path: Delivered-To: svn-src-head@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 2B73523024D; Thu, 6 Feb 2020 16:43:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D44g0NKyz4FPH; Thu, 6 Feb 2020 16:43:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0A59D260338; Thu, 6 Feb 2020 17:43:27 +0100 (CET) Subject: Re: svn commit: r357614 - in head/sys: kern sys To: Pawel Biernacki , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202002061245.016CjwTi096374@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 6 Feb 2020 17:41:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202002061245.016CjwTi096374@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48D44g0NKyz4FPH X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:43:31 -0000 On 2020-02-06 13:45, Pawel Biernacki wrote: > +#ifdef notyet > +#define SYSCTL_ENFORCE_FLAGS(x) \ > + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), \ > + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") > +#else > +#define SYSCTL_ENFORCE_FLAGS(x) > +#endif Like cem@ pointed out, either you expand the XOR via OR or you can also do it like this: (((x) & CTLFLAG_MPSAFE) != 0) ^ (((x) & CTLFLAG_NEEDGIANT) != 0) which avoids having to define another macro. --HPS