Skip to contentSkip to conversation

staging: dgap: pass "brd" as a paramter to dgap_after_config_loaded()

PATCH Superseded Daeseok Youn 2 participants 3 messages Jun 3, 2014 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 staging: dgap: pass "brd" as a paramter to dgap_after_config_loaded()

Pass "brd" to dgap_after_config_loaded() instead of passing "dgap_numboards" and looking up brd again.

---
 drivers/staging/dgap/dgap.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/staging/dgap/dgap.c +5 -3
index 9501a5e..7a07a9b 100644
@@ -187,7 +187,7 @@ static void dgap_do_fep_load(struct board_t *brd, const u8 *ufep, int len);
 #ifdef DIGI_CONCENTRATORS_SUPPORTED
 static void dgap_do_conc_load(struct board_t *brd, u8 *uaddr, int len);
 #endif
-static int dgap_after_config_loaded(int board);
+static int dgap_after_config_loaded(struct board_t *brd);
 static int dgap_finalize_board_init(struct board_t *brd);
 
 static void dgap_get_vpd(struct board_t *brd);
@@ -859,7 +859,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
 		kfree(dgap_config_buf);
 	}
 
-	ret = dgap_after_config_loaded(brd->boardnum);
+	ret = dgap_after_config_loaded(brd);
 	if (ret)
 		return ret;
 	/*
@@ -4113,8 +4113,10 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 	}
 }
 
-static int dgap_after_config_loaded(int board)
+static int dgap_after_config_loaded(struct board_t *brd)
 {
+	int board = brd->boardnum;
+
 	/*
 	 * Initialize KME waitqueues...
 	 */
Signature · 1 line
1.7.1
#1 lore raw

drivers/staging/dgap/dgap.c static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, · line 4119

Quoted 5 lines · Daeseok Youn
drivers/staging/dgap/dgap.c +3 -1
-static int dgap_after_config_loaded(int board)
+static int dgap_after_config_loaded(struct board_t *brd)
 {
+	int board = brd->boardnum;
+

We don't need to use "board" in this function. We can replaced "dgap_board[board]->" with "brd->"

drivers/staging/dgap/dgap.c static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, · line 4122

Quoted 3 lines
drivers/staging/dgap/dgap.c +0 -0
 	/*
 	 * Initialize KME waitqueues...
 	 */

regards,
dan carpenter

#2 lore raw

2014-06-03 16:22 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 9 lines · Daeseok Youn

drivers/staging/dgap/dgap.c static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, · line 4119

Quoted 5 lines
drivers/staging/dgap/dgap.c +3 -1
-static int dgap_after_config_loaded(int board)
+static int dgap_after_config_loaded(struct board_t *brd)
 {
+     int board = brd->boardnum;
+

We don't need to use "board" in this function. We can replaced "dgap_board[board]->" with "brd->"

OK. I will fix as your comment and resend.
Thanks

regards,
Daeseok Youn.

Quoted 8 lines
Quoted 4 lines
      /*
       * Initialize KME waitqueues...
       */

regards,
dan carpenter