Re: Is it ok to propose more complex code changes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 14, 2021 at 3:21 AM Julia Lawall <julia.lawall@xxxxxxxx> wrote:
>
> In principle, you can do whatever you like in staging.  If the maintainer
> doesn't like your suggestion, they can reject it.  This looks not entirely
> trivial, because the thing you want to abstract over is used once as a
> variable and once for its address.  I guess you can pass in the address
> and then dereference it, but you would have to check that that works ok
> with ARRAY_SIZE, which is also a macro.  You would also need to understand
> the code well enough to give this new function a resonable name.
>
> julia

Thanks! It's a great piece of advice.

Given that I am not much of a Pro C Developer, I took it up as a
challenge modifying the code in question to use a macro and then a
function. The macro attempt came up reasonably fast but when I tried
switching into a function the ARRAY_SIZE became much of a nightmare...
at least to me with my lacking c skills. But after a while of looking
at the code in question eye to eye, I noticed that the channels and
their size are already saved in the bands (lines 103-105, 110-112 in
drivers/staging/vt6655/channel.c) and that made my life much
simpler... and the resulting code is also simpler. I will give it a go
at sending over the patch and let's see how it goes.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux