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

[SCSI] lpfc: lower stack use in lpfc_fc_frame_check

according to checkstack the lpfc_fc_frame_check occupies the first
place in stack usage:

make checkstack
objdump -d vmlinux $(find . -name '*.ko') | \
perl /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/scripts/checkstack.pl x86_64
0x000013f4 lpfc_fc_frame_check [lpfc]: 1936
...
This change makes the rctl_names static, thus not on stack.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Tomas Henzl and committed by
James Bottomley
474ffb74 41511704

+2 -1
+2 -1
drivers/scsi/lpfc/lpfc_sli.c
··· 11578 11578 static int 11579 11579 lpfc_fc_frame_check(struct lpfc_hba *phba, struct fc_frame_header *fc_hdr) 11580 11580 { 11581 - char *rctl_names[] = FC_RCTL_NAMES_INIT; 11581 + /* make rctl_names static to save stack space */ 11582 + static char *rctl_names[] = FC_RCTL_NAMES_INIT; 11582 11583 char *type_names[] = FC_TYPE_NAMES_INIT; 11583 11584 struct fc_vft_header *fc_vft_hdr; 11584 11585