All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Subject: [PATCH 09/25] v4l: omap4iss: Fix operators precedence in ternary operators
Date: Wed,  4 Dec 2013 01:56:09 +0100	[thread overview]
Message-ID: <1386118585-12449-10-git-send-email-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <1386118585-12449-1-git-send-email-laurent.pinchart@ideasonboard.com>

The ternary operator ? : has a low precedence. Use parenthesis where
needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/media/omap4iss/iss_csi2.c    | 20 +++++++-------------
 drivers/staging/media/omap4iss/iss_ipipe.c   |  2 +-
 drivers/staging/media/omap4iss/iss_ipipeif.c |  4 ++--
 drivers/staging/media/omap4iss/iss_resizer.c | 12 +++++-------
 4 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c
index c3a5fca..ac5868ac 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -274,7 +274,7 @@ static void csi2_set_outaddr(struct iss_csi2_device *csi2, u32 addr)
  */
 static inline int is_usr_def_mapping(u32 format_id)
 {
-	return ((format_id & 0xF0) == 0x40) ? 1 : 0;
+	return (format_id & 0xF0) == 0x40 ? 1 : 0;
 }
 
 /*
@@ -766,16 +766,11 @@ void omap4iss_csi2_isr(struct iss_csi2_device *csi2)
 			      CSI2_IRQ_FIFO_OVF)) {
 		dev_dbg(iss->dev,
 			"CSI2 Err: OCP:%d SHORT:%d ECC:%d CPXIO:%d OVF:%d\n",
-			(csi2_irqstatus &
-			 CSI2_IRQ_OCP_ERR) ? 1 : 0,
-			(csi2_irqstatus &
-			 CSI2_IRQ_SHORT_PACKET) ? 1 : 0,
-			(csi2_irqstatus &
-			 CSI2_IRQ_ECC_NO_CORRECTION) ? 1 : 0,
-			(csi2_irqstatus &
-			 CSI2_IRQ_COMPLEXIO_ERR) ? 1 : 0,
-			(csi2_irqstatus &
-			 CSI2_IRQ_FIFO_OVF) ? 1 : 0);
+			csi2_irqstatus & CSI2_IRQ_OCP_ERR ? 1 : 0,
+			csi2_irqstatus & CSI2_IRQ_SHORT_PACKET ? 1 : 0,
+			csi2_irqstatus & CSI2_IRQ_ECC_NO_CORRECTION ? 1 : 0,
+			csi2_irqstatus & CSI2_IRQ_COMPLEXIO_ERR ? 1 : 0,
+			csi2_irqstatus & CSI2_IRQ_FIFO_OVF ? 1 : 0);
 		pipe->error = true;
 	}
 
@@ -1209,8 +1204,7 @@ static int csi2_link_setup(struct media_entity *entity,
 		return -EINVAL;
 	}
 
-	ctrl->vp_only_enable =
-		(csi2->output & CSI2_OUTPUT_MEMORY) ? false : true;
+	ctrl->vp_only_enable = csi2->output & CSI2_OUTPUT_MEMORY ? false : true;
 	ctrl->vp_clk_enable = !!(csi2->output & CSI2_OUTPUT_IPIPEIF);
 
 	return 0;
diff --git a/drivers/staging/media/omap4iss/iss_ipipe.c b/drivers/staging/media/omap4iss/iss_ipipe.c
index fc38a5c5..bdafd78 100644
--- a/drivers/staging/media/omap4iss/iss_ipipe.c
+++ b/drivers/staging/media/omap4iss/iss_ipipe.c
@@ -75,7 +75,7 @@ static void ipipe_enable(struct iss_ipipe_device *ipipe, u8 enable)
 
 	writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_IPIPE] + IPIPE_SRC_EN) &
 		~IPIPE_SRC_EN_EN) |
-		enable ? IPIPE_SRC_EN_EN : 0,
+		(enable ? IPIPE_SRC_EN_EN : 0),
 		iss->regs[OMAP4_ISS_MEM_ISP_IPIPE] + IPIPE_SRC_EN);
 }
 
diff --git a/drivers/staging/media/omap4iss/iss_ipipeif.c b/drivers/staging/media/omap4iss/iss_ipipeif.c
index 5464742..3d6cc88 100644
--- a/drivers/staging/media/omap4iss/iss_ipipeif.c
+++ b/drivers/staging/media/omap4iss/iss_ipipeif.c
@@ -85,7 +85,7 @@ static void ipipeif_write_enable(struct iss_ipipeif_device *ipipeif, u8 enable)
 
 	writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_SYNCEN) &
 		~ISIF_SYNCEN_DWEN) |
-		enable ? ISIF_SYNCEN_DWEN : 0,
+		(enable ? ISIF_SYNCEN_DWEN : 0),
 		iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_SYNCEN);
 }
 
@@ -100,7 +100,7 @@ static void ipipeif_enable(struct iss_ipipeif_device *ipipeif, u8 enable)
 
 	writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_SYNCEN) &
 		~ISIF_SYNCEN_SYEN) |
-		enable ? ISIF_SYNCEN_SYEN : 0,
+		(enable ? ISIF_SYNCEN_SYEN : 0),
 		iss->regs[OMAP4_ISS_MEM_ISP_ISIF] + ISIF_SYNCEN);
 }
 
diff --git a/drivers/staging/media/omap4iss/iss_resizer.c b/drivers/staging/media/omap4iss/iss_resizer.c
index 272b92a..68eb2a7 100644
--- a/drivers/staging/media/omap4iss/iss_resizer.c
+++ b/drivers/staging/media/omap4iss/iss_resizer.c
@@ -118,13 +118,13 @@ static void resizer_enable(struct iss_resizer_device *resizer, u8 enable)
 
 	writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_RESIZER] + RSZ_SRC_EN) &
 		~RSZ_SRC_EN_SRC_EN) |
-		enable ? RSZ_SRC_EN_SRC_EN : 0,
+		(enable ? RSZ_SRC_EN_SRC_EN : 0),
 		iss->regs[OMAP4_ISS_MEM_ISP_RESIZER] + RSZ_SRC_EN);
 
 	/* TODO: Enable RSZB */
 	writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_RESIZER] + RZA_EN) &
 		~RSZ_EN_EN) |
-		enable ? RSZ_EN_EN : 0,
+		(enable ? RSZ_EN_EN : 0),
 		iss->regs[OMAP4_ISS_MEM_ISP_RESIZER] + RZA_EN);
 }
 
@@ -202,7 +202,7 @@ static void resizer_configure(struct iss_resizer_device *resizer)
 	/* Select RSZ input */
 	writel((readl(iss->regs[OMAP4_ISS_MEM_ISP_RESIZER] + RSZ_SRC_FMT0) &
 		~RSZ_SRC_FMT0_SEL) |
-		(resizer->input == RESIZER_INPUT_IPIPEIF) ? RSZ_SRC_FMT0_SEL : 0,
+		(resizer->input == RESIZER_INPUT_IPIPEIF ? RSZ_SRC_FMT0_SEL : 0),
 		iss->regs[OMAP4_ISS_MEM_ISP_RESIZER] + RSZ_SRC_FMT0);
 
 	/* RSZ ignores WEN signal from IPIPE/IPIPEIF */
@@ -318,10 +318,8 @@ void omap4iss_resizer_isr(struct iss_resizer_device *resizer, u32 events)
 	if (events & (ISP5_IRQ_RSZ_FIFO_IN_BLK_ERR |
 		      ISP5_IRQ_RSZ_FIFO_OVF)) {
 		dev_dbg(iss->dev, "RSZ Err: FIFO_IN_BLK:%d, FIFO_OVF:%d\n",
-			(events &
-			 ISP5_IRQ_RSZ_FIFO_IN_BLK_ERR) ? 1 : 0,
-			(events &
-			 ISP5_IRQ_RSZ_FIFO_OVF) ? 1 : 0);
+			events & ISP5_IRQ_RSZ_FIFO_IN_BLK_ERR ? 1 : 0,
+			events & ISP5_IRQ_RSZ_FIFO_OVF ? 1 : 0);
 		pipe->error = true;
 	}
 
-- 
1.8.3.2


  parent reply	other threads:[~2013-12-04  0:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04  0:56 [PATCH 00/25] OMAP4 ISS fixes Laurent Pinchart
2013-12-04  0:56 ` [PATCH 01/25] v4l: omap4iss: Replace printk by dev_err Laurent Pinchart
2013-12-04  0:56 ` [PATCH 02/25] v4l: omap4iss: Don't split log strings on multiple lines Laurent Pinchart
2013-12-04  0:56 ` [PATCH 03/25] v4l: omap4iss: Restrict line lengths to 80 characters where possible Laurent Pinchart
2013-12-04  0:56 ` [PATCH 04/25] v4l: omap4iss: Remove double semicolon at end of line Laurent Pinchart
2013-12-04  0:56 ` [PATCH 05/25] v4l: omap4iss: Define more ISS and ISP IRQ register bits Laurent Pinchart
2013-12-04  0:56 ` [PATCH 06/25] v4l: omap4iss: isif: Define more VDINT registers Laurent Pinchart
2013-12-04  0:56 ` [PATCH 07/25] v4l: omap4iss: Enhance IRQ debugging Laurent Pinchart
2013-12-04  0:56 ` [PATCH 08/25] v4l: omap4iss: Don't make IRQ debugging functions inline Laurent Pinchart
2013-12-04  0:56 ` Laurent Pinchart [this message]
2013-12-04  0:56 ` [PATCH 10/25] v4l: omap4iss: isif: Ignore VD0 interrupts when no buffer is available Laurent Pinchart
2013-12-04  0:56 ` [PATCH 11/25] v4l: omap4iss: ipipeif: Shift input data according to the input format Laurent Pinchart
2013-12-04  0:56 ` [PATCH 12/25] v4l: omap4iss: csi2: Enable automatic ULP mode transition Laurent Pinchart
2013-12-04  0:56 ` [PATCH 13/25] v4l: omap4iss: Create and use register access functions Laurent Pinchart
2013-12-04  0:56 ` [PATCH 14/25] v4l: omap4iss: csi: " Laurent Pinchart
2013-12-04  0:56 ` [PATCH 15/25] v4l: omap4iss: resizer: Stop the whole resizer to avoid FIFO overflows Laurent Pinchart
2013-12-04  0:56 ` [PATCH 16/25] v4l: omap4iss: Convert hexadecimal constants to lower case Laurent Pinchart
2013-12-04  0:56 ` [PATCH 17/25] v4l: omap4iss: Add description field to iss_format_info structure Laurent Pinchart
2013-12-04  0:56 ` [PATCH 18/25] v4l: omap4iss: Make __iss_video_get_format() return a v4l2_mbus_framefmt Laurent Pinchart
2013-12-04  0:56 ` [PATCH 19/25] v4l: omap4iss: Add enum_fmt_vid_cap ioctl support Laurent Pinchart
2013-12-04  0:56 ` [PATCH 20/25] v4l: omap4iss: Propagate stop timeouts from submodules to the driver core Laurent Pinchart
2013-12-04  0:56 ` [PATCH 21/25] v4l: omap4iss: Enable/disabling the ISP interrupts globally Laurent Pinchart
2013-12-04  0:56 ` [PATCH 22/25] v4l: omap4iss: Reset the ISS when the pipeline can't be stopped Laurent Pinchart
2013-12-04  0:56 ` [PATCH 23/25] v4l: omap4iss: csi2: Replace manual if statement with a subclk field Laurent Pinchart
2013-12-04  0:56 ` [PATCH 24/25] v4l: omap4iss: Cancel streaming when a fatal error occurs Laurent Pinchart
2013-12-04  0:56 ` [PATCH 25/25] v4l: omap4iss: resizer: Fix comment regarding bypass mode Laurent Pinchart

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=1386118585-12449-10-git-send-email-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /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.