Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bfa: deinline __bfa_trc() and __bfa_trc32()

__bfa_trc() compiles to 115 bytes of machine code.
With this .config: http://busybox.net/~vda/kernel_config
there are 1494 calls of __bfa_trc().

__bfa_trc32() is very similar, so it is uninlined too.
However, it appears to be unused, therefore this patch
ifdefs it out.

Change in code size is about 130,000 bytes:

text data bss dec hex filename
85975426 22294712 20627456 128897594 7aed23a vmlinux.before
85842882 22294584 20627456 128764922 7accbfa vmlinux

[mkp: Removed unused __bfa_trc32()]

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
CC: Fabian Frederick <fabf@skynet.be>
CC: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Ben Hutchings <ben@decadent.org.uk>
CC: James Bottomley <JBottomley@Parallels.com>
CC: linux-kernel@vger.kernel.org
CC: linux-scsi@vger.kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Denys Vlasenko and committed by
Martin K. Petersen
d04a78f4 9d7ab5aa

+23 -37
+19
drivers/scsi/bfa/bfa_core.c
··· 91 91 92 92 93 93 94 + void 95 + __bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data) 96 + { 97 + int tail = trcm->tail; 98 + struct bfa_trc_s *trc = &trcm->trc[tail]; 99 + 100 + if (trcm->stopped) 101 + return; 102 + 103 + trc->fileno = (u16) fileno; 104 + trc->line = (u16) line; 105 + trc->data.u64 = data; 106 + trc->timestamp = BFA_TRC_TS(trcm); 107 + 108 + trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); 109 + if (trcm->tail == trcm->head) 110 + trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); 111 + } 112 + 94 113 static void 95 114 bfa_com_port_attach(struct bfa_s *bfa) 96 115 {
+4 -37
drivers/scsi/bfa/bfa_cs.h
··· 108 108 trcm->stopped = 1; 109 109 } 110 110 111 - static inline void 112 - __bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data) 113 - { 114 - int tail = trcm->tail; 115 - struct bfa_trc_s *trc = &trcm->trc[tail]; 111 + void 112 + __bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data); 116 113 117 - if (trcm->stopped) 118 - return; 119 - 120 - trc->fileno = (u16) fileno; 121 - trc->line = (u16) line; 122 - trc->data.u64 = data; 123 - trc->timestamp = BFA_TRC_TS(trcm); 124 - 125 - trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); 126 - if (trcm->tail == trcm->head) 127 - trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); 128 - } 129 - 130 - 131 - static inline void 132 - __bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data) 133 - { 134 - int tail = trcm->tail; 135 - struct bfa_trc_s *trc = &trcm->trc[tail]; 136 - 137 - if (trcm->stopped) 138 - return; 139 - 140 - trc->fileno = (u16) fileno; 141 - trc->line = (u16) line; 142 - trc->data.u32.u32 = data; 143 - trc->timestamp = BFA_TRC_TS(trcm); 144 - 145 - trcm->tail = (trcm->tail + 1) & (BFA_TRC_MAX - 1); 146 - if (trcm->tail == trcm->head) 147 - trcm->head = (trcm->head + 1) & (BFA_TRC_MAX - 1); 148 - } 114 + void 115 + __bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data); 149 116 150 117 #define bfa_sm_fault(__mod, __event) do { \ 151 118 bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \