lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-id: <1446204585-23412-1-git-send-email-shailendra.v@samung.com>
Date:	Fri, 30 Oct 2015 16:59:45 +0530
From:	Shailendra Verma <shailendra.v@...ung.com>
To:	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Tomi Valkeinen <tomi.valkeinen@...com>,
	linux-fbdev@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, vidushi.koul@...sung.com
Subject: [PATCH] video:fbdev:core:Calculate the buffer alignment if buffer is
 not IO mapped.

From: Shailendra Verma <Shailendra.v@...sung.com>

Moving the instruction "align = buf->buf_align - 1" just after the
verification of the buffer if it is IP mapped or not as the buffer
alignment is not required if it is IO mapped.Thus it will save an
extra instuction execution when buffer is IO mapped.

Signed-off-by: Shailendra Verma <Shailendra.v@...sung.com>
---
 linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c b/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c
index 0705d88..d92ec99 100644
--- a/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c
+++ b/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(fb_pad_unaligned_buffer);
  */
 char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size)
 {
-	u32 align = buf->buf_align - 1, offset;
+	u32 align, offset;
 	char *addr = buf->addr;
 
 	/* If IO mapped, we need to sync before access, no sharing of
@@ -169,6 +169,8 @@ char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size
 		return addr;
 	}
 
+	align = buf->buf_align - 1;
+
 	/* See if we fit in the remaining pixmap space */
 	offset = buf->offset + align;
 	offset &= ~align;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ