Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375676
b: refs/heads/master
c: ad3e275
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Jon Mason committed May 15, 2013
1 parent 299c7e3 commit 5b58126
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 186f27ff9f9ec5c110739ced88ce9f8fca053882
refs/heads/master: ad3e2751e7c546ae678be1f8d86e898506b42cef
6 changes: 3 additions & 3 deletions trunk/drivers/ntb/ntb_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ int ntb_read_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 *val)
*/
void __iomem *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw)
{
if (mw > NTB_NUM_MW)
if (mw >= NTB_NUM_MW)
return NULL;

return ndev->mw[mw].vbase;
Expand All @@ -362,7 +362,7 @@ void __iomem *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw)
*/
resource_size_t ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw)
{
if (mw > NTB_NUM_MW)
if (mw >= NTB_NUM_MW)
return 0;

return ndev->mw[mw].bar_sz;
Expand All @@ -380,7 +380,7 @@ resource_size_t ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw)
*/
void ntb_set_mw_addr(struct ntb_device *ndev, unsigned int mw, u64 addr)
{
if (mw > NTB_NUM_MW)
if (mw >= NTB_NUM_MW)
return;

dev_dbg(&ndev->pdev->dev, "Writing addr %Lx to BAR %d\n", addr,
Expand Down

0 comments on commit 5b58126

Please sign in to comment.