From: sashiko-bot@kernel.org
To: "Randy Dunlap" <rdunlap@infradead.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 02/03] fbdev: maxine: elide an unused function
Date: Fri, 14 Aug 2026 01:54:50 +0000 [thread overview]
Message-ID: <20260814015451.004791F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813232934.2718291-3-rdunlap@infradead.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch uses an `#if 0` block to retain the unused function `maxinefb_ims332_read_register` instead of removing it from the source file.
--
--- Patch [2]: [PATCH 02/03] fbdev: maxine: elide an unused function ---
commit 603e8df0aa8d23f85b3ef46ca55422bc6d08d6c9
Author: Randy Dunlap <rdunlap@infradead.org>
fbdev: maxine: elide an unused function
This commit addresses a compiler warning about an unused function by wrapping
maxinefb_ims332_read_register() in an #if 0 block. The author notes that the
function is intentionally retained to serve as documentation for the hardware
interface.
> diff --git a/drivers/video/fbdev/maxinefb.c b/drivers/video/fbdev/maxinefb.c
> --- a/drivers/video/fbdev/maxinefb.c
> +++ b/drivers/video/fbdev/maxinefb.c
> @@ -71,6 +71,8 @@ static void maxinefb_ims332_write_register(int regno, register unsigned int val)
> *((volatile unsigned short *) (wptr)) = val;
> }
>
> +#if 0
> +/* dead code: leave here for hardware interface documentation */
> static unsigned int maxinefb_ims332_read_register(int regno)
[Severity: Low]
Is it better to just delete this unused function entirely? Section 21 of the
kernel coding style states that if a function always goes unused, it should be
deleted rather than commented out or hidden behind preprocessor conditionals.
While the comment notes it acts as hardware documentation, leaving uncompiled
code in the tree skips compiler checks and often leads to bit-rot over time.
Could this be removed, relying on git history if anyone needs to reference
the hardware interface in the future?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813232934.2718291-1-rdunlap@infradead.org?part=2
next prev parent reply other threads:[~2026-08-14 1:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 23:29 [PATCH 00/03] fbdev: maxine: clean up build issues Randy Dunlap
2026-08-13 23:29 ` [PATCH 01/03] fbdev: maxine: make functions static Randy Dunlap
2026-08-14 1:50 ` sashiko-bot
2026-08-13 23:29 ` [PATCH 02/03] fbdev: maxine: elide an unused function Randy Dunlap
2026-08-14 1:54 ` sashiko-bot [this message]
2026-08-13 23:29 ` [PATCH 03/03] fbdev: maxine: fix 64-bit build error Randy Dunlap
2026-08-14 2:03 ` sashiko-bot
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=20260814015451.004791F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=rdunlap@infradead.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.