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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1430988589-9486-1-git-send-email-dvlasenk@redhat.com>
Date:	Thu,  7 May 2015 10:49:49 +0200
From:	Denys Vlasenko <dvlasenk@...hat.com>
To:	Ben Skeggs <bskeggs@...hat.com>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>,
	Stefan Huehner <stefan@...hner.org>,
	David Airlie <airlied@...ux.ie>,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/nouveau/core: deinline nv_mask()

Function compiles to 89 bytes of machine code.
466 callsites with this .config:
http://busybox.net/~vda/kernel_config
Size reduction:

   text      data      bss       dec     hex filename
82432426 22255384 20627456 125315266 77828c2 vmlinux.before
82426986 22255416 20627456 125309858 77813a2 vmlinux

Signed-off-by: Denys Vlasenko <dvlasenk@...hat.com>
CC: Stefan Huehner <stefan@...hner.org>
CC: Ben Skeggs <bskeggs@...hat.com>
CC: David Airlie <airlied@...ux.ie>
CC: dri-devel@...ts.freedesktop.org
CC: linux-kernel@...r.kernel.org
---
 drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | 9 ++-------
 drivers/gpu/drm/nouveau/nvkm/core/subdev.c         | 8 ++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
index 6fdc391..261b7ff 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
@@ -109,11 +109,6 @@ nv_wr32(void *obj, u32 addr, u32 data)
 	iowrite32_native(data, subdev->mmio + addr);
 }
 
-static inline u32
-nv_mask(void *obj, u32 addr, u32 mask, u32 data)
-{
-	u32 temp = nv_rd32(obj, addr);
-	nv_wr32(obj, addr, (temp & ~mask) | data);
-	return temp;
-}
+u32
+nv_mask(void *obj, u32 addr, u32 mask, u32 data);
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c
index c5fb3a79..88331ea 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c
@@ -25,6 +25,14 @@
 #include <core/device.h>
 #include <core/option.h>
 
+u32
+nv_mask(void *obj, u32 addr, u32 mask, u32 data)
+{
+	u32 temp = nv_rd32(obj, addr);
+	nv_wr32(obj, addr, (temp & ~mask) | data);
+	return temp;
+}
+
 struct nvkm_subdev *
 nvkm_subdev(void *obj, int idx)
 {
-- 
1.8.1.4

--
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