lkml.org 
[lkml]   [2014]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs: replace int param with size_t for seq_open_private()


On 01/09/14 15:13, Alexey Dobriyan wrote:
> On Mon, Sep 1, 2014 at 4:54 PM, Rob Jones <rob.jones@codethink.co.uk> wrote:
>>
>>
>> On 01/09/14 14:43, Alexey Dobriyan wrote:
>>>>
>>>> void *__seq_open_private(struct file *f, const struct seq_operations
>>>> *ops,
>>>> - int psize)
>>>> + size_t psize)
>>>
>>>
>>> It should be "unsigned int" at most.
>>> As almost all in-kernel lengths.
>
>> I don't agree. Ultimately this parameter ends up as a parameter to
>> kmalloc where it is expected to be a size_t.
>
> Which is a mistake too because allocations are never that large.

Yet.

>
> Save REX prefix, keep length unsigned int!

I am happy to do this if the general opinion is that it is the right
thing but I would like more input first. Using size_t was suggested by
Andrew Morton which sounds to me like a heavy gun on the side of size_t.

>
> Alexey
>
>

--
Rob Jones
Codethink Ltd
mailto:rob.jones@codethink.co.uk
tel:+44 161 236 5575


\
 
 \ /
  Last update: 2014-09-01 17:21    [W:0.066 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site