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]
Date:	Mon, 28 Sep 2015 21:05:31 +0200
From:	Denys Vlasenko <dvlasenk@...hat.com>
To:	Karsten Keil <isdn@...ux-pingi.de>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] isdn/hisax: Deinline writeCMDR and waitforCEC functions

MemwaitforCEC(), waitforCEC(), MemwaitforXFW() and waitforXFW()
functions have the following form:

    while ((read_reg(...) & BIT) && --cnt)
        udelay(1);
    if (cnt == 0)
	printk(KERN_WARNING...);

Thus, there is no reason for them to be inlined. They are not
bound by CPU performance.
(They have one callsite each, and probably were labeled inline
in the days when gcc wasn't clever enough to auto-inline statics.)

MemWriteHSCXCMDR(), WriteHSCXCMDR() and WriteJADECMDR()
each call one of waitforCEC()-style functions,
then write a register.

These functions do have multiple callers - each has six.

Since they incorporate busy-wait loop as shown above,
there is no reason for them to be inlined either.

After deinlining, MemWriteHSCXCMDR compiles to 117 bytes,
WriteJADECMDR to 284 bytes.

This patch decreases vmlinux by 7.5 kbytes:

    text     data      bss       dec     hex filename
91432614 19941016 36421632 147795262 8cf2d3e vmlinux.before
91425062 19941112 36421632 147787806 8cf101e vmlinux

Signed-off-by: Denys Vlasenko <dvlasenk@...hat.com>
CC: linux-kernel@...r.kernel.org
---
 drivers/isdn/hisax/diva.c     | 6 +++---
 drivers/isdn/hisax/hscx_irq.c | 6 +++---
 drivers/isdn/hisax/jade_irq.c | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 4fc90de..5c42a74 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -363,7 +363,7 @@ Start_IPACISA:
 	return IRQ_HANDLED;
 }
 
-static inline void
+static void
 MemwaitforCEC(struct IsdnCardState *cs, int hscx)
 {
 	int to = 50;
@@ -377,7 +377,7 @@ MemwaitforCEC(struct IsdnCardState *cs, int hscx)
 }
 
 
-static inline void
+static void
 MemwaitforXFW(struct IsdnCardState *cs, int hscx)
 {
 	int to = 50;
@@ -390,7 +390,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
 		printk(KERN_WARNING "HiSax: waitforXFW timeout\n");
 }
 
-static inline void
+static void
 MemWriteHSCXCMDR(struct IsdnCardState *cs, int hscx, u_char data)
 {
 	MemwaitforCEC(cs, hscx);
diff --git a/drivers/isdn/hisax/hscx_irq.c b/drivers/isdn/hisax/hscx_irq.c
index a8d6188..4b10af1 100644
--- a/drivers/isdn/hisax/hscx_irq.c
+++ b/drivers/isdn/hisax/hscx_irq.c
@@ -13,7 +13,7 @@
  */
 
 
-static inline void
+static void
 waitforCEC(struct IsdnCardState *cs, int hscx)
 {
 	int to = 50;
@@ -27,7 +27,7 @@ waitforCEC(struct IsdnCardState *cs, int hscx)
 }
 
 
-static inline void
+static void
 waitforXFW(struct IsdnCardState *cs, int hscx)
 {
 	int to = 50;
@@ -40,7 +40,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx)
 		printk(KERN_WARNING "HiSax: waitforXFW timeout\n");
 }
 
-static inline void
+static void
 WriteHSCXCMDR(struct IsdnCardState *cs, int hscx, u_char data)
 {
 	waitforCEC(cs, hscx);
diff --git a/drivers/isdn/hisax/jade_irq.c b/drivers/isdn/hisax/jade_irq.c
index b930da9..3d39723 100644
--- a/drivers/isdn/hisax/jade_irq.c
+++ b/drivers/isdn/hisax/jade_irq.c
@@ -10,7 +10,7 @@
  *
  */
 
-static inline void
+static void
 waitforCEC(struct IsdnCardState *cs, int jade, int reg)
 {
 	int to = 50;
@@ -30,7 +30,7 @@ waitforXFW(struct IsdnCardState *cs, int jade)
 	/* Does not work on older jade versions, don't care */
 }
 
-static inline void
+static void
 WriteJADECMDR(struct IsdnCardState *cs, int jade, int reg, u_char data)
 {
 	waitforCEC(cs, jade, reg);
-- 
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