From nobody Fri Jun 02 08:20:03 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 4QXbXM4lLWz4Yxw4; Fri, 2 Jun 2023 08:20:03 +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 4QXbXM43dfz3D7W; Fri, 2 Jun 2023 08:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685694003; 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=+G0NkEL0KpqY+vhtj4UHnq5p/KwsinEuJgOgvQ/nBBE=; b=e1rbtOt8pCILYO85KH3c+sO/GHn4RuLHdx5uPnd5TZ6+eStXy0991LLVqjTMc79N6MhE3O g5Af4TH5H6Uh8Va2FC+VUUFttea0EUmkLgbaiBgbKOk+F+xo3Rh0VPSl8YsAKp37An175B KMNg9CLDmp78xcaO+AOlo7Kxmw3bQiUXQ96L1mga38/rY9wh0c5uHdjlEUXbvdOGvD4436 gFq5Xa4s9XAb7wnCm1ZkOkRH0DjHOr9oCn3EpEQ1/nvMcFDZk6gZkrh5Q53qDrwW4h7ERj 03J9cLTsOBsEluyu9pSkP/dXqW/Tz62ElCx1VDOh3Yzy1uxV32Q5kPrEy1vrRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685694003; 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=+G0NkEL0KpqY+vhtj4UHnq5p/KwsinEuJgOgvQ/nBBE=; b=JYEDmei4cPVh43cRMJ4h4Cbhb8Gyd52K8b2VCbM5zSAAeU2UyXoyLEKmNTeI7HAouBR31Z I+PYtUZBQu1REN+wXuZyyPzsb6CZhkGjC3XzwmNPoaVl0QuO+B/+dkB3Xxy87m4uSNZSsx dgxtO/l+P8RuPGHNAzOCygdmaECbLoz8x8CUhsUm0t0XqzyP5/RMHS7B+jkZArUA1q/C9H rTc3yPRpfUH7QE28cr0jSk8OOvRF8wWT+gN6MYbEbAwGsZD7cthw8//EgPW5yhryzbMosB CRkFwcFAQ7mRi5ECf4F7VfeseYM8UpQM0M+GFmH3Po1kXMOsq61TD73RMPwnqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685694003; a=rsa-sha256; cv=none; b=ovcH8LmkAgCFzBKJzbtymo9FnXrCOPNBOm4AHb9tl7Deox5r/x42QeyJTNf9mFWnjZwxYO 9mhMZzr6D3R5IfnnaS4SnkHsFQAsZYq9QBHz+HnJPz1qUVZWbDGPNG7oNx4ogz8nFlq8rJ pRNLtPbZFH9TDKxHhPWoNuFtZb2tBaLFTpVd7Kq+oHEDuk5KgcJga+ShbqEC8JCpA6GSOB O39QqJs8TFZ1ui7L+UikY+R85Rn5MKlV4XQnbX8aU5yHqD+bZpTZHtwICMdzH6pCeE6oNn ACeJOV1FWFB/Gk1XNiLYodR4k6uarasgFizkiIgUIBCgAoI+U7pF5VolKQEP7w== 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 4QXbXM2mlGzrw1; Fri, 2 Jun 2023 08:20:03 +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 3528K3nR071663; Fri, 2 Jun 2023 08:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3528K3aZ071661; Fri, 2 Jun 2023 08:20:03 GMT (envelope-from git) Date: Fri, 2 Jun 2023 08:20:03 GMT Message-Id: <202306020820.3528K3aZ071661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 3f9c093dfe98 - main - nlsysevent: rename variables for clarity of the code 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: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f9c093dfe9813ce499773184edd637bb507bf26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3f9c093dfe9813ce499773184edd637bb507bf26 commit 3f9c093dfe9813ce499773184edd637bb507bf26 Author: Baptiste Daroussin AuthorDate: 2023-06-02 07:58:24 +0000 Commit: Baptiste Daroussin CommitDate: 2023-06-02 08:04:49 +0000 nlsysevent: rename variables for clarity of the code Suggested by: melifaro --- sys/netlink/netlink_sysevent.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/netlink/netlink_sysevent.c b/sys/netlink/netlink_sysevent.c index 16366bb4aaa9..7bb783f7019c 100644 --- a/sys/netlink/netlink_sysevent.c +++ b/sys/netlink/netlink_sysevent.c @@ -47,14 +47,14 @@ MALLOC_DEFINE(M_NLSE, "nlsysevent", "Memory used for Netlink sysevent"); #define NLSE_FAMILY_NAME "nlsysevent" static uint32_t ctrl_family_id; -#define MAX_SYSEVENTS 64 -static struct sysevent { +#define MAX_SYSEVENT_GROUPS 64 +static struct sysevent_group { char *name; uint32_t id; -} sysevents[MAX_SYSEVENTS] = {}; +} sysevent_groups[MAX_SYSEVENT_GROUPS] = {}; static void -sysevent_write(struct sysevent *se, const char *subsystem, const char *type, +sysevent_write(struct sysevent_group *se, const char *subsystem, const char *type, const char *data) { struct nl_writer nw = {}; @@ -89,18 +89,18 @@ static void sysevent_send(const char *system, const char *subsystem, const char *type, const char *data) { - struct sysevent *se = NULL; + struct sysevent_group *se = NULL; - for (size_t i = 0; i < MAX_SYSEVENTS; i++) { - if (sysevents[i].name == NULL) { - sysevents[i].name = strdup(system, M_NLSE); - sysevents[i].id = genl_register_group(NLSE_FAMILY_NAME, + for (size_t i = 0; i < MAX_SYSEVENT_GROUPS; i++) { + if (sysevent_groups[i].name == NULL) { + sysevent_groups[i].name = strdup(system, M_NLSE); + sysevent_groups[i].id = genl_register_group(NLSE_FAMILY_NAME, system); - se = &sysevents[i]; + se = &sysevent_groups[i]; break; } - if (strcmp(sysevents[i].name, system) == 0) { - se = &sysevents[i]; + if (strcmp(sysevent_groups[i].name, system) == 0) { + se = &sysevent_groups[i]; break; } } @@ -121,12 +121,12 @@ nlsysevent_load(void) devctl_set_notify_hook(sysevent_send); ctrl_family_id = genl_register_family(NLSE_FAMILY_NAME, 0, 2, NLSE_ATTR_MAX); for (size_t i = 0; i < nitems(devctl_systems); i++) { - if (i >= MAX_SYSEVENTS) { + if (i >= MAX_SYSEVENT_GROUPS) { NL_LOG(LOG_WARNING, "impossible to add the event %s, too many events\n", devctl_systems[i]); continue; } - sysevents[i].name = strdup(devctl_systems[i], M_NLSE); - sysevents[i].id = genl_register_group(NLSE_FAMILY_NAME, devctl_systems[i]); + sysevent_groups[i].name = strdup(devctl_systems[i], M_NLSE); + sysevent_groups[i].id = genl_register_group(NLSE_FAMILY_NAME, devctl_systems[i]); } } @@ -135,10 +135,10 @@ nlsysevent_unload(void) { devctl_unset_notify_hook(); genl_unregister_family(NLSE_FAMILY_NAME); - for (size_t i = 0; i < MAX_SYSEVENTS; i++) { - if (sysevents[i].name == NULL) + for (size_t i = 0; i < MAX_SYSEVENT_GROUPS; i++) { + if (sysevent_groups[i].name == NULL) break; - free(sysevents[i].name, M_NLSE); + free(sysevent_groups[i].name, M_NLSE); } }