Date: Mon, 20 Sep 2010 18:49:29 +0000 (UTC) From: Weongyo Jeong <weongyo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r212913 - user/weongyo/usb/sys/dev/usb Message-ID: <201009201849.o8KInTRP063240@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: weongyo Date: Mon Sep 20 18:49:28 2010 New Revision: 212913 URL: http://svn.freebsd.org/changeset/base/212913 Log: Don't check `align' value 0 whenever it multiplies alignment value and 2 that it looks it's meaningless. Modified: user/weongyo/usb/sys/dev/usb/usb_busdma.c Modified: user/weongyo/usb/sys/dev/usb/usb_busdma.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_busdma.c Mon Sep 20 18:41:15 2010 (r212912) +++ user/weongyo/usb/sys/dev/usb/usb_busdma.c Mon Sep 20 18:49:28 2010 (r212913) @@ -490,18 +490,16 @@ usb_pc_alloc_mem(struct usb_page_cache * uptag = pc->tag_parent; + if (align == 0) + goto error; if (align != 1) { /* * The alignment must be greater or equal to the * "size" else the object can be split between two * memory pages and we get a problem! */ - while (align < size) { + while (align < size) align *= 2; - if (align == 0) { - goto error; - } - } #if 1 /* * XXX BUS-DMA workaround - FIXME later:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009201849.o8KInTRP063240>