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]
Date:   Mon, 16 Jul 2018 10:58:23 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Toke Høiland-Jørgensen <toke@...e.dk>
Cc:     netdev@...r.kernel.org, cake@...ts.bufferbloat.net
Subject: Re: [Cake] [PATCH iproute2-next v10] Add support for CAKE qdisc

On Mon, 16 Jul 2018 19:56:00 +0200
Toke Høiland-Jørgensen <toke@...e.dk> wrote:

> Stephen Hemminger <stephen@...workplumber.org> writes:
> 
> > On Mon, 16 Jul 2018 18:39:26 +0200
> > Toke Høiland-Jørgensen <toke@...e.dk> wrote:
> >  
> >> +#define PRINT_TSTAT(name, attr, fmts, val)	do {		\
> >> +			if (GET_TSTAT(0, attr)) {		\
> >> +				fprintf(f, name);		\
> >> +				for (i = 0; i < num_tins; i++)	\
> >> +					fprintf(f, " %12" fmts,	val);	\
> >> +				fprintf(f, "\n");			\
> >> +			}						\
> >> +		} while (0)  
> >
> > Couldn't this be a function?  
> 
> Guess so? But keeping it as a macro keeps it closer to where it is
> defined, and keeps the macro definitions together. IMO this is more
> readable than splitting things up...
> 
> -Toke

Personal preference. I hate macros, leftover from hours of debugging
bad expansions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ