lkml.org 
[lkml]   [2010]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/5] uio: Support 2^MINOR_BITS minors
Thomas Gleixner <tglx@linutronix.de> writes:

> On Tue, 21 Sep 2010, Greg KH wrote:
>
>> On Fri, Sep 17, 2010 at 10:36:50PM +0200, Thomas Gleixner wrote:
>> > On Tue, 14 Sep 2010, Eric W. Biederman wrote:
>> >
>> > >
>> > > register_chrdev limits uio devices to 256 minor numbers which causes
>> > > problems on one system I have with 384+ uio devices. So instead set
>> > > UIO_MAX_DEVICES to the maximum number of minors and use
>> > > alloc_chrdev_region to reserve the uio minors.
>> > >
>> > > The final result is that the code works the same but the uio driver now
>> > > supports any minor the idr allocator comes up with.
>> > >
>> > > Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
>> >
>> > One minor nit:
>> >
>> > > + result = alloc_chrdev_region(&uio_dev, 0, UIO_MAX_DEVICES, name);
>> > > + if (result)
>> > > + goto out;
>> >
>> > return result;
>>
>> Wait, why? It's the exact came code, as out does:
>>
>> out:
>> return result;
>>
>> and you need that line due to the code above it. So I say leave it.
>
> s/goto out/return result/g
>
> Gotos which end up in a single line "return foo;" are pretty
> pointless.

But they do result in a single exit, which if you insert debugging or
want to understand the code flow can sometimes be beneficial.

The compiler will make this transformation on it's own when it compiles
the code, because it does result in slightly better code.

*shrug* In the grand scheme of things it isn't a big deal.

I'm much more interested in getting the uio driver hotplug safe so when
I physically remove a device I am using I don't get a kernel crash.

Eric


\
 
 \ /
  Last update: 2010-09-22 00:25    [W:0.101 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site