[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5d579b8c-0676-46d8-a020-77ee91e1e7d3@suswa.mountain>
Date: Tue, 24 Jun 2025 21:31:26 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Abdelrahman Fekry <abdelrahmanfekry375@...il.com>
Cc: andy@...nel.org, hdegoede@...hat.com, mchehab@...nel.org,
sakari.ailus@...ux.intel.com, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-staging@...ts.linux.dev, skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH v2] staging: media: atomisp: remove debug sysfs
attributes active_bo and free_bo
On Tue, Jun 24, 2025 at 08:49:36PM +0300, Abdelrahman Fekry wrote:
> On Tue, Jun 24, 2025 at 8:32 PM Dan Carpenter <dan.carpenter@...aro.org> wrote:
> >
> > On Tue, Jun 24, 2025 at 07:51:10PM +0300, Abdelrahman Fekry wrote:
> > > On Tue, Jun 24, 2025 at 7:31 PM Dan Carpenter <dan.carpenter@...aro.org> wrote:
> > > >
> > > > On Tue, Jun 24, 2025 at 05:49:43PM +0300, Abdelrahman Fekry wrote:
> > > > > int hmm_init(void)
> > > > > {
> > > > > int ret;
> > > > > @@ -130,14 +48,6 @@ int hmm_init(void)
> > > > > */
> > > > > dummy_ptr = hmm_alloc(1);
> > > > >
> > > > > - if (!ret) {
> > > > > - ret = sysfs_create_group(&atomisp_dev->kobj,
> > > > > - atomisp_attribute_group);
> > > > > - if (ret)
> > > > > - dev_err(atomisp_dev,
> > > > > - "%s Failed to create sysfs\n", __func__);
> > > > > - }
> > > > > -
> > > > > return ret;
> > > >
> > > >
> > > > It's really unclear how this "return ret;" is supposed to work. Was
> > > > that part of the sysfs_create_group()?
> > > >
> > > yes , but still it can be set by hmm_bo_device_init so even after removing
> > > sysfs_create_group , ret value depends on another function.
> > >
> >
> > You're in too big of a hurry. Wait for a day between resending patches.
> > I have looked at this some more and it turns out that nothing checks the
> > error code so the "return ret;" doesn't work. What do you think we
> > should do?
> >
> sorry , will keep the time issue in mind.
> regarding the "return ret", its now basically returning the error code of
> hmm_bo_device_init () inside the function , but outside the function
> scope like you mentioned, no function call to the hmm_init() checks
> the error code. Thats what you mean right ?
Yes. Nothing is checking for if hmm_init() fails. Step through the
code and verify that nothing crashes or bad happens as a result.
For example, I think hmm_bo_alloc() will print "hmm_bo_device not inited
yet." and return. So that's kind of annoying but it's not a crash.
Search through the rest of the driver and verify how it will behave.
regards,
dan carpenter
Powered by blists - more mailing lists