Re: [PATCH] enclosure: fix lost return

From: James Bottomley
Date: Tue Jul 06 2010 - 11:39:30 EST


On Tue, 2010-07-06 at 19:28 +0400, Kulikov Vasiliy wrote:
> Useless statement must be return with argument.
>
> This patch silences a compiler warning:
> drivers/misc/enclosure.c: In function âenclosure_component_registerâ:
> drivers/misc/enclosure.c:289: warning: ignoring return value of âERR_PTRâ, declared with attribute warn_unused_result
>
> Signed-off-by: Kulikov Vasiliy <segooon@xxxxxxxxx>
> ---
> drivers/misc/enclosure.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
> index 48c84a5..9ae7bef 100644
> --- a/drivers/misc/enclosure.c
> +++ b/drivers/misc/enclosure.c
> @@ -286,7 +286,7 @@ enclosure_component_register(struct enclosure_device *edev,
>
> err = device_register(cdev);
> if (err)
> - ERR_PTR(err);
> + return ERR_PTR(err);

Well, the patch isn't quite correct, but I think I win a prize for
working out what the correct patch was and then forgetting to apply it:

http://marc.info/?l=linux-scsi&m=126843630320666

I've actually put it in my tree this time ...

James


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/