linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: Ben Collins <ben.collins@ubuntu.com>
Cc: Linus Torvalds <torvalds@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.20-rc1] ib_verbs: Use explicit if-else statements to avoid errors with do-while macros
Date: Wed, 13 Dec 2006 22:16:35 -0800	[thread overview]
Message-ID: <adatzzzovcs.fsf@cisco.com> (raw)
In-Reply-To: <1166065805.6748.135.camel@gullible> (Ben Collins's message of "Wed, 13 Dec 2006 22:10:05 -0500")

I see Linus already took this, which is fine... blame me for merging
this without fixing my cross-compile testbed.

Anyway:

 >  static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr)
 >  {
 > -	return dev->dma_ops ?
 > -		dev->dma_ops->mapping_error(dev, dma_addr) :
 > -		dma_mapping_error(dma_addr);
 > +	if (dev->dma_ops)
 > +		return dev->dma_ops->mapping_error(dev, dma_addr);
 > +	return dma_mapping_error(dma_addr);

This stuff wasn't needed, was it?  It's only the wrappers around void
functions that can't use ?: I would think... surely any trivial macro
replacement for a dma API function that returns a value must evaluate
to something like (0) that is safe to use in this context.

 - R.

  reply	other threads:[~2006-12-14  6:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14  3:10 [PATCH 2.6.20-rc1] ib_verbs: Use explicit if-else statements to avoid errors with do-while macros Ben Collins
2006-12-14  6:16 ` Roland Dreier [this message]
2006-12-14  6:44 ` Al Viro
2006-12-14  6:56   ` Al Viro
2006-12-14  7:45     ` Roland Dreier
2006-12-14 14:24       ` Ben Collins
2006-12-14  9:08     ` Andrew Morton

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=adatzzzovcs.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=ben.collins@ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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).