From: Bing Zhao <bzhao@marvell.com>
To: <linux-wireless@vger.kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
Daniel Drake <dsd@laptop.org>, Paul Fox <pgf@laptop.org>,
Tim Shepard <shep@laptop.org>, Jason Abele <jabele@chromium.org>,
John Rhodes <jrhodes@marvell.com>,
Amitkumar Karwar <akarwar@marvell.com>,
Avinash Patil <patila@marvell.com>,
Yogesh Ashok Powar <yogeshp@marvell.com>,
Nishant Sarmukadam <nishants@marvell.com>,
Frank Huang <frankh@marvell.com>, Bing Zhao <bzhao@marvell.com>
Subject: [PATCH 11/17] mwifiex: replace unnecessary u32 variables with u8 in sdio.c
Date: Mon, 13 May 2013 18:14:55 -0700 [thread overview]
Message-ID: <1368494101-23651-12-git-send-email-bzhao@marvell.com> (raw)
In-Reply-To: <1368494101-23651-1-git-send-email-bzhao@marvell.com>
From: Amitkumar Karwar <akarwar@marvell.com>
Some u32 variables in sdio.c are used to store/pass u8 values.
Replace them with u8 variables.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/sdio.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 022e9fd..e4357a6 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -294,13 +294,13 @@ static struct sdio_driver mwifiex_sdio = {
* This function writes data into SDIO card register.
*/
static int
-mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u32 data)
+mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u8 data)
{
struct sdio_mmc_card *card = adapter->card;
int ret = -1;
sdio_claim_host(card->func);
- sdio_writeb(card->func, (u8) data, reg, &ret);
+ sdio_writeb(card->func, data, reg, &ret);
sdio_release_host(card->func);
return ret;
@@ -310,7 +310,7 @@ mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u32 data)
* This function reads data from SDIO card register.
*/
static int
-mwifiex_read_reg(struct mwifiex_adapter *adapter, u32 reg, u32 *data)
+mwifiex_read_reg(struct mwifiex_adapter *adapter, u32 reg, u8 *data)
{
struct sdio_mmc_card *card = adapter->card;
int ret = -1;
@@ -421,7 +421,7 @@ static int mwifiex_pm_wakeup_card_complete(struct mwifiex_adapter *adapter)
*/
static int mwifiex_init_sdio_ioport(struct mwifiex_adapter *adapter)
{
- u32 reg;
+ u8 reg;
struct sdio_mmc_card *card = adapter->card;
adapter->ioport = 0;
@@ -580,7 +580,7 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
{
struct sdio_mmc_card *card = adapter->card;
u32 tries;
- u32 cs;
+ u8 cs;
for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
if (mwifiex_read_reg(adapter, card->reg->poll_reg, &cs))
@@ -604,7 +604,7 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat)
{
struct sdio_mmc_card *card = adapter->card;
const struct mwifiex_sdio_card_reg *reg = card->reg;
- u32 fws0, fws1;
+ u8 fws0, fws1;
if (mwifiex_read_reg(adapter, reg->status_reg_0, &fws0))
return -1;
@@ -625,14 +625,14 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat)
*/
static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter)
{
- u32 host_int_mask;
+ u8 host_int_mask, host_int_disable = HOST_INT_DISABLE;
/* Read back the host_int_mask register */
if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask))
return -1;
/* Update with the mask and write back to the register */
- host_int_mask &= ~HOST_INT_DISABLE;
+ host_int_mask &= ~host_int_disable;
if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG, host_int_mask)) {
dev_err(adapter->dev, "disable host interrupt failed\n");
@@ -712,7 +712,7 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
u8 *firmware = fw->fw_buf;
u32 firmware_len = fw->fw_len;
u32 offset = 0;
- u32 base0, base1;
+ u8 base0, base1;
u8 *fwbuf;
u16 len = 0;
u32 txlen, tx_blocks = 0, tries;
@@ -854,7 +854,7 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
int ret = 0;
u16 firmware_stat;
u32 tries;
- u32 winner_status;
+ u8 winner_status;
/* Wait for firmware initialization event */
for (tries = 0; tries < poll_num; tries++) {
@@ -889,7 +889,7 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
{
struct sdio_mmc_card *card = adapter->card;
- u32 sdio_ireg;
+ u8 sdio_ireg;
unsigned long flags;
if (mwifiex_read_data_sync(adapter, card->mp_regs,
@@ -1284,7 +1284,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
if (mwifiex_sdio_card_to_host_mp_aggr(adapter, skb,
port)) {
- u32 cr = 0;
+ u8 cr = 0;
dev_err(adapter->dev, "card_to_host_mpa failed:"
" int status=%#x\n", sdio_ireg);
@@ -1644,7 +1644,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
struct sdio_mmc_card *card = adapter->card;
const struct mwifiex_sdio_card_reg *reg = card->reg;
int ret;
- u32 sdio_ireg;
+ u8 sdio_ireg;
/*
* Read the HOST_INT_STATUS_REG for ACK the first interrupt got
--
1.8.2.3
next prev parent reply other threads:[~2013-05-14 1:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 1:14 [PATCH 00/17] mwifiex updates for 3.11 Bing Zhao
2013-05-14 1:14 ` [PATCH 01/17] mwifiex: rename mwifiex_free_adapter() routine in init.c Bing Zhao
2013-05-14 1:14 ` [PATCH 02/17] mwifiex: scan delay timer cleanup in unload path Bing Zhao
2013-05-14 1:14 ` [PATCH 03/17] mwifiex: remove global user_scan_cfg variable Bing Zhao
2013-05-14 1:14 ` [PATCH 04/17] mwifiex: abort remaining scan commands when association started Bing Zhao
2013-05-14 1:14 ` [PATCH 05/17] mwifiex: avoid deleting all stations during mwifiex_del_sta_entry() Bing Zhao
2013-05-14 1:14 ` [PATCH 06/17] mwifiex: add del_station handler Bing Zhao
2013-05-14 1:14 ` [PATCH 07/17] mwifiex: replace spin_lock_irqsave with spin_lock and fix warn_on Bing Zhao
2013-05-14 1:14 ` [PATCH 08/17] mwifiex: add calibration data download feature Bing Zhao
2013-05-14 1:14 ` [PATCH 09/17] mwifiex: use u32 variables for SDIO read/write port bitmap Bing Zhao
2013-05-14 1:14 ` [PATCH 10/17] mwifiex: store SDIO chip specific information in separate structure Bing Zhao
2013-05-14 1:14 ` Bing Zhao [this message]
2013-05-14 1:14 ` [PATCH 12/17] mwifiex: code rearrangement in mwifiex_get_rd_port() Bing Zhao
2013-05-14 1:14 ` [PATCH 13/17] mwifiex: do port calculations separately Bing Zhao
2013-05-14 1:14 ` [PATCH 14/17] mwifiex: define a macro for MPA base address Bing Zhao
2013-05-14 1:14 ` [PATCH 15/17] mwifiex: remove unnecessary macros in sdio.h Bing Zhao
2013-05-14 1:15 ` [PATCH 16/17] mwifiex: code rearrangement in multiport aggregation path Bing Zhao
2013-05-14 1:15 ` [PATCH 17/17] mwifiex: add support for Marvell SD8897 chipset Bing Zhao
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=1368494101-23651-12-git-send-email-bzhao@marvell.com \
--to=bzhao@marvell.com \
--cc=akarwar@marvell.com \
--cc=dsd@laptop.org \
--cc=frankh@marvell.com \
--cc=jabele@chromium.org \
--cc=jrhodes@marvell.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=nishants@marvell.com \
--cc=patila@marvell.com \
--cc=pgf@laptop.org \
--cc=shep@laptop.org \
--cc=yogeshp@marvell.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