linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Anderson <ryan@michonline.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [Dri-devel] Re: [PATCH] CodingStyle fixes for drm_agpsupport
Date: Tue, 12 Aug 2003 03:11:12 -0400	[thread overview]
Message-ID: <20030812071112.GQ24278@michonline.com> (raw)
In-Reply-To: <A98078D7EF5BEA4D8D8FD797FFBBC75F0453FCEA@fmsmsx402.fm.intel.com>

On Mon, Aug 11, 2003 at 01:21:22PM -0700, Sottek, Matthew J wrote:


> 2) There are some very real ways that bracketless code will
> get broken. Either someone adds a line that didn't notice the
> lack of brackets or, someone accidentally uses a multi-line
> macro.
> 
> i.e.
>    if(foo)
>      DEBUG_PRINT("Foo!\n");
> 
> works great for 100 years until someone recodes the DEBUG_PRINT
> macro to be 2 lines. The Linux kernel often has plain looking
> functions or variables that end up being macros (and may only
> expand to multi-line on some platforms) which could easily get
> you into such a situation.

#define DEBUG_PRINT(x) do { printk((x)); printk((x)); } while (0)

I believe your example is, oh, the #1 reason for this style of macro.

-- 

Ryan Anderson
  sometimes Pug Majere

  reply	other threads:[~2003-08-12  7:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11 20:21 [Dri-devel] Re: [PATCH] CodingStyle fixes for drm_agpsupport Sottek, Matthew J
2003-08-12  7:11 ` Ryan Anderson [this message]
2003-08-12 12:05 ` Peter "Firefly" Lund
  -- strict thread matches above, loose matches on Subject: below --
2003-08-11 15:59 davej
2003-08-11 16:40 ` Larry McVoy
2003-08-11 16:58   ` Jeff Garzik
2003-08-11 17:04     ` Larry McVoy
2003-08-11 17:15       ` Jeff Garzik
2003-08-11 17:23         ` Larry McVoy
2003-08-11 17:53           ` Jeff Garzik
2003-08-11 17:59             ` Larry McVoy
2003-08-11 19:09               ` [Dri-devel] " Philip Brown
2003-08-12 12:07                 ` Peter "Firefly" Lund
2003-08-14 14:21       ` Eli Carter
2003-08-14 14:47         ` Larry McVoy
2003-08-14 18:43           ` [Dri-devel] " Philip Brown
2003-08-14 18:59             ` Randy.Dunlap
2003-08-14 20:16             ` Larry McVoy
2003-08-14 20:21               ` Eli Carter
2003-08-14 20:22                 ` Larry McVoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030812071112.GQ24278@michonline.com \
    --to=ryan@michonline.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).