[PATCH v2 6/6] serial: 8250: make port operations work on struct uart_8250_port
Jiri Slaby
jirislaby at kernel.org
Tue Oct 13 03:15:35 PDT 2026
On 13. 10. 26, 12:00, Andy Shevchenko wrote:
>>>> First, it is used in the kernel quite a few times already
>>>> [1]. Second, while it is sort of c++ism (and I like to use modern c++), it
>>>> makes the life of the variable a lot more obvious.
>>>>
>>>> [1] eg. see output of: rg -U -C 5 '}\n+\s+struct .*\*.*=' drivers/
>>>
>>> (you made me to install something I haven't heard about, it's better to use
>>> `git grep` though)
>>
>> rg is order of magnitude faster (searches in parallel). More importantly in
>> this case, supports multiline matches. (And respects .git ignores.)
>
> Isn't `git grep` fast enough due to looking into index and not into the files?
> `rg` may not look at the Git index, right? So I may not to use an arbitrary
> hash without checking it out first.
Of course rg is not git grep.
>>> Note excluded __free() if I get regexp correctly
>>>
>>> $ rg -U -l '}\n+\s+struct .*\*[^)]*=' drivers/ | less
>>> drivers/ufs/host/ufs-qcom.c
>> ...
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>>>
>>> So, less than dozen of drivers doing wrong is not an argument, try something
>>> better. But thanks, I will check and address this in some of the above.
>>
>> Well, it's only an example of a declaration after a previous opening brace
>> "{" -- this one turned out to be easy to search for. There is a lot of more,
>> of course. kernel/ included.
>
> Please, provide a better search line, I will look at that. For now it's just
> a hypothetical assumption, I am afraid.
I am not much into writing a semi-parser at this point :D. This'd be a
task eg. for clang's ASTMatcher.
thanks,
--
js
suse labs
More information about the linux-arm-kernel
mailing list