Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Sep 2008 17:14:43 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 149764 for review
Message-ID:  <200809141714.m8EHEh73017550@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149764

Change 149764 by hselasky@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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809141714.m8EHEh73017550>