Commit b413cf490682d39a95e80a4751022b858d21bc6b

Authored by Mathias Krause
Committed by Christoph Hellwig
1 parent 806188a43c

aic79xx: fix misuse of static variables

The format strings for various printk()s make use of a temporary
variable that is declared 'static'. This is probably not intended,
so fix those.

Found in the PaX patch, written by the PaX Team.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: PaX Team <pageexec@freemail.hu>
Signed-off-by: Christoph Hellwig <hch@lst.de>

Showing 1 changed file with 5 additions and 13 deletions Side-by-side Diff

drivers/scsi/aic7xxx/aic79xx_pci.c
... ... @@ -827,7 +827,7 @@
827 827 for (bit = 0; bit < 8; bit++) {
828 828  
829 829 if ((pci_status[i] & (0x1 << bit)) != 0) {
830   - static const char *s;
  830 + const char *s;
831 831  
832 832 s = pci_status_strings[bit];
833 833 if (i == 7/*TARG*/ && bit == 3)
834 834  
835 835  
... ... @@ -887,23 +887,15 @@
887 887  
888 888 for (bit = 0; bit < 8; bit++) {
889 889  
890   - if ((split_status[i] & (0x1 << bit)) != 0) {
891   - static const char *s;
892   -
893   - s = split_status_strings[bit];
894   - printk(s, ahd_name(ahd),
  890 + if ((split_status[i] & (0x1 << bit)) != 0)
  891 + printk(split_status_strings[bit], ahd_name(ahd),
895 892 split_status_source[i]);
896   - }
897 893  
898 894 if (i > 1)
899 895 continue;
900 896  
901   - if ((sg_split_status[i] & (0x1 << bit)) != 0) {
902   - static const char *s;
903   -
904   - s = split_status_strings[bit];
905   - printk(s, ahd_name(ahd), "SG");
906   - }
  897 + if ((sg_split_status[i] & (0x1 << bit)) != 0)
  898 + printk(split_status_strings[bit], ahd_name(ahd), "SG");
907 899 }
908 900 }
909 901 /*