Re: [PATCH] bluetooth: use PTR_RET instead of IS_ERR + PTR_ERR

From: Joe Perches
Date: Mon Mar 18 2013 - 14:13:51 EST


On Mon, 2013-03-18 at 20:05 +0200, Silviu Popescu wrote:
> On Wed, Mar 13, 2013 at 11:31 AM, David Miller <davem@xxxxxxxxxxxxx> wrote:
> > From: Silviu-Mihai Popescu <silviupopescu1990@xxxxxxxxx>
> > Date: Tue, 12 Mar 2013 20:13:15 +0200
> >
> >> @@ -590,10 +590,7 @@ int __init bt_sysfs_init(void)
> >> bt_debugfs = debugfs_create_dir("bluetooth", NULL);
> >>
> >> bt_class = class_create(THIS_MODULE, "bluetooth");
> >> - if (IS_ERR(bt_class))
> >> - return PTR_ERR(bt_class);
> >> -
> >> - return 0;
> >> + return PTR_RET(bt_class)
> >
> > Don't bother submitting patches you aren't even going to try
> > to compile.
> >
> > I'm rejecting all of your current submissions. Resubmit them
> > when you feel like typing 'make' from time to time.
> >
> >
>
> Sorry for the trouble caused and sorry for the late reply.
> That being said, I'd like to understand a bit better what exactly I messed up.
> I've just pulled the latest revision of the mainline kernel and made
> the changes in this patch.
> I've tried with make defconfig (which would be x86_64_defconfig in my
> case), followed by
> make menuconfig to select the bluetooth options and make allyesconfig.
> Both defconfig and allyesconfig compile successfully on my system.
> Would you be so kind as to tell me what error you have encountered?
> Or perhaps enlighten me as to what I'm still doing wrong. I'd like to
> learn from my mistakes.

You do have to ensure that the file you modify
is actually compiled.

Sometimes it's easier to type make path/file.o

In any case, this is missing the statement terminating
semicolon after PTR_RET(bt_class).


--
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/