From owner-svn-src-all@FreeBSD.ORG Wed Jun 20 07:47:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9D911065670; Wed, 20 Jun 2012 07:47:00 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9258FC12; Wed, 20 Jun 2012 07:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=UzfZG8fbocgBxWUD86fqTDgnNhRzkRnYNcBIHuzWe5Q=; b=dzdK8e0jc0L2Neei46FeWij4ntQWKiMcB446At0piyQrUYCxgZ26yv+oZGGrzx5HoZd5UvcXRikeTqQkijflXvgaFJJau1Ic6IGEgcdbubUFKm5dFFT/0a7vjn7bb0jb; Received: from [93.185.182.46] (port=26323 helo=gpr.nnz-home.ru) by smtp16.mail.ru with esmtpa (envelope-from ) id 1ShFco-00020G-7N; Wed, 20 Jun 2012 11:46:50 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.77 (FreeBSD)) (envelope-from ) id 1ShFXC-000BpC-17; Wed, 20 Jun 2012 11:41:02 +0400 Date: Wed, 20 Jun 2012 11:41:01 +0400 From: Gennady Proskurin To: Poul-Henning Kamp Message-ID: <20120620074101.GA832@gpr.nnz-home.ru> References: <68FBE843-7337-4C90-B01F-E0CAABB62BCD@gsoft.com.au> <31750.1340083631@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: <31750.1340083631@critter.freebsd.dk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam: Not detected X-Mras: Ok Cc: svn-src-head@freebsd.org, Daniel O'Connor , Gennady Proskurin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r237223 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 07:47:01 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 19, 2012 at 05:27:11AM +0000, Poul-Henning Kamp wrote: > In message <68FBE843-7337-4C90-B01F-E0CAABB62BCD@gsoft.com.au>, "Daniel O'Conno > r" writes: > > >> If size is odd, this does not copy the last byte. Not sure, whether = > >this is intended. > > Feel free to improve... --45Z9DzgjV8m4Oswq Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fb.patch" Index: fbreg.h =================================================================== --- fbreg.h (revision 237289) +++ fbreg.h (working copy) @@ -39,9 +39,12 @@ static __inline void copyw(uint16_t *src, uint16_t *dst, size_t size) { + const int is_odd = (size & 0x1); size >>= 1; while (size--) *dst++ = *src++; + if (is_odd) + *(char*)dst = *(char*)src; // copy last byte } #define bcopy_io(s, d, c) copyw((void*)(s), (void*)(d), (c)) #define bcopy_toio(s, d, c) copyw((void*)(s), (void*)(d), (c)) --45Z9DzgjV8m4Oswq--