Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335882
b: refs/heads/master
c: 3bb076a
h: refs/heads/master
v: v3
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Nov 18, 2012
1 parent 111221b commit 0900c57
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 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: d9c390561d1c4e520773e62781bbf89bb6845353
refs/heads/master: 3bb076af2ae571a48465972d5747175cec3564cd
14 changes: 9 additions & 5 deletions trunk/drivers/gpu/drm/nouveau/core/include/core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,18 @@ nv_mo32(void *obj, u32 addr, u32 mask, u32 data)
return temp;
}

static inline bool
nv_strncmp(void *obj, u32 addr, u32 len, const char *str)
static inline int
nv_memcmp(void *obj, u32 addr, const char *str, u32 len)
{
unsigned char c1, c2;

while (len--) {
if (nv_ro08(obj, addr++) != *(str++))
return false;
c1 = nv_ro08(obj, addr++);
c2 = *(str++);
if (c1 != c2)
return c1 - c2;
}
return true;
return 0;
}

#endif
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
}
} else
if (*ver >= 0x15) {
if (!nv_strncmp(bios, dcb - 7, 7, "DEV_REC")) {
if (!nv_memcmp(bios, dcb - 7, "DEV_REC", 7)) {
u16 i2c = nv_ro16(bios, dcb + 2);
*hdr = 4;
*cnt = (i2c - dcb) / 10;
Expand Down

0 comments on commit 0900c57

Please sign in to comment.