lkml.org 
[lkml]   [2020]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next 6/9] net: phy: add backplane kr driver support
From
Date
On Fri, 2020-03-27 at 15:22 +0100, Andrew Lunn wrote:
> > +/* Backplane custom logging */
> > +#define BPDEV_LOG(name) \
> > + char log_buffer[LOG_BUFFER_SIZE]; \
> > + va_list args; va_start(args, msg); \
> > + vsnprintf(log_buffer, LOG_BUFFER_SIZE - 1, msg, args); \
> > + if (!bpphy->attached_dev) \
> > + dev_##name(&bpphy->mdio.dev, log_buffer); \
> > + else \
> > + dev_##name(&bpphy->mdio.dev, "%s: %s", \
> > + netdev_name(bpphy->attached_dev), log_buffer); \
> > + va_end(args)

This could also use %pV instead of an intermediate buffer.

It's also bad form to use macros with required
external variables.

\
 
 \ /
  Last update: 2020-03-27 19:30    [W:0.072 / U:9.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site