All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	"Daniel W. S. Almeida" <dwlsalmeida@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: [PATCH RFC 06/11] media: vidtv: get rid of some endiannes nonsense
Date: Mon, 14 Sep 2020 11:03:21 +0200	[thread overview]
Message-ID: <47ccbcbd23e44159bbb11274b540d7c2bb66be7c.1600073975.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1600073975.git.mchehab+huawei@kernel.org>

Genmask is always highest order to low order. It doesn't make
any sense to make it depends on endiannes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/media/test-drivers/vidtv/vidtv_psi.c | 32 --------------------
 1 file changed, 32 deletions(-)

diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c
index 761034d10d9d..b8b638244b1d 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_psi.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c
@@ -99,11 +99,7 @@ static inline u16 vidtv_psi_sdt_serv_get_desc_loop_len(struct vidtv_psi_table_sd
 	u16 mask;
 	u16 ret;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(0, 11);
-	#else
 	mask = GENMASK(11, 0);
-	#endif
 
 	ret = be16_to_cpu(s->bitfield) & mask;
 	return ret;
@@ -114,11 +110,7 @@ static inline u16 vidtv_psi_pmt_stream_get_desc_loop_len(struct vidtv_psi_table_
 	u16 mask;
 	u16 ret;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(0, 9);
-	#else
 	mask = GENMASK(9, 0);
-	#endif
 
 	ret = be16_to_cpu(s->bitfield2) & mask;
 	return ret;
@@ -129,11 +121,7 @@ static inline u16 vidtv_psi_pmt_get_desc_loop_len(struct vidtv_psi_table_pmt *p)
 	u16 mask;
 	u16 ret;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(0, 9);
-	#else
 	mask = GENMASK(9, 0);
-	#endif
 
 	ret = be16_to_cpu(p->bitfield2) & mask;
 	return ret;
@@ -144,11 +132,7 @@ static inline u16 vidtv_psi_get_sec_len(struct vidtv_psi_table_header *h)
 	u16 mask;
 	u16 ret;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(0, 11);
-	#else
 	mask = GENMASK(11, 0);
-	#endif
 
 	ret = be16_to_cpu(h->bitfield) & mask;
 	return ret;
@@ -159,11 +143,7 @@ inline u16 vidtv_psi_get_pat_program_pid(struct vidtv_psi_table_pat_program *p)
 	u16 mask;
 	u16 ret;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(0, 12);
-	#else
 	mask = GENMASK(12, 0);
-	#endif
 
 	ret = be16_to_cpu(p->bitfield) & mask;
 	return ret;
@@ -174,11 +154,7 @@ inline u16 vidtv_psi_pmt_stream_get_elem_pid(struct vidtv_psi_table_pmt_stream *
 	u16 mask;
 	u16 ret;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(0, 12);
-	#else
 	mask = GENMASK(12, 0);
-	#endif
 
 	ret = be16_to_cpu(s->bitfield) & mask;
 	return ret;
@@ -189,11 +165,7 @@ static inline void vidtv_psi_set_desc_loop_len(__be16 *bitfield, u16 new_len, u8
 	u16 mask;
 	__be16 new;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(desc_len_nbits, 15);
-	#else
 	mask = GENMASK(15, desc_len_nbits);
-	#endif
 
 	new = cpu_to_be16((be16_to_cpu(*bitfield) & mask) | new_len);
 	*bitfield = new;
@@ -205,11 +177,7 @@ static void vidtv_psi_set_sec_len(struct vidtv_psi_table_header *h, u16 new_len)
 	__be16 new;
 	u16 mask;
 
-	#if defined(__BIG_ENDIAN)
-	mask = GENMASK(13, 15);
-	#else
 	mask = GENMASK(15, 13);
-	#endif
 
 	new = cpu_to_be16((be16_to_cpu(h->bitfield) & mask) | new_len);
 
-- 
2.26.2


  parent reply	other threads:[~2020-09-14  9:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  9:03 [PATCH RFC 00/11] Solve some issues and do some improvements at vidtv Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 01/11] media: vidtv: add modaliases for the bridge driver Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 02/11] media: vidtv: prefer using dev_foo() instead of pr_foo() Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 03/11] media: vidtv: fix 32-bit warnings Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 04/11] media: vidtv: fix frequency tuning logic Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 05/11] media: vidtv: add an initial channel frequency Mauro Carvalho Chehab
2020-09-14  9:03 ` Mauro Carvalho Chehab [this message]
2020-09-14 15:14   ` [PATCH RFC 06/11] media: vidtv: get rid of some endiannes nonsense Daniel W. S. Almeida
2020-09-15 11:49     ` Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 07/11] media: vidtv: remove a wrong endiannes check from s302m generator Mauro Carvalho Chehab
2020-09-16 18:13   ` kernel test robot
2020-09-16 18:13     ` kernel test robot
2020-09-14  9:03 ` [PATCH RFC 08/11] media: vidtv: properly initialize the internal state struct Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 09/11] media: vidtv: add basic support for DVBv5 stats Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 10/11] media: vidtv: get rid of the work queue Mauro Carvalho Chehab
2020-09-14  9:03 ` [PATCH RFC 11/11] media: vidtv: increment byte and block counters 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=47ccbcbd23e44159bbb11274b540d7c2bb66be7c.1600073975.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=dwlsalmeida@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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.