Linux kernel staging patches
 help / color / mirror / Atom feed
From: Abhinav Jain <jain.abhinav177@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com,
	jain.abhinav177@gmail.com
Subject: [PATCH] staging: rtl8723bs: Align address to 4-byte boundary
Date: Fri, 14 Jun 2024 22:42:56 +0000	[thread overview]
Message-ID: <20240614224256.43131-1-jain.abhinav177@gmail.com> (raw)

Add address alignment in sdio_local_read, _sdio_local_read &
sdio_local_write functions as per the TODO.

Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
---
 drivers/staging/rtl8723bs/hal/sdio_ops.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index 107f427ee4aa..caee2d2043b3 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -478,9 +478,6 @@ void sdio_set_intf_ops(struct adapter *adapter, struct _io_ops *ops)
 	ops->_write_port = &sdio_write_port;
 }
 
-/*
- * Todo: align address to 4 bytes.
- */
 static s32 _sdio_local_read(
 	struct adapter *adapter,
 	u32 addr,
@@ -494,6 +491,7 @@ static s32 _sdio_local_read(
 	u8 *tmpbuf;
 	u32 n;
 
+	addr = addr & ~3;
 	intfhdl = &adapter->iopriv.intf;
 
 	hal_sdio_get_cmd_addr_8723b(adapter, SDIO_LOCAL_DEVICE_ID, addr, &addr);
@@ -516,9 +514,6 @@ static s32 _sdio_local_read(
 	return err;
 }
 
-/*
- * Todo: align address to 4 bytes.
- */
 s32 sdio_local_read(
 	struct adapter *adapter,
 	u32 addr,
@@ -532,6 +527,7 @@ s32 sdio_local_read(
 	u8 *tmpbuf;
 	u32 n;
 
+	addr = addr & ~3;
 	intfhdl = &adapter->iopriv.intf;
 
 	hal_sdio_get_cmd_addr_8723b(adapter, SDIO_LOCAL_DEVICE_ID, addr, &addr);
@@ -557,9 +553,6 @@ s32 sdio_local_read(
 	return err;
 }
 
-/*
- * Todo: align address to 4 bytes.
- */
 s32 sdio_local_write(
 	struct adapter *adapter,
 	u32 addr,
@@ -572,6 +565,7 @@ s32 sdio_local_write(
 	s32 err;
 	u8 *tmpbuf;
 
+	addr = addr & ~3;
 	intfhdl = &adapter->iopriv.intf;
 
 	hal_sdio_get_cmd_addr_8723b(adapter, SDIO_LOCAL_DEVICE_ID, addr, &addr);
-- 
2.34.1


             reply	other threads:[~2024-06-14 22:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 22:42 Abhinav Jain [this message]
2024-06-15 18:05 ` [PATCH] staging: rtl8723bs: Align address to 4-byte boundary Nam Cao
2024-06-24 13:17 ` Greg KH

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=20240614224256.43131-1-jain.abhinav177@gmail.com \
    --to=jain.abhinav177@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=skhan@linuxfoundation.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