Message ID | 20190613132806.GA4863@kroah.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | komeda: no need to check return value of debugfs_create functions | expand |
On Thu, Jun 13, 2019 at 03:28:06PM +0200, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "James (Qian) Wang" <james.qian.wang@arm.com> > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: David Airlie <airlied@linux.ie> > Cc: Daniel Vetter <daniel@ffwll.ch> > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Thanks for the patch, I'll pull it into malidp tree (shared with komeda). Best regards, Liviu > --- > drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c > index ca3599e4a4d3..58100edf58fa 100644 > --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c > @@ -51,9 +51,6 @@ static void komeda_debugfs_init(struct komeda_dev *mdev) > return; > > mdev->debugfs_root = debugfs_create_dir("komeda", NULL); > - if (IS_ERR_OR_NULL(mdev->debugfs_root)) > - return; > - > debugfs_create_file("register", 0444, mdev->debugfs_root, > mdev, &komeda_register_fops); > } > -- > 2.22.0 >
On Thu, Jun 13, 2019 at 03:28:06PM +0200, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "James (Qian) Wang" <james.qian.wang@arm.com> > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: David Airlie <airlied@linux.ie> > Cc: Daniel Vetter <daniel@ffwll.ch> > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > --- > drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c > index ca3599e4a4d3..58100edf58fa 100644 > --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c > @@ -51,9 +51,6 @@ static void komeda_debugfs_init(struct komeda_dev *mdev) > return; > > mdev->debugfs_root = debugfs_create_dir("komeda", NULL); > - if (IS_ERR_OR_NULL(mdev->debugfs_root)) > - return; > - > debugfs_create_file("register", 0444, mdev->debugfs_root, > mdev, &komeda_register_fops); > } > -- > 2.22.0 Hi Greg; Thank you for helping to fix this problem. Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index ca3599e4a4d3..58100edf58fa 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -51,9 +51,6 @@ static void komeda_debugfs_init(struct komeda_dev *mdev) return; mdev->debugfs_root = debugfs_create_dir("komeda", NULL); - if (IS_ERR_OR_NULL(mdev->debugfs_root)) - return; - debugfs_create_file("register", 0444, mdev->debugfs_root, mdev, &komeda_register_fops); }
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: "James (Qian) Wang" <james.qian.wang@arm.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 3 --- 1 file changed, 3 deletions(-)