lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfnGKJ-2L-+rTxR=qf=vxJ-nnhBQv9um8z8wYKbio9nZg@mail.gmail.com>
Date: Mon, 24 Mar 2025 18:11:34 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Petr Mladek <pmladek@...e.com>, 
	Christophe JAILLET <christophe.jaillet@...adoo.fr>, Kees Cook <kees@...nel.org>, 
	"Masami Hiramatsu (Google)" <mhiramat@...nel.org>, linux-kernel@...r.kernel.org, 
	linux-hardening@...r.kernel.org, linux-trace-kernel@...r.kernel.org, 
	John Ogness <john.ogness@...utronix.de>, Sergey Senozhatsky <senozhatsky@...omium.org>, 
	Andy Shevchenko <andy@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, 
	Andrew Morton <akpm@...ux-foundation.org>, Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH v1 3/6] tracing: Mark binary printing functions with
 __printf() attribute

On Mon, Mar 24, 2025 at 6:02 PM Steven Rostedt <rostedt@...dmis.org> wrote:
> On Thu, 20 Mar 2025 20:04:24 +0200
> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:

> > -static inline void
> > +static inline __printf(2, 0)
> > +void
> >  trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)
> >  {
> >  }
>
> Do we need to split the line after the __printf()? Can't the above be:
>
> static inline __printf(2, 0) void
> trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)
>
> Or even:
>
> __printf(2, 0)
> static inline void
> trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)

I really tried hard to be consistent with something. tracing code is
most inconsistent in the regard to attributes and other things (at
least in this patch series).

> I rather not split the prefix elements of a function over two lines. I
> rather not even split them from the function itself, but tend to do that if
> space is needed.

I also looked at the approaches that are used in include/linux and
tried to follow that when in doubt. And I think the way to leave
static inline leading the stub is most used, followed by attribute.
Then for the declaration is all the same, leading attribute followed
by the returning type and so on...



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ