lkml.org 
[lkml]   [2022]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/5] x86/alternative: simplify DUMP_BYTES macro
Date
On Fri, Mar 11 2022 at 17:43, Alexey Dobriyan wrote:
> Avoid zero length check with clever whitespace placement in the format
> string.
>
> Signed-off-by: Alexey Dobriyan (CloudLinux) <adobriyan@gmail.com>
> ---
> arch/x86/kernel/alternative.c | 21 +++++++++------------
> 1 file changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 5007c3ffe96f..6c9758ee6810 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -66,13 +66,10 @@ do { \
> if (unlikely(debug_alternative)) { \
> int j; \
> \
> - if (!(len)) \
> - break; \
> - \

How does that clever whitespace placement prevent this being printed in
the len == 0 case, which is a legit case?

> printk(KERN_DEBUG pr_fmt(fmt), ##args); \

This is debug muck. So why does it have to be "optimized"?

Thanks,

tglx

\
 
 \ /
  Last update: 2022-04-05 23:51    [W:0.127 / U:2.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site