linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-media@vger.kernel.org
Subject: [PATCH 3/8] remove unused ARRAY_SIZE
Date: Wed, 21 Apr 2021 00:20:30 -0700	[thread overview]
Message-ID: <20210421072035.4188497-3-rosenp@gmail.com> (raw)
In-Reply-To: <20210421072035.4188497-1-rosenp@gmail.com>

This is a C construct that is not really needed in C++.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/cec-compliance/cec-compliance.h | 3 ---
 utils/cec-ctl/cec-pin.cpp             | 2 --
 utils/cec-follower/cec-follower.h     | 3 ---
 utils/cec-follower/cec-processing.cpp | 3 ---
 utils/rds-ctl/rds-ctl.cpp             | 2 --
 5 files changed, 13 deletions(-)

diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 26c70c216..c558f043b 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -191,9 +191,6 @@ using vec_remote_subtests = std::vector<remote_subtest>;
 
 #define CEC_LOG_ADDR_MASK_ALL 0xffff
 
-#define ARRAY_SIZE(a) \
-	(sizeof(a) / sizeof(*a))
-
 #define COLOR_GREEN(s) "\033[32m" s "\033[0m"
 #define COLOR_RED(s) "\033[1;31m" s "\033[0m"
 #define COLOR_BOLD(s) "\033[1m" s "\033[0m"
diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
index f9ecac7fb..30e5accf5 100644
--- a/utils/cec-ctl/cec-pin.cpp
+++ b/utils/cec-ctl/cec-pin.cpp
@@ -17,8 +17,6 @@
 #include "cec-ctl.h"
 #include "cec-log.h"
 
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
 static std::string find_opcode_name(__u8 opcode)
 {
 	const char *name = cec_opcode2s(opcode);
diff --git a/utils/cec-follower/cec-follower.h b/utils/cec-follower/cec-follower.h
index 5b67a260f..7806a4b64 100644
--- a/utils/cec-follower/cec-follower.h
+++ b/utils/cec-follower/cec-follower.h
@@ -20,9 +20,6 @@
 #include <cec-info.h>
 #include <cec-log.h>
 
-#define ARRAY_SIZE(a) \
-	(sizeof(a) / sizeof(*a))
-
 extern bool show_info;
 extern bool show_msgs;
 extern bool show_state;
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 83ffcc30b..024407471 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -29,9 +29,6 @@
 /* Time between each polling message sent to a device */
 #define POLL_PERIOD 15000
 
-#define ARRAY_SIZE(a) \
-	(sizeof(a) / sizeof(*a))
-
 struct cec_enum_values {
 	const char *type_name;
 	__u8 value;
diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index e27182821..8161aa453 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -27,8 +27,6 @@
 #include <linux/videodev2.h>
 #include <libv4l2rds.h>
 
-#define ARRAY_SIZE(arr) ((int)(sizeof(arr) / sizeof((arr)[0])))
-
 using dev_vec = std::vector<std::string>;
 using dev_map = std::map<std::string, std::string>;
 
-- 
2.30.2


  parent reply	other threads:[~2021-04-21  7:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  7:20 [PATCH 1/8] clang-tidy: use auto Rosen Penev
2021-04-21  7:20 ` [PATCH 2/8] clang-tidy: use nullptr Rosen Penev
2021-04-21  7:20 ` Rosen Penev [this message]
2021-04-21  7:20 ` [PATCH 4/8] cec-tuner: std::array conversions Rosen Penev
2021-04-21  7:20 ` [PATCH 5/8] v4l2-info: remove a strange sizeof usage Rosen Penev
2021-04-21  8:23   ` Hans Verkuil
2021-04-21  9:19     ` Rosen Penev
2021-04-21  9:33       ` Hans Verkuil
2021-04-21  9:39         ` Rosen Penev
2021-04-21 16:01         ` Nicolas Dufresne
2021-04-21  7:20 ` [PATCH 6/8] v4l2-utils: turn fb_formats to constexpr array Rosen Penev
2021-04-21  7:20 ` [PATCH 7/8] v4l2-utils: turn mbus_names into const vector Rosen Penev
2021-04-21  8:02   ` Hans Verkuil
2021-04-21  9:25     ` Rosen Penev
2021-04-21  7:20 ` [PATCH 8/8] v4l2-utils: turn prefixes to a constexpr array Rosen Penev
2021-04-21  8:06   ` Hans Verkuil
2021-04-21  9:23     ` Rosen Penev

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=20210421072035.4188497-3-rosenp@gmail.com \
    --to=rosenp@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).