From: Stephen Hemminger <stephen@networkplumber.org>
To: Petr Oros <poros@redhat.com>
Cc: netdev@vger.kernel.org, dsahern@kernel.org, ivecera@redhat.com,
jiri@resnulli.us, Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH iproute2-next v4 3/3] dpll: Add dpll command
Date: Sun, 16 Nov 2025 09:09:26 -0800 [thread overview]
Message-ID: <20251116090926.130f3b9e@phoenix> (raw)
In-Reply-To: <20251115233341.2701607-4-poros@redhat.com>
On Sun, 16 Nov 2025 00:33:41 +0100
Petr Oros <poros@redhat.com> wrote:
> + /* Setup signal handler for graceful exit */
> + memset(&sa, 0, sizeof(sa));
Personal preference, but I like initialization vs memset.
To be pedantic use:
sigemptyset(&sa.sa_mask);
> + sa.sa_handler = monitor_sig_handler;
> + sigaction(SIGINT, &sa, NULL);
> + sigaction(SIGTERM, &sa, NULL);
> +
Current code is good enough, no need to change.
If you are going to use signal for exit, why not use signalfd() which
avoids lots of problems with interrupts in the middle of the loop.
Checkpatch has some advice, most of it is not applicable but probably
want to look at:
WARNING: Missing a blank line after declarations
#1146: FILE: dpll/dpll.c:554:
+ bool need_nl = true;
+ if (argc > 0 && strcmp(argv[0], "help") == 0)
WARNING: Missing a blank line after declarations
#1725: FILE: dpll/dpll.c:1133:
+ struct nlattr *tb_parent[DPLL_A_PIN_MAX + 1] = {};
+ mnl_attr_parse_nested(ctx->entries[i], attr_pin_cb, tb_parent);
WARNING: Missing a blank line after declarations
#1761: FILE: dpll/dpll.c:1169:
+ struct nlattr *tb_parent[DPLL_A_PIN_MAX + 1] = {};
+ mnl_attr_parse_nested(ctx->entries[i], attr_pin_cb, tb_parent);
WARNING: Missing a blank line after declarations
#1790: FILE: dpll/dpll.c:1198:
+ struct nlattr *tb_ref[DPLL_A_PIN_MAX + 1] = {};
+ mnl_attr_parse_nested(ctx->entries[i], attr_pin_cb, tb_ref);
WARNING: braces {} are not necessary for single statement blocks
#2480: FILE: dpll/dpll.c:1888:
+ if (json) {
+ open_json_array(PRINT_JSON, "monitor");
+ }
WARNING: Block comments use a trailing */ on a separate line
#2508: FILE: dpll/dpll.c:1916:
+ * If monitor_running is false, we're shutting down gracefully. */
WARNING: braces {} are not necessary for single statement blocks
#2516: FILE: dpll/dpll.c:1924:
+ if (json) {
+ close_json_array(PRINT_JSON, NULL);
+ }
next prev parent reply other threads:[~2025-11-16 17:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-15 23:33 [PATCH iproute2-next v4 0/3] Add DPLL subsystem management tool Petr Oros
2025-11-15 23:33 ` [PATCH iproute2-next v4 1/3] lib: Move mnlg to lib for shared use Petr Oros
2025-11-15 23:33 ` [PATCH iproute2-next v4 2/3] lib: Add str_to_bool helper function Petr Oros
2025-11-15 23:33 ` [PATCH iproute2-next v4 3/3] dpll: Add dpll command Petr Oros
2025-11-16 17:09 ` Stephen Hemminger [this message]
2025-11-20 13:20 ` Petr Oros
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251116090926.130f3b9e@phoenix \
--to=stephen@networkplumber.org \
--cc=dsahern@kernel.org \
--cc=ivecera@redhat.com \
--cc=jiri@nvidia.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=poros@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).