LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drm: Remove 80-column line in drm_mode_object.c
@ 2018-10-31 14:44 Shayenne da Luz Moura
  2018-10-31 15:13 ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Shayenne da Luz Moura @ 2018-10-31 14:44 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Sean Paul, David Airlie
  Cc: dri-devel, linux-kernel, outreachy-kernel

Add a new variable to make the drm_mode_object comparison before
idr_alloc and decrease line size.

Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
---
 drivers/gpu/drm/drm_mode_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index be8b754eaf60..4b9eafddb409 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -36,9 +36,10 @@ int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
 			  void (*obj_free_cb)(struct kref *kref))
 {
 	int ret;
+	struct drm_mode_object *obj_tmp = register_obj ? obj : NULL;
 
 	mutex_lock(&dev->mode_config.idr_mutex);
-	ret = idr_alloc(&dev->mode_config.crtc_idr, register_obj ? obj : NULL, 1, 0, GFP_KERNEL);
+	ret = idr_alloc(&dev->mode_config.crtc_idr, obj_tmp, 1, 0, GFP_KERNEL);
 	if (ret >= 0) {
 		/*
 		 * Set up the object linking under the protection of the idr
-- 
2.19.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm: Remove 80-column line in drm_mode_object.c
  2018-10-31 14:44 [PATCH] drm: Remove 80-column line in drm_mode_object.c Shayenne da Luz Moura
@ 2018-10-31 15:13 ` Jani Nikula
  2018-10-31 15:24   ` [Outreachy kernel] " Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2018-10-31 15:13 UTC (permalink / raw)
  To: Shayenne da Luz Moura, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, David Airlie
  Cc: outreachy-kernel, linux-kernel, dri-devel

On Wed, 31 Oct 2018, Shayenne da Luz Moura <shayenneluzmoura@gmail.com> wrote:
> Add a new variable to make the drm_mode_object comparison before
> idr_alloc and decrease line size.
>
> Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
> ---
>  drivers/gpu/drm/drm_mode_object.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
> index be8b754eaf60..4b9eafddb409 100644
> --- a/drivers/gpu/drm/drm_mode_object.c
> +++ b/drivers/gpu/drm/drm_mode_object.c
> @@ -36,9 +36,10 @@ int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
>  			  void (*obj_free_cb)(struct kref *kref))
>  {
>  	int ret;
> +	struct drm_mode_object *obj_tmp = register_obj ? obj : NULL;
>  
>  	mutex_lock(&dev->mode_config.idr_mutex);
> -	ret = idr_alloc(&dev->mode_config.crtc_idr, register_obj ? obj : NULL, 1, 0, GFP_KERNEL);
> +	ret = idr_alloc(&dev->mode_config.crtc_idr, obj_tmp, 1, 0, GFP_KERNEL);

Please don't send checkpatch "fixes" to adhere to the 80-column rule. Or
at least use --max-line-length=100 or something to look for worse
offenders than this.

And if you insist, please just add a newline and proper indentation
after "NULL," instead of adding a temporary variable.


BR,
Jani.

>  	if (ret >= 0) {
>  		/*
>  		 * Set up the object linking under the protection of the idr

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] Re: [PATCH] drm: Remove 80-column line in drm_mode_object.c
  2018-10-31 15:13 ` Jani Nikula
@ 2018-10-31 15:24   ` Daniel Vetter
  2018-10-31 17:36     ` Shayenne Moura
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2018-10-31 15:24 UTC (permalink / raw)
  To: Nikula, Jani
  Cc: Shayenne da Luz Moura, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, Dave Airlie, outreachy-kernel,
	Linux Kernel Mailing List, dri-devel

On Wed, Oct 31, 2018 at 4:13 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
>
> On Wed, 31 Oct 2018, Shayenne da Luz Moura <shayenneluzmoura@gmail.com> wrote:
> > Add a new variable to make the drm_mode_object comparison before
> > idr_alloc and decrease line size.
> >
> > Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
> > ---
> >  drivers/gpu/drm/drm_mode_object.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
> > index be8b754eaf60..4b9eafddb409 100644
> > --- a/drivers/gpu/drm/drm_mode_object.c
> > +++ b/drivers/gpu/drm/drm_mode_object.c
> > @@ -36,9 +36,10 @@ int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
> >                         void (*obj_free_cb)(struct kref *kref))
> >  {
> >       int ret;
> > +     struct drm_mode_object *obj_tmp = register_obj ? obj : NULL;
> >
> >       mutex_lock(&dev->mode_config.idr_mutex);
> > -     ret = idr_alloc(&dev->mode_config.crtc_idr, register_obj ? obj : NULL, 1, 0, GFP_KERNEL);
> > +     ret = idr_alloc(&dev->mode_config.crtc_idr, obj_tmp, 1, 0, GFP_KERNEL);
>
> Please don't send checkpatch "fixes" to adhere to the 80-column rule. Or
> at least use --max-line-length=100 or something to look for worse
> offenders than this.
>
> And if you insist, please just add a newline and proper indentation
> after "NULL," instead of adding a temporary variable.

Breaking the line after NULL, seems reasonable, I'd be happy to merge that.
-Daniel

>
>
> BR,
> Jani.
>
> >       if (ret >= 0) {
> >               /*
> >                * Set up the object linking under the protection of the idr
>
> --
> Jani Nikula, Intel Open Source Graphics Center
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/87a7mudu8t.fsf%40intel.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] Re: [PATCH] drm: Remove 80-column line in drm_mode_object.c
  2018-10-31 15:24   ` [Outreachy kernel] " Daniel Vetter
@ 2018-10-31 17:36     ` Shayenne Moura
  0 siblings, 0 replies; 4+ messages in thread
From: Shayenne Moura @ 2018-10-31 17:36 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Nikula, Jani, Maarten Lankhorst, Maxime Ripard, Sean Paul,
	Dave Airlie, outreachy-kernel, Linux Kernel Mailing List,
	dri-devel

On 10/31, Daniel Vetter wrote:
> On Wed, Oct 31, 2018 at 4:13 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
> >
> > On Wed, 31 Oct 2018, Shayenne da Luz Moura <shayenneluzmoura@gmail.com> wrote:
> > > Add a new variable to make the drm_mode_object comparison before
> > > idr_alloc and decrease line size.
> > >
> > > Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
> > > ---
> > >  drivers/gpu/drm/drm_mode_object.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
> > > index be8b754eaf60..4b9eafddb409 100644
> > > --- a/drivers/gpu/drm/drm_mode_object.c
> > > +++ b/drivers/gpu/drm/drm_mode_object.c
> > > @@ -36,9 +36,10 @@ int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
> > >                         void (*obj_free_cb)(struct kref *kref))
> > >  {
> > >       int ret;
> > > +     struct drm_mode_object *obj_tmp = register_obj ? obj : NULL;
> > >
> > >       mutex_lock(&dev->mode_config.idr_mutex);
> > > -     ret = idr_alloc(&dev->mode_config.crtc_idr, register_obj ? obj : NULL, 1, 0, GFP_KERNEL);
> > > +     ret = idr_alloc(&dev->mode_config.crtc_idr, obj_tmp, 1, 0, GFP_KERNEL);
> >
> > Please don't send checkpatch "fixes" to adhere to the 80-column rule. Or
> > at least use --max-line-length=100 or something to look for worse
> > offenders than this.
> >
> > And if you insist, please just add a newline and proper indentation
> > after "NULL," instead of adding a temporary variable.
> 
> Breaking the line after NULL, seems reasonable, I'd be happy to merge that.
> -Daniel

Okay, I will send a new version.

Thank you!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-31 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 14:44 [PATCH] drm: Remove 80-column line in drm_mode_object.c Shayenne da Luz Moura
2018-10-31 15:13 ` Jani Nikula
2018-10-31 15:24   ` [Outreachy kernel] " Daniel Vetter
2018-10-31 17:36     ` Shayenne Moura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).