[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMbhsRSFcjo0YfTuWc9triYfXNXDMK=Q=Jsuh6dPe4Tb6qrJLA@mail.gmail.com>
Date: Sat, 14 Dec 2013 14:21:36 -0800
From: Colin Cross <ccross@...roid.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: John Stultz <john.stultz@...aro.org>,
LKML <linux-kernel@...r.kernel.org>,
Android Kernel Team <kernel-team@...roid.com>,
Sumit Semwal <sumit.semwal@...aro.org>,
Jesse Barker <jesse.barker@....com>,
Rebecca Schultz Zavin <rebecca@...roid.com>
Subject: Re: [PATCH 001/115] gpu: ion: Add ION Memory Manager
On Sat, Dec 14, 2013 at 1:44 PM, Greg KH <gregkh@...uxfoundation.org> wrote:
> On Sat, Dec 14, 2013 at 01:10:38PM -0800, Colin Cross wrote:
>> On Sat, Dec 14, 2013 at 8:52 AM, Greg KH <gregkh@...uxfoundation.org> wrote:
>> > On Fri, Dec 13, 2013 at 02:23:35PM -0800, John Stultz wrote:
>> >> + idev->debug_root = debugfs_create_dir("ion", NULL);
>> >> + if (IS_ERR_OR_NULL(idev->debug_root))
>> >> + pr_err("ion: failed to create debug files.\n");
>> >
>> > There's no need to check for this at all, you just printed out an error
>> > message if CONFIG_DEBUGFS is not enabled, which isn't all that nice.
>> >
>> > Something to clean up later, no big deal now.
>>
>> Patch 75/115 (ion: remove IS_ERR_OR_NULL) replaces this chunk with:
>> idev->debug_root = debugfs_create_dir("ion", NULL);
>> if (!idev->debug_root)
>> pr_err("ion: failed to create debug files.\n");
>> which won't print an error if debugfs is disabled.
>
> If debugfs is disabled, debugfs_create_dir() returns ERR_PTR(-ENODEV).
ERR_PTR(-ENODEV) is not NULL, so this won't print an error. I thought
that was the point of returning ERR_PTR when disabled and NULL when
enabled.
> So are you sure you tested this? :)
I have not tested this, but it seems correct to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists