PERFORCE change 149764 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Sep 14 17:14:44 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=149764
Change 149764 by hselasky at hselasky_laptop001 on 2008/09/14 17:14:33
Remove unused "curoff" variable and add more comments.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_dev.c#31 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_dev.c#31 (text+ko) ====
@@ -2699,7 +2699,6 @@
usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry, uint32_t user_len)
{
struct usb2_symlink *ps;
- uint32_t curoff = 0;
uint32_t temp;
uint32_t delta = 0;
uint8_t len;
@@ -2709,14 +2708,22 @@
TAILQ_FOREACH(ps, &usb2_sym_head, sym_entry) {
+ /*
+ * Compute total length of source and destination symlink
+ * strings pluss one length byte and two NUL bytes:
+ */
temp = ps->src_len + ps->dst_len + 3;
if (temp > 255) {
+ /*
+ * Skip entry because this length cannot fit
+ * into one byte:
+ */
continue;
}
if (startentry != 0) {
+ /* decrement read offset */
startentry--;
- curoff += temp;
continue;
}
if (temp > user_len) {
@@ -2766,7 +2773,6 @@
}
delta += 1;
- curoff += temp;
user_len -= temp;
}
More information about the p4-projects
mailing list