All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Move hotplug inversion logic into separate helper
Date: Thu, 22 Sep 2022 07:53:30 -0300	[thread overview]
Message-ID: <20220922105330.grvt57lw7y6epkax@gjsousa-mobl2> (raw)
In-Reply-To: <87o7v77ria.fsf@intel.com>

On Thu, Sep 22, 2022 at 11:17:01AM +0300, Jani Nikula wrote:
> On Wed, 21 Sep 2022, Gustavo Sousa <gustavo.sousa@intel.com> wrote:
> > On Wed, Sep 21, 2022 at 11:21:00AM +0300, Jani Nikula wrote:
> >> On Tue, 20 Sep 2022, Gustavo Sousa <gustavo.sousa@intel.com> wrote:
> >> > Hi, Jani.
> >> >
> >> > On Tue, Sep 20, 2022 at 10:19:53AM +0300, Jani Nikula wrote:
> >> >> On Mon, 19 Sep 2022, Gustavo Sousa <gustavo.sousa@intel.com> wrote:
> >> >> > Make the code more readable, which will be more apparent as new
> >> >> > platforms with different hotplug inversion needs are added.
> >> >> >
> >> >> > Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
> >> >> > ---
> >> >> >  drivers/gpu/drm/i915/i915_irq.c | 25 ++++++++++++++++---------
> >> >> >  1 file changed, 16 insertions(+), 9 deletions(-)
> >> >> >
> >> >> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> >> >> > index de06f293e173..c53d21ae197f 100644
> >> >> > --- a/drivers/gpu/drm/i915/i915_irq.c
> >> >> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> >> >> > @@ -3263,6 +3263,21 @@ static void cherryview_irq_reset(struct drm_i915_private *dev_priv)
> >> >> >  	spin_unlock_irq(&dev_priv->irq_lock);
> >> >> >  }
> >> >> >  
> >> >> > +static void setup_hotplug_inversion(struct drm_i915_private *dev_priv)
> >> >> > +{
> >> >> > +	u32 invert_bits;
> >> >> > +
> >> >> > +	if (HAS_PCH_DG1(dev_priv))
> >> >> > +		invert_bits = INVERT_DDIA_HPD |
> >> >> > +			      INVERT_DDIB_HPD |
> >> >> > +			      INVERT_DDIC_HPD |
> >> >> > +			      INVERT_DDID_HPD;

Just checked the source and it seems I'm the only oddball aligning stuff like
this :-)

> >> >> 
> >> >> Nitpick, the indentation will be off compared to automated indentation.
> >> >
> >> > What do you mean by automated indentation?
> >> 
> >> For example, hit TAB on the lines using a smart enough editor, which has
> >> been configured to follow kernel coding style. ;)
> >> 
> >
> > I'm not sure I completely understand the issue. Could you provide an example of
> > such a configuration?
> 
> I never indent anything manually. If I hit TAB in emacs (or run M-x
> indent-region), it'll indent the current line (or region) using the
> built-in "linux" style [1].
> 
> [1] https://www.gnu.org/software/emacs/manual/html_node/ccmode/Built_002din-Styles.html
> 
> > Is the problem here the spaces after the tabs to align each INVERT_DDI*? Would
> > you suggest I just use tabs and do not align them to the first one?
> 
> If a parenthesized element in round brackets is split to multiple lines,
> the indent is usually tabs first and then spaces to align everything
> after the open parenthesis. If there are no parenthesis, the indent is
> just tabs.
> 
> Guess why the original dg1_hpd_irq_setup() has round brackets in the
> statement. ;) Though not everyone likes superfluous parenthesis for
> style.
> 
> > E.g.:
> >
> >                 invert_bits = INVERT_DDIA_HPD |
> >                                 INVERT_DDIB_HPD |
> >                                 INVERT_DDIC_HPD |
> >                                 INVERT_DDID_HPD;
> >
> > Another one:
> >
> >                 invert_bits = INVERT_DDIA_HPD |
> >                         INVERT_DDIB_HPD |
> >                         INVERT_DDIC_HPD |
> >                         INVERT_DDID_HPD;
> 
> Your patch applied, re-indented, and tabs converted to spaces for visual
> here:
> 
>         if (HAS_PCH_DG1(dev_priv))
>                 invert_bits = INVERT_DDIA_HPD |
>                         INVERT_DDIB_HPD |
>                         INVERT_DDIC_HPD |
>                         INVERT_DDID_HPD;
> 
> Anyway, indentation isn't a very fruitful conversation in itself. The
> original nitpick was an off the cuff remark. I'm mostly trying to
> suggest to use tools that will do indentation and other things for you,
> so you don't have to worry about getting it right.
> 

Thank you for the tips! I find them very helpful. I'll make sure to use proper
style when sending a new version.

--
Gustavo Sousa

      reply	other threads:[~2022-09-22 10:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 14:56 [Intel-gfx] [PATCH] drm/i915: Move hotplug inversion logic into separate helper Gustavo Sousa
2022-09-19 22:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-09-20  6:47 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-20  7:01 ` [Intel-gfx] [PATCH] " Lucas De Marchi
2022-09-20 16:27   ` Gustavo Sousa
2022-09-21  9:59     ` Jani Nikula
2022-09-20  7:19 ` Jani Nikula
2022-09-20 17:04   ` Gustavo Sousa
2022-09-20 17:56     ` Lucas De Marchi
2022-09-21 10:23       ` Jani Nikula
2022-09-21  8:21     ` Jani Nikula
2022-09-21 12:05       ` Gustavo Sousa
2022-09-22  8:17         ` Jani Nikula
2022-09-22 10:53           ` Gustavo Sousa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220922105330.grvt57lw7y6epkax@gjsousa-mobl2 \
    --to=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.