LWN.net Logo

const function pointers

const function pointers

Posted Aug 13, 2009 2:06 UTC (Thu) by jamesmrh (guest, #31622)
Parent article: In Brief

FWIW, checkpatch.pl does check some operations for const (file_operations and seq_operations), but this will only help new patches which are actually passed through the script.

There are some other operations to cover, too.

If anyone wants to help, have a wade through the grsecurity patch for hints.

797 files changed, 22449 insertions(+), 3032 deletions(-)

Perhaps make a cup of tea first.


(Log in to post comments)

const function pointers

Posted Aug 13, 2009 18:52 UTC (Thu) by spender (subscriber, #23067) [Link]

Or you can look at:
http://grsecurity.net/~spender/oooo_fancy.diff
http://grsecurity.net/~spender/more_const_fixes.diff
http://grsecurity.net/~spender/grsec_constfixes-2.4.37.4....

I'm pretty sure I made some corrections since then, so don't depend on the above to be 100% correct.

I can upload the simple/ugly script I used to automate fixing them up a bit.

-Brad

const function pointers

Posted Aug 13, 2009 19:02 UTC (Thu) by spender (subscriber, #23067) [Link]

There were only two things in 2.6.30.4 that needed the writable *_ops (I fixed up file_operations, seq_operations, dentry_operations, inode_operations, address_space_operations, vm_operations, super_operations): drivers/scsi/sg.c and virt/kvm/kvm_main.c

sg.c I fixed trivially, kvm_main.c can't be fixed easily without making the code ugly.

-Brad

const function pointers

Posted Aug 13, 2009 22:50 UTC (Thu) by jamesmrh (guest, #31622) [Link]

Thanks.

.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds