Re: [PATCH RFC v2] ath10k: move code from parameter list into a function

3 messages, 2 authors, 2015-03-11 · open the first message on its own page

Re: [PATCH RFC v2] ath10k: move code from parameter list into a function

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2015-03-11 19:10:28

On Wed, 2015-03-11 at 15:01 -0400, Nicholas Mc Guire wrote:
Putting code into the parameter list of wait_event_timeout() might be
legal C-code but not really readable - the "inline" code is simply
moved into a function and that passed to wait_event_timeout() as the
condition.
Arguably, that's even more unreadable since if you don't know this macro
well you might assume the function is called only once, which is clearly
not true...

Don't get me wrong, I'm not opposed to this change, but if you ask me
it's not completely clear that this makes it more readable.

johannes

Re: [PATCH RFC v2] ath10k: move code from parameter list into a function

From: Nicholas Mc Guire <hidden>
Date: 2015-03-11 19:15:32

On Wed, 11 Mar 2015, Johannes Berg wrote:
On Wed, 2015-03-11 at 15:01 -0400, Nicholas Mc Guire wrote:
quoted
Putting code into the parameter list of wait_event_timeout() might be
legal C-code but not really readable - the "inline" code is simply
moved into a function and that passed to wait_event_timeout() as the
condition.
Arguably, that's even more unreadable since if you don't know this macro
well you might assume the function is called only once, which is clearly
not true...

Don't get me wrong, I'm not opposed to this change, but if you ask me
it's not completely clear that this makes it more readable.
I'm not into this long enough to say what is better and if the consensus
is that this patch is no more readable than the original code
and no more maintainable either, then it is not worth the effort.

so thanks for your comments!

thx!
hofrat 

Re: [PATCH RFC v2] ath10k: move code from parameter list into a function

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2015-03-11 19:23:02

On Wed, 2015-03-11 at 20:15 +0100, Nicholas Mc Guire wrote:
I'm not into this long enough to say what is better and if the consensus
is that this patch is no more readable than the original code
and no more maintainable either, then it is not worth the effort.
Personally, I like the change, it might even make that function more
reusable etc., and it gets rid of the ({ ... }) expression syntax which
I always find a bit odd :)

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help