Re: [PATCH net-next 02/15] net: dsa: sja1105: Remove usage of iterator for list_add() after loop

From
Jakub Kicinski <kuba@kernel.org>
Date
2022-04-09 00:04:37
Also in
linux-arm-kernel, lkml, netdev
Reply to
Jakob Koschel, 2022-04-08
On Sat, 9 Apr 2022 01:58:29 +0200 Jakob Koschel wrote:
quoted
This turns a pretty slick piece of code into something ugly :(
I'd rather you open coded the iteration here than make it more 
complex to satisfy "safe coding guidelines".  
I'm not entirely sure I understand what you mean with 
"open coded the iteration". But maybe the solution proposed by Vladimir [1]
works for you?
Yup, that's what I meant!
I'm planning to rewrite the cases in that way for the relevant ones.
quoted
Also the list_add() could be converted to list_add_tail().  
Good point, I wasn't sure if that's considered as something that should be
done as a separate change. I'm happy to include it in v2.
Ack, separate patch would be better for that. I guess Vladimir may have
used .prev on purpose, since _tail() doesn't intuitively scream _after()
Anyway, not important.
Thread (37 messages) 37 messages, 5 authors, last reply 2022-04-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help