From nobody Sat Apr 29 07:36:49 2023 X-Original-To: dev-commits-src-branches@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 4Q7hBB2xQTz48cpH; Sat, 29 Apr 2023 07:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q7hBB118dz3GTs; Sat, 29 Apr 2023 07:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682753810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0WhyIIQR3eT61GRj6kwqFFAlzx4BXdJP1yZbZMTZlgw=; b=RoouyIbsraIToDE/hbCphDI+nX0etUcme/4VonSjHmnRS3rfYLg3mKFzoQ8/LCPnJPG/RU 6dfazZBZOLIlf6l5utr/mv9vYsETZHAvOSKV2mk5Nf3jTIIc/EUF9N0Wf6lMyrNNy8DU7m B64wCAYeOQBUpPYaZ7Z1VRL3bkjQ/M79oAANxaeShs/ySyZJKShXubV717+bcTBJD7qsQV mn6BHbIvy/Pm9Pg9sdHrH6A3b99qTl2a+gXF6/sW2nKiDUcatqr2zwONaIZ20Lt8ubrynx U6sVBR/b8E+kpPqNSHYTSH4BUGwHdA2lDzSVwy0TuPZCD6eW6LL5HinwHtbv9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682753810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0WhyIIQR3eT61GRj6kwqFFAlzx4BXdJP1yZbZMTZlgw=; b=i7MISFTEPSBLRDKlDloUXPG5Cwku4TVAcqwKRzynUmw6WaUsbWGJ99io6ZYirDEohXrBQf t5xJHMK9g4K58m4+Dh0L1iMshlF91WmRRUlnjrs2BytzRXGYfL3qtIvOsYVGTJacLMOEeA Nh0JYliHDZjWxXgRlE6drOnKyScqxfJpah3H4iYBv9HzRBknv3MCnHNHufJ2oprkg76fim xizGrR42Y4ARlSsnIi2wCDg4RY0mLOzMkuJIZYIjNd3oRaotxuTeHaML7Ozx+IBWw3l94k bVepflDWBgYmXOzCnHDyp1ze1TJzSOnzo2m9Phr1iicVDWXa1s8QOoEDuoZXzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682753810; a=rsa-sha256; cv=none; b=UKPer7e+x7DoMzx+TSTTWYtK3scPwGS8bWjlqt7D8hXTKRii3EGPAyHAzgTTuMA8o4JMd6 FJlP/CBcb+k/341MitAm9qpRvU8qjMicZT+VwLVgfGoDD/aStS6W81AMH2qMkWXEAAdE1D r4la+Q0u5hYf4xS3FwDT+/XxpyUaBSYmWsrkbqdXbDUVV6smy0xxpm5MPwk8yKvNBrtHjr 8d15EcgVvL2eiw7YpEDYZWS5QD5HPXMEQ5aDEpl1/ZtB/4HGA/6rovPvJtadk4m3SGOPpS RMuhTDuhdd+GnAcPw0ObjJ1V1uFN05Ug95LdynhHcjj1nSPJkwAaXJU7E6/gCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q7hB96wbDzYP3; Sat, 29 Apr 2023 07:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33T7anfY064193; Sat, 29 Apr 2023 07:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33T7anWQ064192; Sat, 29 Apr 2023 07:36:49 GMT (envelope-from git) Date: Sat, 29 Apr 2023 07:36:49 GMT Message-Id: <202304290736.33T7anWQ064192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1150a69dbdf1 - stable/13 - Use bool for one-bit wide bit-fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1150a69dbdf1d92fb28f7b775cf55aa75d2272f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1150a69dbdf1d92fb28f7b775cf55aa75d2272f7 commit 1150a69dbdf1d92fb28f7b775cf55aa75d2272f7 Author: Dimitry Andric AuthorDate: 2023-04-25 17:18:58 +0000 Commit: Dimitry Andric CommitDate: 2023-04-29 07:23:25 +0000 Use bool for one-bit wide bit-fields A signed one-bit wide bit-field can take only the values 0 and -1. Clang 16 introduced a warning that "implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1". Fix the warnings by using C99 bool. Reported by: Clang 16 Reviewed by: emaste, jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D39705 (cherry picked from commit bab8274c090942cf96c44bc001307b9bffac9d7e) --- sys/dev/acpica/acpi_pci_link.c | 28 ++++++++++++++-------------- sys/dev/acpica/acpi_pxm.c | 4 ++-- sys/dev/otus/if_otusreg.h | 2 +- sys/dev/puc/puc.c | 2 +- sys/dev/puc/puc_bfe.h | 8 ++++---- sys/dev/quicc/quicc_bfe.h | 4 ++-- sys/dev/scc/scc_bfe.h | 20 ++++++++++---------- sys/dev/uart/uart_bus.h | 20 ++++++++++---------- sys/dev/wpi/if_wpivar.h | 2 +- sys/x86/include/x86_smp.h | 8 ++++---- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index 441b52ea1cb0..86b80f62c391 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -104,8 +104,8 @@ struct link { int l_num_irqs; int *l_irqs; int l_references; - int l_routed:1; - int l_isa_irq:1; + bool l_routed:1; + bool l_isa_irq:1; ACPI_RESOURCE l_prs_template; }; @@ -355,18 +355,18 @@ link_add_prs(ACPI_RESOURCE *res, void *context) * valid IRQs are ISA IRQs, then mark this link as * routed via an ISA interrupt. */ - link->l_isa_irq = TRUE; + link->l_isa_irq = true; link->l_irqs = malloc(sizeof(int) * link->l_num_irqs, M_PCI_LINK, M_WAITOK | M_ZERO); for (i = 0; i < link->l_num_irqs; i++) { if (is_ext_irq) { link->l_irqs[i] = ext_irqs[i]; if (ext_irqs[i] >= NUM_ISA_INTERRUPTS) - link->l_isa_irq = FALSE; + link->l_isa_irq = false; } else { link->l_irqs[i] = irqs[i]; if (irqs[i] >= NUM_ISA_INTERRUPTS) - link->l_isa_irq = FALSE; + link->l_isa_irq = false; } } @@ -376,7 +376,7 @@ link_add_prs(ACPI_RESOURCE *res, void *context) */ if (!req->sc->pl_crs_bad && !link->l_isa_irq && link->l_crs_type == ACPI_RESOURCE_TYPE_IRQ) - req->sc->pl_crs_bad = TRUE; + req->sc->pl_crs_bad = true; break; default: if (req->in_dpf == DPF_IGNORE) @@ -390,7 +390,7 @@ link_add_prs(ACPI_RESOURCE *res, void *context) return (AE_OK); } -static int +static bool link_valid_irq(struct link *link, int irq) { int i; @@ -399,12 +399,12 @@ link_valid_irq(struct link *link, int irq) /* Invalid interrupts are never valid. */ if (!PCI_INTERRUPT_VALID(irq)) - return (FALSE); + return (false); /* Any interrupt in the list of possible interrupts is valid. */ for (i = 0; i < link->l_num_irqs; i++) if (link->l_irqs[i] == irq) - return (TRUE); + return (true); /* * For links routed via an ISA interrupt, if the SCI is routed via @@ -412,10 +412,10 @@ link_valid_irq(struct link *link, int irq) */ if (link->l_isa_irq && AcpiGbl_FADT.SciInterrupt == irq && irq < NUM_ISA_INTERRUPTS) - return (TRUE); + return (true); /* If the interrupt wasn't found in the list it is not valid. */ - return (FALSE); + return (false); } static void @@ -493,7 +493,7 @@ acpi_pci_link_attach(device_t dev) sc->pl_links[i].l_irq = PCI_INVALID_IRQ; sc->pl_links[i].l_bios_irq = PCI_INVALID_IRQ; sc->pl_links[i].l_sc = sc; - sc->pl_links[i].l_isa_irq = FALSE; + sc->pl_links[i].l_isa_irq = false; sc->pl_links[i].l_res_index = -1; } @@ -558,7 +558,7 @@ acpi_pci_link_attach(device_t dev) else for (i = 0; i < sc->pl_num_links; i++) if (PCI_INTERRUPT_VALID(sc->pl_links[i].l_irq)) - sc->pl_links[i].l_routed = TRUE; + sc->pl_links[i].l_routed = true; if (bootverbose) acpi_pci_link_dump(sc, 0, "After Disable"); ACPI_SERIAL_END(pci_link); @@ -904,7 +904,7 @@ acpi_pci_link_route_irqs(device_t dev) */ if (!link->l_routed && PCI_INTERRUPT_VALID(link->l_irq)) { - link->l_routed = TRUE; + link->l_routed = true; acpi_config_intr(dev, resource); pci_link_interrupt_weights[link->l_irq] += link->l_references; diff --git a/sys/dev/acpica/acpi_pxm.c b/sys/dev/acpica/acpi_pxm.c index 808886d744f0..18a21ee6b0f8 100644 --- a/sys/dev/acpica/acpi_pxm.c +++ b/sys/dev/acpica/acpi_pxm.c @@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$"); #if MAXMEMDOM > 1 static struct cpu_info { - int enabled:1; - int has_memory:1; + bool enabled:1; + bool has_memory:1; int domain; int id; } *cpus; diff --git a/sys/dev/otus/if_otusreg.h b/sys/dev/otus/if_otusreg.h index 190bf19eb2ae..4bccc85b2168 100644 --- a/sys/dev/otus/if_otusreg.h +++ b/sys/dev/otus/if_otusreg.h @@ -1020,7 +1020,7 @@ struct otus_softc { uint8_t capflags; uint8_t rxmask; uint8_t txmask; - int sc_running:1, + bool sc_running:1, sc_calibrating:1, sc_scanning:1; diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index dd6e9b688705..2ecaaad4e05c 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -60,7 +60,7 @@ struct puc_port { int p_type; int p_rclk; - int p_hasintr:1; + bool p_hasintr:1; serdev_intr_t *p_ihsrc[PUC_ISRCCNT]; void *p_iharg; diff --git a/sys/dev/puc/puc_bfe.h b/sys/dev/puc/puc_bfe.h index 68678d3771e1..692a7f009019 100644 --- a/sys/dev/puc/puc_bfe.h +++ b/sys/dev/puc/puc_bfe.h @@ -65,10 +65,10 @@ struct puc_softc { int sc_nports; struct puc_port *sc_port; - int sc_fastintr:1; - int sc_leaving:1; - int sc_polled:1; - int sc_msi:1; + bool sc_fastintr:1; + bool sc_leaving:1; + bool sc_polled:1; + bool sc_msi:1; int sc_ilr; diff --git a/sys/dev/quicc/quicc_bfe.h b/sys/dev/quicc/quicc_bfe.h index ea791bc277e3..994d9f62ca10 100644 --- a/sys/dev/quicc/quicc_bfe.h +++ b/sys/dev/quicc/quicc_bfe.h @@ -51,8 +51,8 @@ struct quicc_softc { u_int sc_clock; - int sc_fastintr:1; - int sc_polled:1; + bool sc_fastintr:1; + bool sc_polled:1; }; extern devclass_t quicc_devclass; diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h index 1ccd176e5539..303bdfd6d75d 100644 --- a/sys/dev/scc/scc_bfe.h +++ b/sys/dev/scc/scc_bfe.h @@ -72,11 +72,11 @@ struct scc_mode { device_t m_dev; u_int m_mode; - int m_attached:1; - int m_fastintr:1; - int m_hasintr:1; - int m_probed:1; - int m_sysdev:1; + bool m_attached:1; + bool m_fastintr:1; + bool m_hasintr:1; + bool m_probed:1; + bool m_sysdev:1; driver_filter_t *ih; serdev_intr_t *ih_src[SCC_ISRCCNT]; @@ -94,8 +94,8 @@ struct scc_chan { struct scc_mode ch_mode[SCC_NMODES]; u_int ch_nr; - int ch_enabled:1; - int ch_sysdev:1; + bool ch_enabled:1; + bool ch_sysdev:1; uint32_t ch_ipend; uint32_t ch_hwsig; @@ -130,9 +130,9 @@ struct scc_softc { struct scc_chan *sc_chan; - int sc_fastintr:1; - int sc_leaving:1; - int sc_polled:1; + bool sc_fastintr:1; + bool sc_leaving:1; + bool sc_polled:1; uint32_t sc_hwsig; /* Signal state. Used by HW driver. */ }; diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h index 5da3cecccf85..2c1918c580e9 100644 --- a/sys/dev/uart/uart_bus.h +++ b/sys/dev/uart/uart_bus.h @@ -89,16 +89,16 @@ struct uart_softc { int sc_irid; struct callout sc_timer; - int sc_callout:1; /* This UART is opened for callout. */ - int sc_fastintr:1; /* This UART uses fast interrupts. */ - int sc_hwiflow:1; /* This UART has HW input flow ctl. */ - int sc_hwoflow:1; /* This UART has HW output flow ctl. */ - int sc_leaving:1; /* This UART is going away. */ - int sc_opened:1; /* This UART is open for business. */ - int sc_polled:1; /* This UART has no interrupts. */ - int sc_txbusy:1; /* This UART is transmitting. */ - int sc_isquelch:1; /* This UART has input squelched. */ - int sc_testintr:1; /* This UART is under int. testing. */ + bool sc_callout:1; /* This UART is opened for callout. */ + bool sc_fastintr:1; /* This UART uses fast interrupts. */ + bool sc_hwiflow:1; /* This UART has HW input flow ctl. */ + bool sc_hwoflow:1; /* This UART has HW output flow ctl. */ + bool sc_leaving:1; /* This UART is going away. */ + bool sc_opened:1; /* This UART is open for business. */ + bool sc_polled:1; /* This UART has no interrupts. */ + bool sc_txbusy:1; /* This UART is transmitting. */ + bool sc_isquelch:1; /* This UART has input squelched. */ + bool sc_testintr:1; /* This UART is under int. testing. */ struct uart_devinfo *sc_sysdev; /* System device (or NULL). */ diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h index 422dc34d65b8..81fdeced248a 100644 --- a/sys/dev/wpi/if_wpivar.h +++ b/sys/dev/wpi/if_wpivar.h @@ -77,7 +77,7 @@ struct wpi_tx_ring { uint8_t cur; uint8_t pending; int16_t queued; - int update:1; + bool update:1; }; struct wpi_rx_data { diff --git a/sys/x86/include/x86_smp.h b/sys/x86/include/x86_smp.h index 2cf0ff97eae0..9d8e1c4ebaec 100644 --- a/sys/x86/include/x86_smp.h +++ b/sys/x86/include/x86_smp.h @@ -56,10 +56,10 @@ extern int nmi_kdb_lock; extern int nmi_is_broadcast; struct cpu_info { - int cpu_present:1; - int cpu_bsp:1; - int cpu_disabled:1; - int cpu_hyperthread:1; + bool cpu_present:1; + bool cpu_bsp:1; + bool cpu_disabled:1; + bool cpu_hyperthread:1; }; extern struct cpu_info *cpu_info;