linux-mips
[Top] [All Lists]

Re: [PATCH] SCSI: fix the return type of the remove() method in sgi

To: "James Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH] SCSI: fix the return type of the remove() method in sgiwd93.c
From: "Vorobiev Dmitri" <dmitri.vorobiev@movial.fi>
Date: Wed, 3 Dec 2008 20:42:16 +0200 (EET)
Cc: "Kay Sievers" <kay.sievers@vrfy.org>, "Vorobiev Dmitri" <dmitri.vorobiev@movial.fi>, linux-scsi@vger.kernel.org, linux-mips@linux-mips.org, "Greg KH" <greg@kroah.com>
Importance: Normal
In-reply-to: <1228327306.5551.36.camel@localhost.localdomain>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1227140357-29921-1-git-send-email-dmitri.vorobiev@movial.fi> <46353.88.114.226.209.1228321494.squirrel@webmail.movial.fi> <1228324123.5551.25.camel@localhost.localdomain> <ac3eb2510812030952k5b57a9c7qb68e3684de170d75@mail.gmail.com> <1228327306.5551.36.camel@localhost.localdomain>
Sender: linux-mips-bounce@linux-mips.org
User-agent: SquirrelMail/1.4.9a
> On Wed, 2008-12-03 at 18:52 +0100, Kay Sievers wrote:
>> On Wed, Dec 3, 2008 at 18:08, James Bottomley
>> <James.Bottomley@hansenpartnership.com> wrote:
>> > On Wed, 2008-12-03 at 18:24 +0200, Vorobiev Dmitri wrote:
>> >> > This patch fixes the following compilation warning:
>> >> >
>> >> >   CC [M]  drivers/scsi/sgiwd93.o
>> >> > drivers/scsi/sgiwd93.c:314: warning: initialization from
>> incompatible
>> >> > pointer type
>> >>
>> >> Any news about this one? I think this patch should go via linux-scsi,
>> >> unless you would be insisting on pushing it via linux-mips, in which
>> case
>> >> I'll politely bug Ralf about it. :)
>> >
>> > Looks OK for the local change.
>> >
>> > Globally, having driver->remove and platform_driver->remove return int
>> > instead of void looks wrong.  Particularly when the only use cases are
>> > in drivers/base/ and they all ignore the return code.
>> >
>> > Greg and Kay ... shouldn't we simply redefine the return values for
>> the
>> > remove methods in these structures to return void (and thus match the
>> > use case)?
>>
>> Aren't there many many drivers across the tree, using the "int remove"
>> version?
>
> Yes ... since it's a function prototype.
>
> However, if drivers/base simply discards the return, it's a trap we
> shouldn't be setting.

Hmmm, it does look like the return value is discarded, please see
drivers/base/dd.c::__device_release_driver() for details.

Does this not deserve a good cleanup?

Dmitri

>
> James
>
>
>
>


<Prev in Thread] Current Thread [Next in Thread>