From nobody Mon Nov 09 18:36:58 2026 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 4jNdmV4kC7z70Gw0 for ; Mon, 09 Nov 2026 18:36:58 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jNdmV16CGz4HRG for ; Mon, 09 Nov 2026 18:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794249418; 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=2nzhxFpXXb5HHt9a0XTeXFqpQnovT9XlgMV1jjRVJ4Y=; b=WaMpOGM0SWoxkK4bIXxwjcrfbNJtx5OxY1NBz5dzzsKe9f7GKG8GO4827bgZ6lzbeDI7Ps PTdg89mc0+2fzBRF4xGSfloFYXLHnv6yRp7N+y4znybPUNT8ZzGIRwtxk2a9DPStQR5mQN RPS+QD3btFXPiM18dv3+d92Y8Y8xlznRH4OhRnHZLbVLgBmFM2/3UeDtMLmuPrLRkc+No9 vEHzfEVqGI8XmqjnoHjGt0fnDjRcTIQVp/EAvxyfPaO//qFG5TJk/tzqIO0UY8q7OXv2+6 a/GIPRk10QQYuaCtTStlHQuYZ2ytshWsJzrFZMo9hXe5jN+xPLMrx1DdaNgbCg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794249418; b=moDiUOzqPaSvqdgeUduB6MVRCItbuUysMsgE/83FO+eWtctLzs9cyP+hT4X+9LpE9BTjxN 7h/kAPq55oV35CVNDZFGP87zE4aSidowiSb3dblPLLx3EHX+RVOY50w3HIJgHcvRHblCc0 R2I7qlnN3iDSW7a2qErh1f0mY31XCYF415S29yWLp8/K9NqhEqYIeMLjuXY06XV8xMKHrF u1J7MO9xu40OzkLMHgj5RBi6ODGlTCYq7W/iZXjIWhph0xnNaR80NeQSXbQkQeJCBq4oD2 VKFmBs0DtQ5HbL7Vw0NFo1Jr3kIE0wIXOuwuUM2EOgkZieDPnZlvFlOyN3OhZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794249418; 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=2nzhxFpXXb5HHt9a0XTeXFqpQnovT9XlgMV1jjRVJ4Y=; b=Vn26blRzLE7C4Y/1WD9x/nYD1gNhmlxEAtxMMT8a16VeH1ZVYXtFq2dNRvQIp5gYqPtYv/ jNesjOAgVqili8h0XeMz0uAfmfXfC2fsjY2icq4G3BqlO4v1T53MdSJ1kS3TqzgfulX99q HkhkU5zwNI+Fpf6x3a8QKB5v93Oh3vSuNyFHq5tlBgaijTqRQA3xE1KrssQKEVxAGlzi9C GWt4ntnGXAuyG5cwqtc9rSFl+YMXrcO7lY9SWrgR9ZDo6OHWYKKMvm6HbuZVBodHstWa3k 9k1dRI42DsGr9xwQYYx1amiFHLosWxVeCPoaOXKpg8GSCYmV+od/xcKJFaggKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jNdmV0jyKzt48 for ; Mon, 09 Nov 2026 18:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b8d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 09 Nov 2026 18:36:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Abdelkader Boudih Subject: git: a3468ea7bd7a - main - asmc: Use c99 initializers with for-loop counters to improve scoping List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: seuros X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3468ea7bd7a0b33b51a1a94ac2e39c0c231bd20 Auto-Submitted: auto-generated Date: Mon, 09 Nov 2026 18:36:58 +0000 Message-Id: <6af212ca.b8d2.677ad914@gitrepo.freebsd.org> The branch main has been updated by seuros: URL: https://cgit.FreeBSD.org/src/commit/?id=a3468ea7bd7a0b33b51a1a94ac2e39c0c231bd20 commit a3468ea7bd7a0b33b51a1a94ac2e39c0c231bd20 Author: Abdelkader Boudih AuthorDate: 2026-11-09 18:35:40 +0000 Commit: Abdelkader Boudih CommitDate: 2026-11-09 18:35:40 +0000 asmc: Use c99 initializers with for-loop counters to improve scoping declared loop indices in the for statement Index types are unchanged. No functional change. MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie, imp Differential Revision: https://reviews.freebsd.org/D61301 --- sys/dev/asmc/asmc.c | 11 +++-------- sys/dev/asmc/asmc_debug.c | 3 +-- sys/dev/asmc/asmc_pio.c | 10 ++++------ sys/dev/asmc/asmc_sysctl.c | 8 ++------ sys/dev/asmc/asmcmmio.c | 3 +-- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 9db81e32b06d..b91a0315e65c 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -478,7 +478,6 @@ asmc_sms_init(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); uint8_t buf[2]; - int i; /* * We are ready to receive interrupts from the SMS. @@ -528,7 +527,7 @@ asmc_sms_init(device_t dev) * Retry SMS initialization 1000 times * (takes approx. 2 seconds in worst case) */ - for (i = 0; i < 1000; i++) { + for (int i = 0; i < 1000; i++) { if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 && (buf[0] == ASMC_SMS_INIT1 && buf[1] == ASMC_SMS_INIT2)) { sc->sc_sms_intr_works = 1; @@ -638,9 +637,7 @@ static const struct { static bool asmc_sensor_convert(const char *type, const uint8_t *buf, int *millivalue) { - int i; - - for (i = 0; asmc_sensor_types[i].divisor != 0; i++) { + for (int i = 0; asmc_sensor_types[i].divisor != 0; i++) { if (strncmp(type, asmc_sensor_types[i].type, 4) != 0) continue; if (asmc_sensor_types[i].divisor == 1) @@ -656,9 +653,7 @@ asmc_sensor_convert(const char *type, const uint8_t *buf, int *millivalue) static bool asmc_sensor_type_supported(const char *type) { - int i; - - for (i = 0; asmc_sensor_types[i].divisor != 0; i++) + for (int i = 0; asmc_sensor_types[i].divisor != 0; i++) if (strncmp(type, asmc_sensor_types[i].type, 4) == 0) return (true); return (false); diff --git a/sys/dev/asmc/asmc_debug.c b/sys/dev/asmc/asmc_debug.c index e0d2ef28b972..2826ed5cbfca 100644 --- a/sys/dev/asmc/asmc_debug.c +++ b/sys/dev/asmc/asmc_debug.c @@ -65,7 +65,6 @@ void asmc_dumpall(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); - int i; if (sc->sc_nkeys == 0) { device_printf(dev, "asmc_dumpall: key count not available\n"); @@ -73,7 +72,7 @@ asmc_dumpall(device_t dev) } device_printf(dev, "asmc_dumpall: dumping %d keys\n", sc->sc_nkeys); - for (i = 0; i < sc->sc_nkeys; i++) + for (int i = 0; i < sc->sc_nkeys; i++) asmc_key_dump(dev, i); } diff --git a/sys/dev/asmc/asmc_pio.c b/sys/dev/asmc/asmc_pio.c index 75ff8dbd3522..12847d4979ba 100644 --- a/sys/dev/asmc/asmc_pio.c +++ b/sys/dev/asmc/asmc_pio.c @@ -39,11 +39,10 @@ static int asmc_wait_ack(device_t dev, uint8_t val, int amount) { struct asmc_softc *sc = device_get_softc(dev); - u_int i; val = val & ASMC_STATUS_MASK; - for (i = 0; i < amount; i++) { + for (u_int i = 0; i < amount; i++) { if ((ASMC_CMDPORT_READ(sc) & ASMC_STATUS_MASK) == val) return (0); DELAY(10); @@ -82,10 +81,9 @@ asmc_wait(device_t dev, uint8_t val) static int asmc_command(device_t dev, uint8_t command) { - int i; struct asmc_softc *sc = device_get_softc(dev); - for (i = 0; i < 10; i++) { + for (int i = 0; i < 10; i++) { ASMC_CMDPORT_WRITE(sc, command); if (asmc_wait_ack(dev, 0x0c, 100) == 0) { return (0); @@ -285,7 +283,7 @@ int asmc_pio_key_write(device_t dev, const char *key, uint8_t *buf, uint8_t len) { struct asmc_softc *sc = device_get_softc(dev); - int i, error = -1, try = 0; + int error = -1, try = 0; mtx_lock_spin(&sc->sc_mtx); @@ -303,7 +301,7 @@ begin: ASMC_DATAPORT_WRITE(sc, len); ASMC_DPRINTF(("data port: buffer\n")); - for (i = 0; i < len; i++) { + for (int i = 0; i < len; i++) { if (asmc_wait(dev, ASMC_STATUS_AWAIT_DATA)) goto out; ASMC_DATAPORT_WRITE(sc, buf[i]); diff --git a/sys/dev/asmc/asmc_sysctl.c b/sys/dev/asmc/asmc_sysctl.c index f0e8fa9ce832..38ef894a978f 100644 --- a/sys/dev/asmc/asmc_sysctl.c +++ b/sys/dev/asmc/asmc_sysctl.c @@ -310,9 +310,7 @@ static const struct { static const char * asmc_temp_desc(const char *key) { - unsigned int i; - - for (i = 0; i < nitems(asmc_temp_descs); i++) { + for (unsigned int i = 0; i < nitems(asmc_temp_descs); i++) { if (strcmp(asmc_temp_descs[i].key, key) == 0) return (asmc_temp_descs[i].desc); } @@ -1022,9 +1020,7 @@ asmc_sil_sysctl(SYSCTL_HANDLER_ARGS) static const char * asmc_cause_str(int8_t cause, bool is_sleep) { - size_t i; - - for (i = 0; i < nitems(asmc_cause_table); i++) { + for (size_t i = 0; i < nitems(asmc_cause_table); i++) { if (asmc_cause_table[i].code != cause) continue; if (is_sleep && asmc_cause_table[i].sleep_desc != NULL) diff --git a/sys/dev/asmc/asmcmmio.c b/sys/dev/asmc/asmcmmio.c index 012f7614931b..a083fa42e439 100644 --- a/sys/dev/asmc/asmcmmio.c +++ b/sys/dev/asmc/asmcmmio.c @@ -36,11 +36,10 @@ static int asmc_mmio_wait(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); - int i; uint8_t status; int delay_us = 10; - for (i = 0; i < ASMC_MMIO_MAX_WAIT; i++) { + for (int i = 0; i < ASMC_MMIO_MAX_WAIT; i++) { status = bus_read_1(sc->sc_iomem, ASMC_MMIO_STATUS); if (status & ASMC_MMIO_STATUS_READY) return (0);