Re: [PATCH 1/2] drm: debugfs: make drm_debugfs_remove_files() a void function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 14, 2019 at 5:20 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Jun 14, 2019 at 04:59:08PM +0200, Daniel Vetter wrote:
> > On Fri, Jun 14, 2019 at 11:51:09AM +0200, Greg Kroah-Hartman wrote:
> > > The function can not fail, and no one checks the current return value,
> > > so just mark it as a void function so no one gets confused.
> > >
> > > Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
> > > Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxx>
> > > Cc: Sean Paul <sean@xxxxxxxxxx>
> > > Cc: David Airlie <airlied@xxxxxxxx>
> > > Cc: Daniel Vetter <daniel@xxxxxxxx>
> > > Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > ---
> > >  drivers/gpu/drm/drm_debugfs.c | 5 ++---
> > >  include/drm/drm_debugfs.h     | 9 ++++-----
> > >  2 files changed, 6 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> > > index 6f2802e9bfb5..515569002c86 100644
> > > --- a/drivers/gpu/drm/drm_debugfs.c
> > > +++ b/drivers/gpu/drm/drm_debugfs.c
> > > @@ -270,8 +270,8 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
> > >  }
> > >
> > >
> > > -int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
> > > -                        struct drm_minor *minor)
> > > +void drm_debugfs_remove_files(const struct drm_info_list *files, int count,
> > > +                         struct drm_minor *minor)
> >
> > We're trying to entirely nuke this function here, see the kerneldoc for
> > drm_debugfs_create_files(). Only user left is tegra, and we call the
> > "remove all debugfs files" and the ->early_unregister hooks all from the
> > same place. So this can all be garbage collected. It's mildly annoying
> > because we'd need to move the kfree from ->early_unregister into ->destroy
> > callbacks, because connectors are unregister before we throw away all the
> > debugfs files in drm_dev_unregister(). But imo that's cleaner anway.
>
> I would love to see this function gone, it can also make things a lot
> simpler from the point of view of creating the debugfs files as well, as
> no dentries will need to be saved.
>
> > Up for that?
>
> Sure, I can do that.  I have a much larger patch messing with
> drm_debugfs_create_files() that I want you all to be in a good mood for
> when I submit it (it touches all drivers at once), so I might as well
> clean this up first :)

Oh don't worry, we've had a pile of cleanup todo tasks in this area
since a long time. You doing them all is going to make me a happy
camper :-)

Only thing to be aware of is that we have a bit a habit of dragging
good contributors of refactoring/cleanup/fundamental work like this
into the drm fold for good. You might get stuck ...

> Give me a week, I'm supposed to be writing my slides for a conference
> now, instead I'm procrastinating by writing debugfs cleanup patches, I
> need to stop...

:-)

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux