Changeset 46ec2c06 in mainline for pci/libpci/access.c
- Timestamp:
- 2006-05-11T16:08:50Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7981e3cc
- Parents:
- 20a9b85
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pci/libpci/access.c
r20a9b85 r46ec2c06 26 26 int i; 27 27 28 if (!a) 29 return NULL; 30 28 31 bzero(a, sizeof(*a)); 29 32 for (i = 0; i < PCI_ACCESS_MAX; i++) … … 38 41 39 42 if (!x) 40 a->error("Out of memory (allocation of %d bytes failed)", 41 size); 43 a->error("Out of memory (allocation of %d bytes failed)", size); 42 44 return x; 43 45 } … … 219 221 { 220 222 if (pos & (len - 1)) 221 d->access->error("Unaligned write: pos=%02x,len=%d", pos, 222 len); 223 d->access->error("Unaligned write: pos=%02x,len=%d", pos, len); 223 224 if (pos + len <= d->cache_len) 224 225 memcpy(d->cache + pos, buf, len); … … 246 247 { 247 248 if (pos < d->cache_len) { 248 int l = 249 (pos + len >= 250 d->cache_len) ? (d->cache_len - pos) : len; 249 int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len; 251 250 memcpy(d->cache + pos, buf, l); 252 251 } … … 261 260 } 262 261 if (flags & ~d->known_fields) 263 d->known_fields |= 264 d->methods->fill_info(d, flags & ~d->known_fields); 262 d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields); 265 263 return d->known_fields; 266 264 }
Note:
See TracChangeset
for help on using the changeset viewer.