Re: [PATCH] staging: sm750fb: clean up PLL calculation code
From: Himanshu Bakshi
Date: Sat Oct 24 2026 - 10:26:55 EST
Hi Greg,
Thank you for the feedback. I have read the discussion you linked.
My motivation for this patch was that I found the existing PLL
calculation difficult to follow when I was trying to understand it. I
wanted to document the formula, make the candidate-selection logic
easier to follow, and reduce the nesting.
I understand that making code look cleaner by itself may not be a
sufficient reason to change existing kernel code. I wanted to improve
the readability and understandability of this function, but I should
have explained the concrete benefit more clearly in the commit
message.
Regarding the LLM, I used it to help generate a standalone
differential test for comparing the original and modified algorithms.
The refactoring was my attempt to improve the code while learning how
to contribute to the kernel. I ran the generated test, but I
understand that testing copies of the implementations is not the same
as testing the actual kernel function.
I am new to kernel development and did not have a good understanding
of the contribution workflow when I started. I used an LLM as a
learning aid, but I recognize that I am responsible for understanding
and justifying every change and test I submit.
I will also make sure to follow the mailing list's plain-text and
bottom-posting conventions.
Thank you for taking the time to explain these issues.
Thanks and Regards,
Himanshu Bakshi
On Sat, Oct 24, 2026 at 7:40 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Oct 24, 2026 at 05:20:41PM +0530, Himanshu Bakshi wrote:
> > Hi Greg,
>
> Please do not top-post or send html email, the list rejects that.
>
> > I found this while reviewing sm750_calc_pll_value() and looking for a
> > cleaner way to handle the PLL candidate calculation.
>
> But why does it need to be "cleaner"?
>
> > I tested the change as follows:
> >
> > Built the sm750fb driver successfully using make -j2
> > M=drivers/staging/sm750fb W=1.
> >
> > Ran a standalone C differential regression test comparing the original
> > and modified algorithms across 2,010,084 test cases, including
> > frequency sweeps, boundary values, and randomized requests.
>
> Ah, you used a LLM. You have read:
> https://lore.kernel.org/r/2026080354-skater-urgent-31b2@gregkh
> right?
>
> Sorry,
>
> greg k-h