From: "Adrian Barnaś" <abarnas@google.com>
To: Hans de Goede <hansg@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dan Carpenter <dan.carpenter@linaro.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev
Cc: "Adrian Barnaś" <abarnas@google.com>
Subject: [PATCH v2 1/3] staging: media: atomisp: Remove typedefs for basic types in vmem.c
Date: Tue, 2 Sep 2025 07:18:45 +0000 [thread overview]
Message-ID: <20250902071847.2330409-2-abarnas@google.com> (raw)
In-Reply-To: <20250902071847.2330409-1-abarnas@google.com>
Cleared typedefs hiding unsigned long long type, to align with
kernel coding style.
Signed-off-by: Adrian Barnaś <abarnas@google.com>
---
.../pci/hive_isp_css_common/host/vmem.c | 42 +++++++++----------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/vmem.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/vmem.c
index 722b684fbc37..fd640e100591 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/vmem.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/vmem.c
@@ -13,35 +13,33 @@
#endif
#include "assert_support.h"
-typedef unsigned long long hive_uedge;
-typedef hive_uedge *hive_wide;
/* Copied from SDK: sim_semantics.c */
/* subword bits move like this: MSB[____xxxx____]LSB -> MSB[00000000xxxx]LSB */
-static inline hive_uedge
-subword(hive_uedge w, unsigned int start, unsigned int end)
+static inline unsigned long long
+subword(unsigned long long w, unsigned int start, unsigned int end)
{
return (w & (((1ULL << (end - 1)) - 1) << 1 | 1)) >> start;
}
/* inverse subword bits move like this: MSB[xxxx____xxxx]LSB -> MSB[xxxx0000xxxx]LSB */
-static inline hive_uedge
-inv_subword(hive_uedge w, unsigned int start, unsigned int end)
+static inline unsigned long long
+inv_subword(unsigned long long w, unsigned int start, unsigned int end)
{
return w & (~(((1ULL << (end - 1)) - 1) << 1 | 1) | ((1ULL << start) - 1));
}
-#define uedge_bits (8 * sizeof(hive_uedge))
+#define uedge_bits (8 * sizeof(unsigned long long))
#define move_lower_bits(target, target_bit, src, src_bit) move_subword(target, target_bit, src, 0, src_bit)
#define move_upper_bits(target, target_bit, src, src_bit) move_subword(target, target_bit, src, src_bit, uedge_bits)
#define move_word(target, target_bit, src) move_subword(target, target_bit, src, 0, uedge_bits)
static void
move_subword(
- hive_uedge *target,
+ unsigned long long *target,
unsigned int target_bit,
- hive_uedge src,
+ unsigned long long src,
unsigned int src_start,
unsigned int src_end)
{
@@ -49,18 +47,18 @@ move_subword(
unsigned int start_bit = target_bit % uedge_bits;
unsigned int subword_width = src_end - src_start;
- hive_uedge src_subword = subword(src, src_start, src_end);
+ unsigned long long src_subword = subword(src, src_start, src_end);
if (subword_width + start_bit > uedge_bits) { /* overlap */
- hive_uedge old_val1;
- hive_uedge old_val0 = inv_subword(target[start_elem], start_bit, uedge_bits);
+ unsigned long long old_val1;
+ unsigned long long old_val0 = inv_subword(target[start_elem], start_bit, uedge_bits);
target[start_elem] = old_val0 | (src_subword << start_bit);
old_val1 = inv_subword(target[start_elem + 1], 0,
subword_width + start_bit - uedge_bits);
target[start_elem + 1] = old_val1 | (src_subword >> (uedge_bits - start_bit));
} else {
- hive_uedge old_val = inv_subword(target[start_elem], start_bit,
+ unsigned long long old_val = inv_subword(target[start_elem], start_bit,
start_bit + subword_width);
target[start_elem] = old_val | (src_subword << start_bit);
@@ -69,8 +67,8 @@ move_subword(
static void
hive_sim_wide_unpack(
- hive_wide vector,
- hive_wide elem,
+ unsigned long long *vector,
+ unsigned long long *elem,
hive_uint elem_bits,
hive_uint index)
{
@@ -103,8 +101,8 @@ hive_sim_wide_unpack(
static void
hive_sim_wide_pack(
- hive_wide vector,
- hive_wide elem,
+ unsigned long long *vector,
+ unsigned long long *elem,
hive_uint elem_bits,
hive_uint index)
{
@@ -136,7 +134,7 @@ static void load_vector(
const t_vmem_elem *from)
{
unsigned int i;
- hive_uedge *data;
+ unsigned long long *data;
unsigned int size = sizeof(short) * ISP_NWAY;
VMEM_ARRAY(v, 2 * ISP_NWAY); /* Need 2 vectors to work around vmem hss bug */
@@ -146,9 +144,9 @@ static void load_vector(
#else
hrt_master_port_load(ISP_BAMEM_BASE[ID] + (unsigned long)from, &v[0][0], size);
#endif
- data = (hive_uedge *)v;
+ data = (unsigned long long *)v;
for (i = 0; i < ISP_NWAY; i++) {
- hive_uedge elem = 0;
+ unsigned long long elem = 0;
hive_sim_wide_unpack(data, &elem, ISP_VEC_ELEMBITS, i);
to[i] = elem;
@@ -166,10 +164,10 @@ static void store_vector(
VMEM_ARRAY(v, 2 * ISP_NWAY); /* Need 2 vectors to work around vmem hss bug */
//load_vector (&v[1][0], &to[ISP_NWAY]); /* Fetch the next vector, since it will be overwritten. */
- hive_uedge *data = (hive_uedge *)v;
+ unsigned long long *data = (unsigned long long *)v;
for (i = 0; i < ISP_NWAY; i++) {
- hive_sim_wide_pack(data, (hive_wide)&from[i], ISP_VEC_ELEMBITS, i);
+ hive_sim_wide_pack(data, (unsigned long long *)&from[i], ISP_VEC_ELEMBITS, i);
}
assert(ISP_BAMEM_BASE[ID] != (hrt_address) - 1);
#if !defined(HRT_MEMORY_ACCESS)
--
2.51.0.318.gd7df087d1a-goog
next prev parent reply other threads:[~2025-09-02 7:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 7:18 [PATCH v2 0/3] staging: media: atomisp: Style fixes for vmem.c Adrian Barnaś
2025-09-02 7:18 ` Adrian Barnaś [this message]
2025-09-02 7:18 ` [PATCH v2 2/3] staging: media: atomisp: Whitespaces cleanup in vmem.c Adrian Barnaś
2025-09-02 7:18 ` [PATCH v2 3/3] staging: media: atomisp: Remove trailing comments Adrian Barnaś
2025-09-02 15:31 ` Andy Shevchenko
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=20250902071847.2330409-2-abarnas@google.com \
--to=abarnas@google.com \
--cc=andy@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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 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.