mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <vincent.cheng.xh@renesas.com>
To: <richardcochran@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Vincent Cheng <vincent.cheng.xh@renesas.com>
Subject: [PATCH v3 net-next 7/7] ptp: ptp_clockmatrix: clean-up - parenthesis around a == b are unnecessary
Date: Wed, 17 Feb 2021 00:42:18 -0500	[thread overview]
Message-ID: <1613540538-23792-8-git-send-email-vincent.cheng.xh@renesas.com> (raw)
In-Reply-To: <1613540538-23792-1-git-send-email-vincent.cheng.xh@renesas.com>

From: Vincent Cheng <vincent.cheng.xh@renesas.com>

Code clean-up.

Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
---
 drivers/ptp/ptp_clockmatrix.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
index dc42c36..75463c2 100644
--- a/drivers/ptp/ptp_clockmatrix.c
+++ b/drivers/ptp/ptp_clockmatrix.c
@@ -444,7 +444,7 @@ static int _sync_pll_output(struct idtcm *idtcm,
 	u16 sync_ctrl1;
 	u8 temp;
 
-	if ((qn == 0) && (qn_plus_1 == 0))
+	if (qn == 0 && qn_plus_1 == 0)
 		return 0;
 
 	switch (pll) {
@@ -509,7 +509,7 @@ static int _sync_pll_output(struct idtcm *idtcm,
 		return err;
 
 	/* PLL5 can have OUT8 as second additional output. */
-	if ((pll == 5) && (qn_plus_1 != 0)) {
+	if (pll == 5 && qn_plus_1 != 0) {
 		err = idtcm_read(idtcm, 0, HW_Q8_CTRL_SPARE,
 				 &temp, sizeof(temp));
 		if (err)
@@ -531,7 +531,7 @@ static int _sync_pll_output(struct idtcm *idtcm,
 	}
 
 	/* PLL6 can have OUT11 as second additional output. */
-	if ((pll == 6) && (qn_plus_1 != 0)) {
+	if (pll == 6 && qn_plus_1 != 0) {
 		err = idtcm_read(idtcm, 0, HW_Q11_CTRL_SPARE,
 				 &temp, sizeof(temp));
 		if (err)
@@ -654,7 +654,7 @@ static int idtcm_sync_pps_output(struct idtcm_channel *channel)
 			}
 		}
 
-		if ((qn != 0) || (qn_plus_1 != 0))
+		if (qn != 0 || qn_plus_1 != 0)
 			err = _sync_pll_output(idtcm, pll, sync_src, qn,
 					       qn_plus_1);
 
@@ -1263,13 +1263,11 @@ static int idtcm_load_firmware(struct idtcm *idtcm,
 			err = 0;
 
 			/* Top (status registers) and bottom are read-only */
-			if ((regaddr < GPIO_USER_CONTROL)
-			    || (regaddr >= SCRATCH))
+			if (regaddr < GPIO_USER_CONTROL || regaddr >= SCRATCH)
 				continue;
 
 			/* Page size 128, last 4 bytes of page skipped */
-			if (((loaddr > 0x7b) && (loaddr <= 0x7f))
-			     || loaddr > 0xfb)
+			if ((loaddr > 0x7b && loaddr <= 0x7f) || loaddr > 0xfb)
 				continue;
 
 			err = idtcm_write(idtcm, regaddr, 0, &val, sizeof(val));
@@ -1688,7 +1686,7 @@ static int _enable_pll_tod_sync(struct idtcm *idtcm,
 	u16 dpll;
 	u16 out0 = 0, out1 = 0;
 
-	if ((qn == 0) && (qn_plus_1 == 0))
+	if (qn == 0 && qn_plus_1 == 0)
 		return 0;
 
 	switch (pll) {
@@ -1883,7 +1881,7 @@ static int idtcm_enable_tod_sync(struct idtcm_channel *channel)
 			}
 		}
 
-		if ((qn != 0) || (qn_plus_1 != 0))
+		if (qn != 0 || qn_plus_1 != 0)
 			err = _enable_pll_tod_sync(idtcm, pll, sync_src, qn,
 					       qn_plus_1);
 		if (err)
-- 
2.7.4


  parent reply	other threads:[~2021-02-17  6:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  5:42 [PATCH v3 net-next 0/7] ptp: ptp_clockmatrix: Fix output 1 PPS alignment vincent.cheng.xh
2021-02-17  5:42 ` [PATCH v3 net-next 1/7] ptp: ptp_clockmatrix: Add wait_for_sys_apll_dpll_lock vincent.cheng.xh
2021-02-17  5:42 ` [PATCH v3 net-next 2/7] ptp: ptp_clockmatrix: Add alignment of 1 PPS to idtcm_perout_enable vincent.cheng.xh
2021-02-17  5:42 ` [PATCH v3 net-next 3/7] ptp: ptp_clockmatrix: Remove unused header declarations vincent.cheng.xh
2021-02-17  5:42 ` [PATCH v3 net-next 4/7] ptp: ptp_clockmatrix: Clean-up dev_*() messages vincent.cheng.xh
2021-02-17  5:42 ` [PATCH v3 net-next 5/7] ptp: ptp_clockmatrix: Coding style - tighten vertical spacing vincent.cheng.xh
2021-02-17  5:42 ` [PATCH v3 net-next 6/7] ptp: ptp_clockmatrix: Simplify code - remove unnecessary `err` variable vincent.cheng.xh
2021-02-17  5:42 ` vincent.cheng.xh [this message]
2021-02-17 22:00 ` [PATCH v3 net-next 0/7] ptp: ptp_clockmatrix: Fix output 1 PPS alignment patchwork-bot+netdevbpf

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=1613540538-23792-8-git-send-email-vincent.cheng.xh@renesas.com \
    --to=vincent.cheng.xh@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®