From: Michael Pruznick <michael_pruznick@mvista.com>
To: linux-kernel@vger.kernel.org
Subject: PATCH:2.4:2.6:compile hermes.h fails with outw_p() in :?
Date: Wed, 03 Sep 2003 11:32:44 -0600 [thread overview]
Message-ID: <3F5625BC.3C347696@mvista.com> (raw)
build errors:
hermes.h: In function `hermes_set_irqmask':
hermes.h:337: parse error before "do"
hermes.h:337: parse error before ';' token
hermes.h: In function `hermes_write_words':
In mips, outw_p() is a #define do...while(0) which, in the
case of ?:, results in a statement being used where an
expression is required.
Here are my proposed (identical) patches for 2.4 and 2.6.
--- linux-2.4.23-pre2/drivers/net/wireless/hermes.h Mon Aug 25 05:44:42 2003
+++ linux-2.4.23-pre2.hermes/drivers/net/wireless/hermes.h Wed Sep 3 11:05:05 2003
@@ -302,12 +302,14 @@
#define hermes_read_reg(hw, off) ((hw)->io_space ? \
inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
readw((hw)->iobase + ( (off) << (hw)->reg_spacing )))
-#define hermes_write_reg(hw, off, val) ((hw)->io_space ? \
- outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
- writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )))
-
-#define hermes_read_regn(hw, name) (hermes_read_reg((hw), HERMES_##name))
-#define hermes_write_regn(hw, name, val) (hermes_write_reg((hw), HERMES_##name, (val)))
+#define hermes_write_reg(hw, off, val) do { \
+ if ( (hw)->io_space ) \
+ outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )); \
+ else \
+ writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )); \
+ } while (0)
+#define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name)
+#define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val))
/* Function prototypes */
void hermes_struct_init(hermes_t *hw, ulong address, int io_space, int reg_spacing);
--- linux-2.6.00-test4/drivers/net/wireless/hermes.h Fri Aug 22 17:51:39 2003
+++ linux-2.6.00-test4.hermes/drivers/net/wireless/hermes.h Wed Sep 3 11:05:09 2003
@@ -302,12 +302,14 @@
#define hermes_read_reg(hw, off) ((hw)->io_space ? \
inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
readw((hw)->iobase + ( (off) << (hw)->reg_spacing )))
-#define hermes_write_reg(hw, off, val) ((hw)->io_space ? \
- outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
- writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )))
-
-#define hermes_read_regn(hw, name) (hermes_read_reg((hw), HERMES_##name))
-#define hermes_write_regn(hw, name, val) (hermes_write_reg((hw), HERMES_##name, (val)))
+#define hermes_write_reg(hw, off, val) do { \
+ if ( (hw)->io_space ) \
+ outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )); \
+ else \
+ writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )); \
+ } while (0)
+#define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name)
+#define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val))
/* Function prototypes */
void hermes_struct_init(hermes_t *hw, ulong address, int io_space, int reg_spacing);
reply other threads:[~2003-09-03 17:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3F5625BC.3C347696@mvista.com \
--to=michael_pruznick@mvista.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.