diff options
author | Emese Revfy <re.emese@gmail.com> | 2010-03-05 16:43:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:44 -0500 |
commit | 79404849e90a41ea2109bd0e2f7c7164b0c4ce73 (patch) | |
tree | 9784e94c01de0b154711954d1b6df90467264b70 /scripts | |
parent | 22fd2d3e4f75a2596ccdfdcbdfd505c9c60bf346 (diff) |
checkpatch.pl: extend list of expected-to-be-const structures
Based on Arjan's suggestion, extend the list of ops structures that should
be const.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 623d07b97727..1a93ac265c31 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2654,9 +2654,46 @@ sub process { | |||
2654 | if ($line =~ /^.\s*__initcall\s*\(/) { | 2654 | if ($line =~ /^.\s*__initcall\s*\(/) { |
2655 | WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); | 2655 | WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); |
2656 | } | 2656 | } |
2657 | # check for struct file_operations, ensure they are const. | 2657 | # check for various ops structs, ensure they are const. |
2658 | my $struct_ops = qr{acpi_dock_ops| | ||
2659 | address_space_operations| | ||
2660 | backlight_ops| | ||
2661 | block_device_operations| | ||
2662 | dentry_operations| | ||
2663 | dev_pm_ops| | ||
2664 | dma_map_ops| | ||
2665 | extent_io_ops| | ||
2666 | file_lock_operations| | ||
2667 | file_operations| | ||
2668 | hv_ops| | ||
2669 | ide_dma_ops| | ||
2670 | intel_dvo_dev_ops| | ||
2671 | item_operations| | ||
2672 | iwl_ops| | ||
2673 | kgdb_arch| | ||
2674 | kgdb_io| | ||
2675 | kset_uevent_ops| | ||
2676 | lock_manager_operations| | ||
2677 | microcode_ops| | ||
2678 | mtrr_ops| | ||
2679 | neigh_ops| | ||
2680 | nlmsvc_binding| | ||
2681 | pci_raw_ops| | ||
2682 | pipe_buf_operations| | ||
2683 | platform_hibernation_ops| | ||
2684 | platform_suspend_ops| | ||
2685 | proto_ops| | ||
2686 | rpc_pipe_ops| | ||
2687 | seq_operations| | ||
2688 | snd_ac97_build_ops| | ||
2689 | soc_pcmcia_socket_ops| | ||
2690 | stacktrace_ops| | ||
2691 | sysfs_ops| | ||
2692 | tty_operations| | ||
2693 | usb_mon_operations| | ||
2694 | wd_ops}x; | ||
2658 | if ($line !~ /\bconst\b/ && | 2695 | if ($line !~ /\bconst\b/ && |
2659 | $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) { | 2696 | $line =~ /\bstruct\s+($struct_ops)\b/) { |
2660 | WARN("struct $1 should normally be const\n" . | 2697 | WARN("struct $1 should normally be const\n" . |
2661 | $herecurr); | 2698 | $herecurr); |
2662 | } | 2699 | } |