Re: [PATCH 02/03] fbdev: maxine: elide an unused function
| Newsgroups | org.freedesktop.lists.dri-devel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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/[email protected]?part=2