From nobody Tue Jan 31 23:39:30 2023 X-Original-To: dev-commits-src-main@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 4P61jh01Z0z3cssY; Tue, 31 Jan 2023 23:39:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P61jg6V5Wz4301; Tue, 31 Jan 2023 23:39:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675208375; 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: in-reply-to:in-reply-to:references:references; bh=CirGHPCkSqZmimBn3kWCtQjkujzTDWlCM5PunMbbAo0=; b=S7wcEIuvCaBChcbeksDG9KewJP68ZpEB0yBe9ccrTSxiQe3ifxghrd4JuMVmUQgqrRBJFX gU+ZV6xQjVP5J60o+M3vt8zfHXwR0mhJ9sZXHqW3o+gkZrCVpN3yC4x7Q2K25idcsZjsF3 l6XP3r1KhPczoDGpy/5QcqAEL4jSZWWeBJxi7W0EYJbyiohP702g7mIB4dhOsrbBHYQ1zb D55EUbn01XmYX0ZoWDr3qPqy3OlSJfEDcG4CPxTEHO7CO50erNcgOkFFwXq71lRbm6NOuR zn1+NO/u3qGf9/MO+SEXEc0YS0dz+qAhhJJdFXLVy7NLv8o3R9GT7i346ljF0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675208375; 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: in-reply-to:in-reply-to:references:references; bh=CirGHPCkSqZmimBn3kWCtQjkujzTDWlCM5PunMbbAo0=; b=xtLtvnSmfEx8yeDmm0MHpDEUOm+8xWQgPSDTMAqTBxLgRyvjLRYayj8/mzTp3uYygJtWlB pkZORTaUKbH/owzdoJfQX+MzGuySjomECGrt7aOPOAaWapBg0ahg9PNIHqXUBY6CNRYkVj TBxtzqOwb4ao7iTQI+zgPNkPkib+Oq7jiJQ+AdH1kvWBBdTog8Du/xhtGu4D9HgArDPfQ8 SDPaC9zWDAH+cSWxRL32dSVdVpJgOAN7PK5+ArWI6nWtEBFS55YDXipdXEkP6o2hnLFwRs ZTWyN49RqcYnf+8Ju6+ec33klocovtZKTpECajArKCC9vTsYHSnUtEoNBvRyiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675208375; a=rsa-sha256; cv=none; b=ZGl2aWil7pKck7tCxZCLpcS/LxMaWEv2fU1+AcsWmZPKfqCIHqCWoWUc4q1P4NPYtkLCcV 1DSS6CNy4QjFW0OF/qJJKVFV1wX0IUg6GSDbpw2UpDNuKjp31RR1E/7tSwfjl3l1CNPpQR BZuFbHVhF3X9Joap2pgZG92KHnpces1slWZbXFe0VTzvGCl/usQBw8dgdPp35oF1x6neBO NnRKFfDbWvoYfVKOMis9AOHp18QfB5zq7y2UGFCUMxh0k51u+2nRlY1QlQts1eqpplKIrG 2VcTKp5bAy1bPw2kd6+56Uc+DCry9MAetzr5RqtfludivL919bY80DT0MN3+qQ== Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4P61jg499NzmdL; Tue, 31 Jan 2023 23:39:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2ADAC8D4A15D; Tue, 31 Jan 2023 23:39:34 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5E6E05C3A833; Tue, 31 Jan 2023 23:39:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id B_nZrfQtirvn; Tue, 31 Jan 2023 23:39:31 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 306745C3A830; Tue, 31 Jan 2023 23:39:31 +0000 (UTC) Date: Tue, 31 Jan 2023 23:39:30 +0000 (UTC) From: "Bjoern A. Zeeb" To: =?UTF-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a83b3ec719eb - main - linuxkpi: list_sort()'s callback now takes list arguments In-Reply-To: Message-ID: References: <202301312244.30VMiiuF052081@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1098556516-623335687-1675208371=:27118" X-ThisMailContainsUnwantedMimeParts: N This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1098556516-623335687-1675208371=:27118 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 31 Jan 2023, Bjoern A. Zeeb wrote: > On Tue, 31 Jan 2023, Jean-Sébastien Pédron wrote: > >> The branch main has been updated by dumbbell (ports committer): >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=a83b3ec719eb6c53658656b7b90607564d3c64d3 >> >> commit a83b3ec719eb6c53658656b7b90607564d3c64d3 >> Author: Jean-Sébastien Pédron >> AuthorDate: 2023-01-11 22:22:07 +0000 >> Commit: Jean-Sébastien Pédron >> CommitDate: 2023-01-31 22:36:33 +0000 >> >> linuxkpi: list_sort()'s callback now takes list arguments > > Does that description miss a ... takes "const" list ... ? > >> This change breaks the API of `list_sort()`. `LINUXKPI_VERSION >= 51300` >> is used to keep the header compatible with both versions of the >> prototype. > > Given our internals half way through already dal with "const" I see > little harm in making it const unconditionally. The actual > LINUXKPI_VERSION check probably should be around the DECONST lines in > linux_le_cmp() and in list_sort_thunk ; if we really wanted to not > lose the "const" half way through for newer versions which are prepared > for it. > > Non-const arguments passed in to list_sort() will still work and we can > avoid having an extern with const but an implementation without (not > sure why that's not giving warnings anyway). > > Or am I misreading the change? Never mind, I did. Too late. We could still fully pass the const through but that'll indeed need more #ifdef to the implementation. /bz > >> Reviewed by: manu >> Approved by: manu >> Differential Revision: https://reviews.freebsd.org/D38082 >> --- >> sys/compat/linuxkpi/common/include/linux/list.h | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/sys/compat/linuxkpi/common/include/linux/list.h >> b/sys/compat/linuxkpi/common/include/linux/list.h >> index 80ac57fecf6d..6ec715291807 100644 >> --- a/sys/compat/linuxkpi/common/include/linux/list.h >> +++ b/sys/compat/linuxkpi/common/include/linux/list.h >> @@ -504,7 +504,12 @@ static inline int list_is_last(const struct list_head >> *list, >> (pos) && ({ n = (pos)->member.next; 1; }); \ >> pos = hlist_entry_safe(n, typeof(*(pos)), member)) >> >> +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51300 >> +extern void list_sort(void *priv, struct list_head *head, int (*cmp)(void >> *priv, >> + const struct list_head *a, const struct list_head *b)); >> +#else >> extern void list_sort(void *priv, struct list_head *head, int (*cmp)(void >> *priv, >> struct list_head *a, struct list_head *b)); >> +#endif >> >> #endif /* _LINUXKPI_LINUX_LIST_H_ */ >> > > -- Bjoern A. Zeeb r15:7 --1098556516-623335687-1675208371=:27118--