lkml.org 
[lkml]   [2009]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 28/31] Constify struct super_operations for 2.6.32 v1
Alexey Dobriyan wrote:
>> - struct inode *(*alloc_inode)(struct super_block *sb);
>> + struct inode *(* const alloc_inode)(struct super_block *sb);
>
> Good rule is if adding const doesn't move object from one section
> to another, it isn't worth it.
>
> I suggest we stick to it or risk another wave of jumbo patches.
>
If all instances of a given ops structure are const and we would like to
preserve this policy for the future as well, then it is very useful
to give future programmers a strong hint about this policy by making
the compiler complain about any violation attempts. Otherwise they may
very well write code that modifies such structures and we will have to
work extra to undo that (or change the policy but in that case it is
good to know why we have to do that).
--
Emese


\
 
 \ /
  Last update: 2009-12-06 15:25    [W:0.064 / U:1.284 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site