From nobody Tue Nov 12 08:12:13 2024 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 4XnfKF01Qtz5bgMN; Tue, 12 Nov 2024 08:12:17 +0000 (UTC) (envelope-from SRS0=Rfen=SH=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XnfKD4yy1z4hvp; Tue, 12 Nov 2024 08:12:16 +0000 (UTC) (envelope-from SRS0=Rfen=SH=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Date: Tue, 12 Nov 2024 09:12:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1731399133; 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=kx3DNU+eeVoLKXI5wJzKv+g/FYf1ymXshm31iuvtRT0=; b=To0xRrJHUsxrQfozAKMNsgXuZM47rB4AFjJHGl4eM9ZiSCzYnPrSSsx0C6KSL0ghjUoOnF rOM03OBO0XdA01We84r/iEZg79YL1c7WmsQnS5AuZAYVfmIZ6cG2EJgNA7Z7Hcpt4DwLKA SBCV9j5AAzUtDEPSnPLnf4aU+lliDQYJ9WE/yC6Ygo5hzOQAvFyIMidNS8l/CHMX/80qOQ QMdsMMIomK38lQ1Sq0LqTJ9lKYQVoOgo/V3SkxrzxknAHF00xqk6A9xAlC4HTd5pprWCkX 48xJwUOy59Xrk/Qm7AVHrFPiKfQaR/4BjBmK8Fk7tNkaTAxZLsbAYo0sGPGKhQ== From: Ronald Klop To: Mark Johnston Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <705420107.1610.1731399133226@localhost> In-Reply-To: <202411120201.4AC21wNW023064@gitrepo.freebsd.org> References: <202411120201.4AC21wNW023064@gitrepo.freebsd.org> Subject: Re: git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1609_384912247.1731399133058" X-Mailer: Realworks (727.78) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] X-Rspamd-Queue-Id: 4XnfKD4yy1z4hvp X-Spamd-Bar: ---- ------=_Part_1609_384912247.1731399133058 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Out of curiosity, what is the "why" of this commit? Regards, Ronald. Van: Mark Johnston Datum: dinsdag, 12 november 2024 03:01 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations > > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=195402c5c5b7b3236c0680f06b60b7f9465982c8 > > commit 195402c5c5b7b3236c0680f06b60b7f9465982c8 > Author: Mark Johnston > AuthorDate: 2024-11-12 01:57:35 +0000 > Commit: Mark Johnston > CommitDate: 2024-11-12 01:57:35 +0000 > > busdma_bounce: Replace a SYSINIT with static initializations > > No functional change intended. > > MFC after: 1 week > --- > sys/kern/subr_busdma_bounce.c | 18 +++++------------- > 1 file changed, 5 insertions(+), 13 deletions(-) > > diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c > index a27bc423c23a..60fe2fc6b2a6 100644 > --- a/sys/kern/subr_busdma_bounce.c > +++ b/sys/kern/subr_busdma_bounce.c > @@ -86,11 +86,14 @@ struct bounce_zone { > }; > > static struct mtx bounce_lock; > +MTX_SYSINIT(bounce_lock, &bounce_lock, "bounce pages lock", MTX_DEF); > static int total_bpages; > static int busdma_zonecount; > > -static STAILQ_HEAD(, bounce_zone) bounce_zone_list; > -static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; > +static STAILQ_HEAD(, bounce_zone) bounce_zone_list = > + STAILQ_HEAD_INITIALIZER(bounce_zone_list); > +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist = > + STAILQ_HEAD_INITIALIZER(bounce_map_callbacklist); > > static MALLOC_DEFINE(M_BOUNCE, "bounce", "busdma bounce pages"); > > @@ -130,17 +133,6 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) > return (0); > } > > -static void > -init_bounce_pages(void *dummy __unused) > -{ > - > - total_bpages = 0; > - STAILQ_INIT(&bounce_zone_list); > - STAILQ_INIT(&bounce_map_callbacklist); > - mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF); > -} > -SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL); > - > static struct sysctl_ctx_list * > busdma_sysctl_tree(struct bounce_zone *bz) > { > > > > ------=_Part_1609_384912247.1731399133058 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Out of curiosity, what is the "why" of this commit?

Regards,
Ronald.

 

Van: Mark Johnston <markj@FreeBSD.org>
Datum: dinsdag, 12 november 2024 03:01
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations

The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=195402c5c5b7b3236c0680f06b60b7f9465982c8

commit 195402c5c5b7b3236c0680f06b60b7f9465982c8
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-12 01:57:35 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-12 01:57:35 +0000

    busdma_bounce: Replace a SYSINIT with static initializations
    
    No functional change intended.
    
    MFC after:      1 week
---
 sys/kern/subr_busdma_bounce.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c
index a27bc423c23a..60fe2fc6b2a6 100644
--- a/sys/kern/subr_busdma_bounce.c
+++ b/sys/kern/subr_busdma_bounce.c
@@ -86,11 +86,14 @@ struct bounce_zone {
 };
 
 static struct mtx bounce_lock;
+MTX_SYSINIT(bounce_lock, &bounce_lock, "bounce pages lock", MTX_DEF);
 static int total_bpages;
 static int busdma_zonecount;
 
-static STAILQ_HEAD(, bounce_zone) bounce_zone_list;
-static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist;
+static STAILQ_HEAD(, bounce_zone) bounce_zone_list =
+    STAILQ_HEAD_INITIALIZER(bounce_zone_list);
+static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist =
+    STAILQ_HEAD_INITIALIZER(bounce_map_callbacklist);
 
 static MALLOC_DEFINE(M_BOUNCE, "bounce", "busdma bounce pages");
 
@@ -130,17 +133,6 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags)
    return (0);
 }
 
-static void
-init_bounce_pages(void *dummy __unused)
-{
-
-   total_bpages = 0;
-   STAILQ_INIT(&bounce_zone_list);
-   STAILQ_INIT(&bounce_map_callbacklist);
-   mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF);
-}
-SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL);
-
 static struct sysctl_ctx_list *
 busdma_sysctl_tree(struct bounce_zone *bz)
 {
 


  ------=_Part_1609_384912247.1731399133058--