diff mbox series

drm/i915/pcode: Fix the coding style

Message ID 20250210140924.1364158-1-nitin.r.gote@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/pcode: Fix the coding style | expand

Commit Message

Gote, Nitin R Feb. 10, 2025, 2:09 p.m. UTC
Prefer binary operator at the end of the previous
line instead of putting operator at the start of
the next line as per coding style.

Signed-off-by: Nitin Gote <nitin.r.gote@intel.com>
---
 drivers/gpu/drm/i915/intel_pcode.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Andi Shyti Feb. 10, 2025, 2:22 p.m. UTC | #1
Hi Nitin,

On Mon, Feb 10, 2025 at 07:39:24PM +0530, Nitin Gote wrote:
> Prefer binary operator at the end of the previous
> line instead of putting operator at the start of
> the next line as per coding style.

I'm not finding any documentation for this change, where did you
take it?

Andi
Jani Nikula Feb. 11, 2025, 1:25 p.m. UTC | #2
On Mon, 10 Feb 2025, Andi Shyti <andi.shyti@linux.intel.com> wrote:
> Hi Nitin,
>
> On Mon, Feb 10, 2025 at 07:39:24PM +0530, Nitin Gote wrote:
>> Prefer binary operator at the end of the previous
>> line instead of putting operator at the start of
>> the next line as per coding style.
>
> I'm not finding any documentation for this change, where did you
> take it?

If not documented, it's the prevalent style, anyway.

BR,
Jani.
Gote, Nitin R Feb. 12, 2025, 9:46 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Tuesday, February 11, 2025 6:56 PM
> To: Andi Shyti <andi.shyti@linux.intel.com>; Gote, Nitin R
> <nitin.r.gote@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/i915/pcode: Fix the coding style
> 
> On Mon, 10 Feb 2025, Andi Shyti <andi.shyti@linux.intel.com> wrote:
> > Hi Nitin,
> >
> > On Mon, Feb 10, 2025 at 07:39:24PM +0530, Nitin Gote wrote:
> >> Prefer binary operator at the end of the previous line instead of
> >> putting operator at the start of the next line as per coding style.
> >
> > I'm not finding any documentation for this change, where did you take
> > it?
> 
> If not documented, it's the prevalent style, anyway.

Yeah, My bad I thought it is a standard coding style but it is not so.
But still, I feel the more correct way is to use binary "|" operator in continuation of first line
instead of second line.

Thanks,
Nitin
> 
> BR,
> Jani.
> 
> 
> --
> Jani Nikula, Intel
Jani Nikula Feb. 12, 2025, 9:53 a.m. UTC | #4
On Wed, 12 Feb 2025, "Gote, Nitin R" <nitin.r.gote@intel.com> wrote:
> Hi,
>
>> -----Original Message-----
>> From: Jani Nikula <jani.nikula@linux.intel.com>
>> Sent: Tuesday, February 11, 2025 6:56 PM
>> To: Andi Shyti <andi.shyti@linux.intel.com>; Gote, Nitin R
>> <nitin.r.gote@intel.com>
>> Cc: intel-gfx@lists.freedesktop.org
>> Subject: Re: [PATCH] drm/i915/pcode: Fix the coding style
>> 
>> On Mon, 10 Feb 2025, Andi Shyti <andi.shyti@linux.intel.com> wrote:
>> > Hi Nitin,
>> >
>> > On Mon, Feb 10, 2025 at 07:39:24PM +0530, Nitin Gote wrote:
>> >> Prefer binary operator at the end of the previous line instead of
>> >> putting operator at the start of the next line as per coding style.
>> >
>> > I'm not finding any documentation for this change, where did you take
>> > it?
>> 
>> If not documented, it's the prevalent style, anyway.
>
> Yeah, My bad I thought it is a standard coding style but it is not so.
> But still, I feel the more correct way is to use binary "|" operator in continuation of first line
> instead of second line.

Yes, that's what I said, that's the prevalent style.

>
> Thanks,
> Nitin
>> 
>> BR,
>> Jani.
>> 
>> 
>> --
>> Jani Nikula, Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pcode.c b/drivers/gpu/drm/i915/intel_pcode.c
index 3db2ba439bb5..3e6cf3eb831e 100644
--- a/drivers/gpu/drm/i915/intel_pcode.c
+++ b/drivers/gpu/drm/i915/intel_pcode.c
@@ -248,9 +248,9 @@  int snb_pcode_read_p(struct intel_uncore *uncore, u32 mbcmd, u32 p1, u32 p2, u32
 	u32 mbox;
 	int err;
 
-	mbox = REG_FIELD_PREP(GEN6_PCODE_MB_COMMAND, mbcmd)
-		| REG_FIELD_PREP(GEN6_PCODE_MB_PARAM1, p1)
-		| REG_FIELD_PREP(GEN6_PCODE_MB_PARAM2, p2);
+	mbox = REG_FIELD_PREP(GEN6_PCODE_MB_COMMAND, mbcmd) |
+		REG_FIELD_PREP(GEN6_PCODE_MB_PARAM1, p1) |
+		REG_FIELD_PREP(GEN6_PCODE_MB_PARAM2, p2);
 
 	with_intel_runtime_pm(uncore->rpm, wakeref)
 		err = snb_pcode_read(uncore, mbox, val, NULL);
@@ -264,9 +264,9 @@  int snb_pcode_write_p(struct intel_uncore *uncore, u32 mbcmd, u32 p1, u32 p2, u3
 	u32 mbox;
 	int err;
 
-	mbox = REG_FIELD_PREP(GEN6_PCODE_MB_COMMAND, mbcmd)
-		| REG_FIELD_PREP(GEN6_PCODE_MB_PARAM1, p1)
-		| REG_FIELD_PREP(GEN6_PCODE_MB_PARAM2, p2);
+	mbox = REG_FIELD_PREP(GEN6_PCODE_MB_COMMAND, mbcmd) |
+		REG_FIELD_PREP(GEN6_PCODE_MB_PARAM1, p1) |
+		REG_FIELD_PREP(GEN6_PCODE_MB_PARAM2, p2);
 
 	with_intel_runtime_pm(uncore->rpm, wakeref)
 		err = snb_pcode_write(uncore, mbox, val);