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

[PATCH] parport: constification

Trivial "const" additions to places in parport that truly are const.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Marko Kohtala and committed by
Linus Torvalds
a6767b7c b44d3bdd

+21 -15
+18 -12
drivers/parport/parport_pc.c
··· 1169 1169 1170 1170 /* GCC is not inlining extern inline function later overwriten to non-inline, 1171 1171 so we use outlined_ variants here. */ 1172 - static struct parport_operations parport_pc_ops = 1172 + static const struct parport_operations parport_pc_ops = 1173 1173 { 1174 1174 .write_data = parport_pc_write_data, 1175 1175 .read_data = parport_pc_read_data, ··· 1211 1211 static void __devinit show_parconfig_smsc37c669(int io, int key) 1212 1212 { 1213 1213 int cr1,cr4,cra,cr23,cr26,cr27,i=0; 1214 - static const char *modes[]={ "SPP and Bidirectional (PS/2)", 1215 - "EPP and SPP", 1216 - "ECP", 1217 - "ECP and EPP" }; 1214 + static const char *const modes[]={ 1215 + "SPP and Bidirectional (PS/2)", 1216 + "EPP and SPP", 1217 + "ECP", 1218 + "ECP and EPP" }; 1218 1219 1219 1220 outb(key,io); 1220 1221 outb(key,io); ··· 1289 1288 static void __devinit show_parconfig_winbond(int io, int key) 1290 1289 { 1291 1290 int cr30,cr60,cr61,cr70,cr74,crf0,i=0; 1292 - static const char *modes[] = { 1291 + static const char *const modes[] = { 1293 1292 "Standard (SPP) and Bidirectional(PS/2)", /* 0 */ 1294 1293 "EPP-1.9 and SPP", 1295 1294 "ECP", ··· 1298 1297 "EPP-1.7 and SPP", /* 5 */ 1299 1298 "undefined!", 1300 1299 "ECP and EPP-1.7" }; 1301 - static char *irqtypes[] = { "pulsed low, high-Z", "follows nACK" }; 1300 + static char *const irqtypes[] = { 1301 + "pulsed low, high-Z", 1302 + "follows nACK" }; 1302 1303 1303 1304 /* The registers are called compatible-PnP because the 1304 1305 register layout is modelled after ISA-PnP, the access ··· 2399 2396 2400 2397 /* ITE support maintained by Rich Liu <richliu@poorman.org> */ 2401 2398 static int __devinit sio_ite_8872_probe (struct pci_dev *pdev, int autoirq, 2402 - int autodma, struct parport_pc_via_data *via) 2399 + int autodma, 2400 + const struct parport_pc_via_data *via) 2403 2401 { 2404 2402 short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 }; 2405 2403 struct resource *base_res; ··· 2528 2524 }; 2529 2525 2530 2526 static int __devinit sio_via_probe (struct pci_dev *pdev, int autoirq, 2531 - int autodma, struct parport_pc_via_data *via) 2527 + int autodma, 2528 + const struct parport_pc_via_data *via) 2532 2529 { 2533 2530 u8 tmp, tmp2, siofunc; 2534 2531 u8 ppcontrol = 0; ··· 2699 2694 2700 2695 /* each element directly indexed from enum list, above */ 2701 2696 static struct parport_pc_superio { 2702 - int (*probe) (struct pci_dev *pdev, int autoirq, int autodma, struct parport_pc_via_data *via); 2703 - struct parport_pc_via_data *via; 2697 + int (*probe) (struct pci_dev *pdev, int autoirq, int autodma, 2698 + const struct parport_pc_via_data *via); 2699 + const struct parport_pc_via_data *via; 2704 2700 } parport_pc_superio_info[] __devinitdata = { 2705 2701 { sio_via_probe, &via_686a_data, }, 2706 2702 { sio_via_probe, &via_8231_data, }, ··· 2834 2828 /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, /* untested */ 2835 2829 }; 2836 2830 2837 - static struct pci_device_id parport_pc_pci_tbl[] = { 2831 + static const struct pci_device_id parport_pc_pci_tbl[] = { 2838 2832 /* Super-IO onboard chips */ 2839 2833 { 0x1106, 0x0686, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_686a }, 2840 2834 { 0x1106, 0x8231, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_8231 },
+3 -3
drivers/parport/probe.c
··· 11 11 #include <linux/string.h> 12 12 #include <asm/uaccess.h> 13 13 14 - static struct { 15 - char *token; 16 - char *descr; 14 + static const struct { 15 + const char *token; 16 + const char *descr; 17 17 } classes[] = { 18 18 { "", "Legacy device" }, 19 19 { "PRINTER", "Printer" },