diff options
| author | Hiroshi DOYU <hdoyu@nvidia.com> | 2012-05-11 06:04:45 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-11 18:21:27 -0400 |
| commit | b37fd4154e758c7226fda663e2ea3a97c6e8c732 (patch) | |
| tree | 78cc112a60154ce5954ea89ebd7fe4a1448e7e52 /drivers/memory | |
| parent | 0c733a427c430b54a6fa574fbc6e96baf7b9202f (diff) | |
ARM: tegra30: MC: Remove unnecessary BUG*()
Accessing interleaved MC register offsets/ranges are verified. BUG*()s
in accessors can be removed.
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/memory')
| -rw-r--r-- | drivers/memory/tegra30-mc.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/memory/tegra30-mc.c b/drivers/memory/tegra30-mc.c index c9821258117a..ec9fc7894801 100644 --- a/drivers/memory/tegra30-mc.c +++ b/drivers/memory/tegra30-mc.c | |||
| @@ -91,18 +91,18 @@ struct tegra30_mc { | |||
| 91 | 91 | ||
| 92 | static inline u32 mc_readl(struct tegra30_mc *mc, u32 offs) | 92 | static inline u32 mc_readl(struct tegra30_mc *mc, u32 offs) |
| 93 | { | 93 | { |
| 94 | u32 val = 0; | ||
| 95 | |||
| 94 | if (offs < 0x10) | 96 | if (offs < 0x10) |
| 95 | return readl(mc->regs[0] + offs); | 97 | val = readl(mc->regs[0] + offs); |
| 96 | BUG_ON(offs < 0x3c); | ||
| 97 | if (offs < 0x1f0) | 98 | if (offs < 0x1f0) |
| 98 | return readl(mc->regs[1] + offs - 0x3c); | 99 | val = readl(mc->regs[1] + offs - 0x3c); |
| 99 | BUG_ON(offs < 0x200); | ||
| 100 | if (offs < 0x228) | 100 | if (offs < 0x228) |
| 101 | return readl(mc->regs[2] + offs - 0x200); | 101 | val = readl(mc->regs[2] + offs - 0x200); |
| 102 | BUG_ON(offs < 0x284); | ||
| 103 | if (offs < 0x400) | 102 | if (offs < 0x400) |
| 104 | return readl(mc->regs[3] + offs - 0x284); | 103 | val = readl(mc->regs[3] + offs - 0x284); |
| 105 | BUG(); | 104 | |
| 105 | return val; | ||
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | static inline void mc_writel(struct tegra30_mc *mc, u32 val, u32 offs) | 108 | static inline void mc_writel(struct tegra30_mc *mc, u32 val, u32 offs) |
| @@ -111,22 +111,18 @@ static inline void mc_writel(struct tegra30_mc *mc, u32 val, u32 offs) | |||
| 111 | writel(val, mc->regs[0] + offs); | 111 | writel(val, mc->regs[0] + offs); |
| 112 | return; | 112 | return; |
| 113 | } | 113 | } |
| 114 | BUG_ON(offs < 0x3c); | ||
| 115 | if (offs < 0x1f0) { | 114 | if (offs < 0x1f0) { |
| 116 | writel(val, mc->regs[1] + offs - 0x3c); | 115 | writel(val, mc->regs[1] + offs - 0x3c); |
| 117 | return; | 116 | return; |
| 118 | } | 117 | } |
| 119 | BUG_ON(offs < 0x200); | ||
| 120 | if (offs < 0x228) { | 118 | if (offs < 0x228) { |
| 121 | writel(val, mc->regs[2] + offs - 0x200); | 119 | writel(val, mc->regs[2] + offs - 0x200); |
| 122 | return; | 120 | return; |
| 123 | } | 121 | } |
| 124 | BUG_ON(offs < 0x284); | ||
| 125 | if (offs < 0x400) { | 122 | if (offs < 0x400) { |
| 126 | writel(val, mc->regs[3] + offs - 0x284); | 123 | writel(val, mc->regs[3] + offs - 0x284); |
| 127 | return; | 124 | return; |
| 128 | } | 125 | } |
| 129 | BUG(); | ||
| 130 | } | 126 | } |
| 131 | 127 | ||
| 132 | static const char * const tegra30_mc_client[] = { | 128 | static const char * const tegra30_mc_client[] = { |
