Commit 74a93fb5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hermes.h fails with outw_p() in :?

From: Michael Pruznick <michael_pruznick@mvista.com>

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.
parent 1f5fd6aa
...@@ -302,12 +302,14 @@ typedef struct hermes_response { ...@@ -302,12 +302,14 @@ typedef struct hermes_response {
#define hermes_read_reg(hw, off) ((hw)->io_space ? \ #define hermes_read_reg(hw, off) ((hw)->io_space ? \
inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \ inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
readw((hw)->iobase + ( (off) << (hw)->reg_spacing ))) readw((hw)->iobase + ( (off) << (hw)->reg_spacing )))
#define hermes_write_reg(hw, off, val) ((hw)->io_space ? \ #define hermes_write_reg(hw, off, val) do { \
outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )) : \ if ((hw)->io_space) \
writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing ))) outw_p((val), (hw)->iobase + ((off) << (hw)->reg_spacing)); \
else \
#define hermes_read_regn(hw, name) (hermes_read_reg((hw), HERMES_##name)) writew((val), (hw)->iobase + ((off) << (hw)->reg_spacing)); \
#define hermes_write_regn(hw, name, val) (hermes_write_reg((hw), HERMES_##name, (val))) } 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 */ /* Function prototypes */
void hermes_struct_init(hermes_t *hw, ulong address, int io_space, int reg_spacing); void hermes_struct_init(hermes_t *hw, ulong address, int io_space, int reg_spacing);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment