All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>
Subject: [PATCH 03/24] media: v4l2-mediabus: use BIT() macro for flags
Date: Mon,  9 Oct 2017 07:19:09 -0300	[thread overview]
Message-ID: <6a5f7e450dbb613e47bef21af9119bf09ef35762.1507544011.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1507544011.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1507544011.git.mchehab@s-opensource.com>

Instead of using (1 << n) for bits, use the BIT() macro,
as it makes them better documented.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 include/media/v4l2-mediabus.h | 50 ++++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 24 deletions(-)

diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 93f8afcb7a22..e5281e1086c4 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -12,6 +12,8 @@
 #define V4L2_MEDIABUS_H
 
 #include <linux/v4l2-mediabus.h>
+#include <linux/bitops.h>
+
 
 /* Parallel flags */
 /*
@@ -20,44 +22,44 @@
  * horizontal and vertical synchronisation. In "Slave mode" the host is
  * providing these signals to the slave.
  */
-#define V4L2_MBUS_MASTER			(1 << 0)
-#define V4L2_MBUS_SLAVE				(1 << 1)
+#define V4L2_MBUS_MASTER			BIT(0)
+#define V4L2_MBUS_SLAVE				BIT(1)
 /*
  * Signal polarity flags
  * Note: in BT.656 mode HSYNC, FIELD, and VSYNC are unused
  * V4L2_MBUS_[HV]SYNC* flags should be also used for specifying
  * configuration of hardware that uses [HV]REF signals
  */
-#define V4L2_MBUS_HSYNC_ACTIVE_HIGH		(1 << 2)
-#define V4L2_MBUS_HSYNC_ACTIVE_LOW		(1 << 3)
-#define V4L2_MBUS_VSYNC_ACTIVE_HIGH		(1 << 4)
-#define V4L2_MBUS_VSYNC_ACTIVE_LOW		(1 << 5)
-#define V4L2_MBUS_PCLK_SAMPLE_RISING		(1 << 6)
-#define V4L2_MBUS_PCLK_SAMPLE_FALLING		(1 << 7)
-#define V4L2_MBUS_DATA_ACTIVE_HIGH		(1 << 8)
-#define V4L2_MBUS_DATA_ACTIVE_LOW		(1 << 9)
+#define V4L2_MBUS_HSYNC_ACTIVE_HIGH		BIT(2)
+#define V4L2_MBUS_HSYNC_ACTIVE_LOW		BIT(3)
+#define V4L2_MBUS_VSYNC_ACTIVE_HIGH		BIT(4)
+#define V4L2_MBUS_VSYNC_ACTIVE_LOW		BIT(5)
+#define V4L2_MBUS_PCLK_SAMPLE_RISING		BIT(6)
+#define V4L2_MBUS_PCLK_SAMPLE_FALLING		BIT(7)
+#define V4L2_MBUS_DATA_ACTIVE_HIGH		BIT(8)
+#define V4L2_MBUS_DATA_ACTIVE_LOW		BIT(9)
 /* FIELD = 0/1 - Field1 (odd)/Field2 (even) */
-#define V4L2_MBUS_FIELD_EVEN_HIGH		(1 << 10)
+#define V4L2_MBUS_FIELD_EVEN_HIGH		BIT(10)
 /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
-#define V4L2_MBUS_FIELD_EVEN_LOW		(1 << 11)
+#define V4L2_MBUS_FIELD_EVEN_LOW		BIT(11)
 /* Active state of Sync-on-green (SoG) signal, 0/1 for LOW/HIGH respectively. */
-#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH	(1 << 12)
-#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW		(1 << 13)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH		BIT(12)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW		BIT(13)
 
 /* Serial flags */
 /* How many lanes the client can use */
-#define V4L2_MBUS_CSI2_1_LANE			(1 << 0)
-#define V4L2_MBUS_CSI2_2_LANE			(1 << 1)
-#define V4L2_MBUS_CSI2_3_LANE			(1 << 2)
-#define V4L2_MBUS_CSI2_4_LANE			(1 << 3)
+#define V4L2_MBUS_CSI2_1_LANE			BIT(0)
+#define V4L2_MBUS_CSI2_2_LANE			BIT(1)
+#define V4L2_MBUS_CSI2_3_LANE			BIT(2)
+#define V4L2_MBUS_CSI2_4_LANE			BIT(3)
 /* On which channels it can send video data */
-#define V4L2_MBUS_CSI2_CHANNEL_0		(1 << 4)
-#define V4L2_MBUS_CSI2_CHANNEL_1		(1 << 5)
-#define V4L2_MBUS_CSI2_CHANNEL_2		(1 << 6)
-#define V4L2_MBUS_CSI2_CHANNEL_3		(1 << 7)
+#define V4L2_MBUS_CSI2_CHANNEL_0		BIT(4)
+#define V4L2_MBUS_CSI2_CHANNEL_1		BIT(5)
+#define V4L2_MBUS_CSI2_CHANNEL_2		BIT(6)
+#define V4L2_MBUS_CSI2_CHANNEL_3		BIT(7)
 /* Does it support only continuous or also non-continuous clock mode */
-#define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK		(1 << 8)
-#define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	(1 << 9)
+#define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK		BIT(8)
+#define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	BIT(9)
 
 #define V4L2_MBUS_CSI2_LANES		(V4L2_MBUS_CSI2_1_LANE | V4L2_MBUS_CSI2_2_LANE | \
 					 V4L2_MBUS_CSI2_3_LANE | V4L2_MBUS_CSI2_4_LANE)
-- 
2.13.6

  parent reply	other threads:[~2017-10-09 10:19 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 10:19 [PATCH 00/24] V4L2 kAPI cleanups and documentation improvements part 2 Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 01/24] media: v4l2-dev.h: add kernel-doc to two macros Mauro Carvalho Chehab
2017-10-09 11:14   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 02/24] media: v4l2-flash-led-class.h: add kernel-doc to two ancillary funcs Mauro Carvalho Chehab
2017-10-09 11:15   ` Sakari Ailus
2017-10-09 10:19 ` Mauro Carvalho Chehab [this message]
2017-10-09 11:16   ` [PATCH 03/24] media: v4l2-mediabus: use BIT() macro for flags Sakari Ailus
2017-10-09 10:19 ` [PATCH 04/24] media: v4l2-mediabus: convert flags to enums and document them Mauro Carvalho Chehab
2017-10-09 10:56   ` Hans Verkuil
2017-10-11 21:26   ` Pavel Machek
2017-12-18 18:43     ` Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 05/24] media: v4l2-dev: convert VFL_TYPE_* into an enum Mauro Carvalho Chehab
2017-10-09 10:59   ` Hans Verkuil
2017-10-09 13:38   ` Mike Isely
2017-10-10 20:47   ` Andrey Utkin
2017-12-18 16:48     ` Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 06/24] media: i2c-addr.h: get rid of now unused defines Mauro Carvalho Chehab
2017-10-09 10:59   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 07/24] media: get rid of i2c-addr.h Mauro Carvalho Chehab
2017-10-09 11:00   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 08/24] media: v4l2-dev: document VFL_DIR_* direction defines Mauro Carvalho Chehab
2017-10-09 11:00   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 09/24] media: v4l2-dev: document video_device flags Mauro Carvalho Chehab
2017-10-09 11:02   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 10/24] media: v4l2-subdev: use kernel-doc markups to document subdev flags Mauro Carvalho Chehab
2017-10-09 20:24   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 11/24] media: v4l2-subdev: create cross-references for ioctls Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 12/24] media: v4l2-subdev: fix description of tuner.s_radio ops Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 13/24] media: v4l2-subdev: better document IO pin configuration flags Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 14/24] media: v4l2-subdev: convert frame description to enum Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 15/24] media: v4l2-subdev: get rid of __V4L2_SUBDEV_MK_GET_TRY() macro Mauro Carvalho Chehab
2017-10-09 20:23   ` Sakari Ailus
2017-12-18 19:27     ` Mauro Carvalho Chehab
2017-12-19  8:24       ` Sakari Ailus
2017-12-19 11:03         ` Mauro Carvalho Chehab
2017-12-19 11:56           ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 16/24] media: v4l2-subdev: document remaining undocumented functions Mauro Carvalho Chehab
2017-10-09 20:45   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 17/24] media: v4l2-subdev: fix a typo Mauro Carvalho Chehab
2017-10-09 20:26   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 18/24] media: vb2-core: use bitops for bits Mauro Carvalho Chehab
2017-10-10 14:01   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 19/24] media: vb2-core: Improve kernel-doc markups Mauro Carvalho Chehab
2017-10-10 13:32   ` Sakari Ailus
2017-12-18 17:20     ` Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 20/24] media: vb2-core: document remaining functions Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 21/24] media: vb2-core: fix descriptions for VB2-only functions Mauro Carvalho Chehab
2017-10-10 13:49   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 22/24] media: vb2: add cross references at memops and v4l2 kernel-doc markups Mauro Carvalho Chehab
2017-10-10 13:51   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 23/24] media: v4l2-tpg*.h: move headers to include/media/tpg and merge them Mauro Carvalho Chehab
2017-10-09 10:28   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 24/24] media: v4l2-tpg.h: rename color structs Mauro Carvalho Chehab
2017-10-09 10:29   ` Hans Verkuil
2017-10-09 12:35 ` [PATCH 00/24] V4L2 kAPI cleanups and documentation improvements part 2 Mauro Carvalho Chehab
2017-12-18 17:30 ` Mauro Carvalho Chehab

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=6a5f7e450dbb613e47bef21af9119bf09ef35762.1507544011.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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.