Re: [PATCH v2 12/12] reboot: use devm_blocking_notifier_chain_register()

[email protected]
Newsgroups org.kernel.vger.linux-input
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message incorrectly claims to replace the `blocking_notifier_chain_register() + devm_add_action_or_reset()` pattern, which was not used in the original code.
--

--- Patch [12]: [PATCH v2 12/12] reboot: use devm_blocking_notifier_chain_register() ---
commit 8cd90dfccbe30e1a7f1ea6421b385708237370fb
Author: Eliav Farber <[email protected]>

reboot: use devm_blocking_notifier_chain_register()

This commit replaces the manual devres allocation and registration pattern
in devm_register_reboot_notifier() with a direct call to
devm_blocking_notifier_chain_register(). It also drops the now unused
devm_unregister_reboot_notifier() callback.

> Replace the blocking_notifier_chain_register() +
> devm_add_action_or_reset() pattern with a single call to
> devm_blocking_notifier_chain_register(), removing the
> devm_unregister_reboot_notifier() callback.

[Severity: Medium]
This isn't a bug, but does the commit message accurately describe the old
code? 

Looking at the original implementation of devm_register_reboot_notifier()
in kernel/reboot.c, it didn't use devm_add_action_or_reset(), but rather
manually allocated the devres struct:

    rcnb = devres_alloc(devm_unregister_reboot_notifier,
                        sizeof(*rcnb), GFP_KERNEL);
    if (!rcnb)
        return -ENOMEM;

    ret = register_reboot_notifier(nb);

Could the commit message be updated to accurately reflect the pattern that
was actually removed from the code?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.