lkml.org 
[lkml]   [2009]   [Dec]   [8]   [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
    On Wed, Dec 09, 2009 at 01:31:10AM +0000, Ralf Baechle wrote:
    > On Sun, Dec 06, 2009 at 08:14:46AM +0300, Alexey Dobriyan wrote:
    >
    > > Subject: Re: [PATCH 28/31] Constify struct super_operations for 2.6.32 v1
    > > Content-Type: text/plain; charset=ISO-8859-1
    > >
    > > > - 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.
    >
    > On MIPS I've changed a few pointer arguments that frequently were abused
    > by platform-specific code to const just to make sure such code blows up
    > at compile time and not later in my mail folder at review time.

    Seriously, folks, that looks like a fun sparse project: new type attribute
    that makes pointer conversions complain (inherited by aggregates containing
    one of such things) + one that restricts storage classes (again, inherited
    the same way). Another fun attribute: "no embedding into other objects".
    __force casts would suppress complaints in places where e.g. noconvert
    objects get allocated.


    \
     
     \ /
      Last update: 2009-12-09 02:49    [W:0.019 / U:29.424 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site