Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org
Cc: tiwai@suse.com, perex@perex.cz, amade@asmblr.net,
	linux-sound@vger.kernel.org, andriy.shevchenko@linux.intel.com,
	Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 6/8] ASoC: Intel: catpt: Streamline wording of offset variables
Date: Wed, 29 Jul 2026 13:00:55 +0200	[thread overview]
Message-ID: <20260729110057.342447-7-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20260729110057.342447-1-cezary.rojewski@intel.com>

Two words represent is currently: 'offset' and 'off'. Be cohesive and
use one instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/catpt/loader.c | 48 ++++++++++++++++------------------
 1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/sound/soc/intel/catpt/loader.c b/sound/soc/intel/catpt/loader.c
index 274af8fb8828..e7ba9e1e60ae 100644
--- a/sound/soc/intel/catpt/loader.c
+++ b/sound/soc/intel/catpt/loader.c
@@ -359,7 +359,7 @@ static int catpt_restore_basefw(struct catpt_dev *cdev,
 				struct dma_chan *chan, dma_addr_t paddr,
 				struct catpt_fw_module_hdr *basefw)
 {
-	u32 offset = sizeof(*basefw);
+	u32 off = sizeof(*basefw);
 	int ret, i;
 
 	print_hex_dump_debug(__func__, DUMP_PREFIX_OFFSET, 8, 4,
@@ -369,16 +369,14 @@ static int catpt_restore_basefw(struct catpt_dev *cdev,
 	for (i = 0; i < basefw->blocks; i++) {
 		struct catpt_fw_block_hdr *blk;
 
-		blk = (struct catpt_fw_block_hdr *)((u8 *)basefw + offset);
+		blk = (struct catpt_fw_block_hdr *)((u8 *)basefw + off);
 
 		switch (blk->ram_type) {
 		case CATPT_RAM_TYPE_IRAM:
-			ret = catpt_load_block(cdev, chan, paddr + offset,
-					       blk, false);
+			ret = catpt_load_block(cdev, chan, paddr + off, blk, false);
 			break;
 		default:
-			ret = catpt_restore_dram_rodata(cdev, chan, paddr + offset,
-							blk);
+			ret = catpt_restore_dram_rodata(cdev, chan, paddr + off, blk);
 			break;
 		}
 
@@ -387,7 +385,7 @@ static int catpt_restore_basefw(struct catpt_dev *cdev,
 			return ret;
 		}
 
-		offset += sizeof(*blk) + blk->size;
+		off += sizeof(*blk) + blk->size;
 	}
 
 	/* Then proceed with DRAM .data saved before D3. */
@@ -402,7 +400,7 @@ static int catpt_restore_module(struct catpt_dev *cdev,
 				struct dma_chan *chan, dma_addr_t paddr,
 				struct catpt_fw_module_hdr *mod)
 {
-	u32 offset = sizeof(*mod);
+	u32 off = sizeof(*mod);
 	int i;
 
 	print_hex_dump_debug(__func__, DUMP_PREFIX_OFFSET, 8, 4,
@@ -412,7 +410,7 @@ static int catpt_restore_module(struct catpt_dev *cdev,
 		struct catpt_fw_block_hdr *blk;
 		int ret;
 
-		blk = (struct catpt_fw_block_hdr *)((u8 *)mod + offset);
+		blk = (struct catpt_fw_block_hdr *)((u8 *)mod + off);
 
 		switch (blk->ram_type) {
 		case CATPT_RAM_TYPE_INSTANCE:
@@ -423,7 +421,7 @@ static int catpt_restore_module(struct catpt_dev *cdev,
 					ALIGN(blk->size, 4));
 			break;
 		default:
-			ret = catpt_load_block(cdev, chan, paddr + offset,
+			ret = catpt_load_block(cdev, chan, paddr + off,
 					       blk, false);
 			break;
 		}
@@ -433,7 +431,7 @@ static int catpt_restore_module(struct catpt_dev *cdev,
 			return ret;
 		}
 
-		offset += sizeof(*blk) + blk->size;
+		off += sizeof(*blk) + blk->size;
 	}
 
 	return 0;
@@ -444,7 +442,7 @@ static int catpt_load_module(struct catpt_dev *cdev,
 			     struct catpt_fw_module_hdr *mod)
 {
 	struct catpt_module_type *type;
-	u32 offset = sizeof(*mod);
+	u32 off = sizeof(*mod);
 	int i;
 
 	print_hex_dump_debug(__func__, DUMP_PREFIX_OFFSET, 8, 4,
@@ -456,9 +454,9 @@ static int catpt_load_module(struct catpt_dev *cdev,
 		struct catpt_fw_block_hdr *blk;
 		int ret;
 
-		blk = (struct catpt_fw_block_hdr *)((u8 *)mod + offset);
+		blk = (struct catpt_fw_block_hdr *)((u8 *)mod + off);
 
-		ret = catpt_load_block(cdev, chan, paddr + offset, blk, true);
+		ret = catpt_load_block(cdev, chan, paddr + off, blk, true);
 		if (ret) {
 			dev_err(cdev->dev, "load block failed: %d\n", ret);
 			return ret;
@@ -473,7 +471,7 @@ static int catpt_load_module(struct catpt_dev *cdev,
 			type->state_size = blk->size;
 		}
 
-		offset += sizeof(*blk) + blk->size;
+		off += sizeof(*blk) + blk->size;
 	}
 
 	/* init module type static info */
@@ -490,7 +488,7 @@ static int catpt_restore_firmware(struct catpt_dev *cdev,
 				  struct dma_chan *chan, dma_addr_t paddr,
 				  struct catpt_fw_hdr *fw)
 {
-	u32 offset = sizeof(*fw);
+	u32 off = sizeof(*fw);
 	int i;
 
 	print_hex_dump_debug(__func__, DUMP_PREFIX_OFFSET, 8, 4,
@@ -500,7 +498,7 @@ static int catpt_restore_firmware(struct catpt_dev *cdev,
 		struct catpt_fw_module_hdr *mod;
 		int ret;
 
-		mod = (struct catpt_fw_module_hdr *)((u8 *)fw + offset);
+		mod = (struct catpt_fw_module_hdr *)((u8 *)fw + off);
 		if (strncmp(fw->signature, mod->signature,
 			    FW_SIGNATURE_SIZE)) {
 			dev_err(cdev->dev, "module signature mismatch\n");
@@ -512,12 +510,10 @@ static int catpt_restore_firmware(struct catpt_dev *cdev,
 
 		switch (mod->module_id) {
 		case CATPT_MODID_BASE_FW:
-			ret = catpt_restore_basefw(cdev, chan, paddr + offset,
-						   mod);
+			ret = catpt_restore_basefw(cdev, chan, paddr + off, mod);
 			break;
 		default:
-			ret = catpt_restore_module(cdev, chan, paddr + offset,
-						   mod);
+			ret = catpt_restore_module(cdev, chan, paddr + off, mod);
 			break;
 		}
 
@@ -526,7 +522,7 @@ static int catpt_restore_firmware(struct catpt_dev *cdev,
 			return ret;
 		}
 
-		offset += sizeof(*mod) + mod->mod_size;
+		off += sizeof(*mod) + mod->mod_size;
 	}
 
 	return 0;
@@ -536,7 +532,7 @@ static int catpt_load_firmware(struct catpt_dev *cdev,
 			       struct dma_chan *chan, dma_addr_t paddr,
 			       struct catpt_fw_hdr *fw)
 {
-	u32 offset = sizeof(*fw);
+	u32 off = sizeof(*fw);
 	int i;
 
 	print_hex_dump_debug(__func__, DUMP_PREFIX_OFFSET, 8, 4,
@@ -546,7 +542,7 @@ static int catpt_load_firmware(struct catpt_dev *cdev,
 		struct catpt_fw_module_hdr *mod;
 		int ret;
 
-		mod = (struct catpt_fw_module_hdr *)((u8 *)fw + offset);
+		mod = (struct catpt_fw_module_hdr *)((u8 *)fw + off);
 		if (strncmp(fw->signature, mod->signature,
 			    FW_SIGNATURE_SIZE)) {
 			dev_err(cdev->dev, "module signature mismatch\n");
@@ -556,13 +552,13 @@ static int catpt_load_firmware(struct catpt_dev *cdev,
 		if (mod->module_id > CATPT_MODID_LAST)
 			return -EINVAL;
 
-		ret = catpt_load_module(cdev, chan, paddr + offset, mod);
+		ret = catpt_load_module(cdev, chan, paddr + off, mod);
 		if (ret) {
 			dev_err(cdev->dev, "load module failed: %d\n", ret);
 			return ret;
 		}
 
-		offset += sizeof(*mod) + mod->mod_size;
+		off += sizeof(*mod) + mod->mod_size;
 	}
 
 	return 0;
-- 
2.34.1


  parent reply	other threads:[~2026-07-29 10:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 11:00 [PATCH 0/8] ASoC: Intel: catpt: Code cleanup and renames Cezary Rojewski
2026-07-29 11:00 ` [PATCH 1/8] ASoC: Intel: catpt: Wrap the store firmware-context procedure Cezary Rojewski
2026-07-29 11:00 ` [PATCH 2/8] ASoC: Intel: catpt: Drop redundant else-if Cezary Rojewski
2026-07-29 11:00 ` [PATCH 3/8] ASoC: Intel: catpt: Drop redundant signature argument Cezary Rojewski
2026-07-29 11:00 ` [PATCH 4/8] ASoC: Intel: catpt: Rename module header struct Cezary Rojewski
2026-07-29 11:00 ` [PATCH 5/8] ASoC: Intel: catpt: Rename firmware loading functions Cezary Rojewski
2026-07-29 11:00 ` Cezary Rojewski [this message]
2026-07-29 11:00 ` [PATCH 7/8] ASoC: Intel: catpt: Streamline runtime-variables naming Cezary Rojewski
2026-07-29 11:00 ` [PATCH 8/8] ASoC: Intel: catpt: Streamline control-variables naming Cezary Rojewski
2026-07-30 21:31 ` [PATCH 0/8] ASoC: Intel: catpt: Code cleanup and renames Mark Brown

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=20260729110057.342447-7-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=amade@asmblr.net \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox