linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Franky Lin <frankyl@broadcom.com>
Cc: gregkh@suse.de, devel@linuxdriverproject.org,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero
Date: Mon, 19 Sep 2011 17:59:32 -0700	[thread overview]
Message-ID: <1316480372.30319.1.camel@Joe-Laptop> (raw)
In-Reply-To: <1316477060.27998.4.camel@Joe-Laptop>

On Mon, 2011-09-19 at 17:04 -0700, Joe Perches wrote:
> It'd be better if you could find some way
> to reduce the 6 tab indentation rather than
> split 20 char format strings into pieces.

Perhaps something like this:

 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |  112 ++++++++++-----------
 1 files changed, 54 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index a15765b..ccba1ce 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -240,6 +240,53 @@ brcmf_sdioh_cis_read(struct brcmf_sdio_dev *sdiodev, uint func,
 	return 0;
 }
 
+static void
+brcmf_sdioh_request_byte_func0(struct brcmf_sdio_dev *sdiodev, uint rw,
+			       uint func, uint regaddr, u8 *byte, int *err_ret)
+{
+	/* Can only directly write to some F0 registers.
+	 * Handle F2 enable as a special case.
+	 */
+	if (regaddr == SDIO_CCCR_IOEx) {
+		if (sdiodev->func[2]) {
+			sdio_claim_host(sdiodev->func[2]);
+			if (*byte & SDIO_FUNC_ENABLE_2) {
+				/* Enable Function 2 */
+				*err_ret = sdio_enable_func(sdiodev->func[2]);
+				if (*err_ret)
+					brcmf_dbg(ERROR,
+						  "enable F2 failed:%d\n",
+						  *err_ret);
+			} else {
+				/* Disable Function 2 */
+				*err_ret = sdio_disable_func(sdiodev->func[2]);
+				if (*err_ret)
+					brcmf_dbg(ERROR,
+						  "Disable F2 failed:%d\n",
+						  *err_ret);
+			}
+			sdio_release_host(sdiodev->func[2]);
+		}
+	} else if (regaddr == SDIO_CCCR_ABORT) {
+		/* to allow abort command through F1 */
+		sdio_claim_host(sdiodev->func[func]);
+		/*
+		 * this sdio_f0_writeb() can be replaced with another api
+		 * depending upon MMC driver change.
+		 * As of this time, this is temporary one
+		 */
+		sdio_writeb(sdiodev->func[func], *byte, regaddr, err_ret);
+		sdio_release_host(sdiodev->func[func]);
+	} else if (regaddr < 0xF0) {
+		brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
+	} else {
+		/* Claim host controller, perform F0 write, and release */
+		sdio_claim_host(sdiodev->func[func]);
+		sdio_f0_writeb(sdiodev->func[func], *byte, regaddr, err_ret);
+		sdio_release_host(sdiodev->func[func]);
+	}
+}
+
 extern int
 brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 			 uint regaddr, u8 *byte)
@@ -252,58 +299,9 @@ brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 	BRCMF_PM_RESUME_RETURN_ERROR(-EIO, sdiodev);
 	if (rw) {		/* CMD52 Write */
 		if (func == 0) {
-			/* Can only directly write to some F0 registers.
-			 * Handle F2 enable
-			 * as a special case.
-			 */
-			if (regaddr == SDIO_CCCR_IOEx) {
-				if (sdiodev->func[2]) {
-					sdio_claim_host(sdiodev->func[2]);
-					if (*byte & SDIO_FUNC_ENABLE_2) {
-						/* Enable Function 2 */
-						err_ret =
-						    sdio_enable_func
-						    (sdiodev->func[2]);
-						if (err_ret)
-							brcmf_dbg(ERROR,
-								  "enable F2 failed:%d\n",
-								  err_ret);
-					} else {
-						/* Disable Function 2 */
-						err_ret =
-						    sdio_disable_func
-						    (sdiodev->func[2]);
-						if (err_ret)
-							brcmf_dbg(ERROR,
-								  "Disable F2 failed:%d\n",
-								  err_ret);
-					}
-					sdio_release_host(sdiodev->func[2]);
-				}
-			}
-			/* to allow abort command through F1 */
-			else if (regaddr == SDIO_CCCR_ABORT) {
-				sdio_claim_host(sdiodev->func[func]);
-				/*
-				 * this sdio_f0_writeb() can be replaced
-				 * with another api
-				 * depending upon MMC driver change.
-				 * As of this time, this is temporaray one
-				 */
-				sdio_writeb(sdiodev->func[func], *byte,
-					    regaddr, &err_ret);
-				sdio_release_host(sdiodev->func[func]);
-			} else if (regaddr < 0xF0) {
-				brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n",
-					  regaddr);
-			} else {
-				/* Claim host controller, perform F0 write,
-				 and release */
-				sdio_claim_host(sdiodev->func[func]);
-				sdio_f0_writeb(sdiodev->func[func], *byte,
-					       regaddr, &err_ret);
-				sdio_release_host(sdiodev->func[func]);
-			}
+			brcmf_sdioh_request_byte_func0(sdiodev, rw, func,
+						       regaddr, byte,
+						       &err_ret);
 		} else {
 			/* Claim host controller, perform Fn write,
 			 and release */
@@ -317,13 +315,11 @@ brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 		sdio_claim_host(sdiodev->func[func]);
 
 		if (func == 0) {
-			*byte =
-			    sdio_f0_readb(sdiodev->func[func], regaddr,
-					  &err_ret);
+			*byte = sdio_f0_readb(sdiodev->func[func], regaddr,
+					      &err_ret);
 		} else {
-			*byte =
-			    sdio_readb(sdiodev->func[func], regaddr,
-				       &err_ret);
+			*byte = sdio_readb(sdiodev->func[func], regaddr,
+					   &err_ret);
 		}
 
 		sdio_release_host(sdiodev->func[func]);



  reply	other threads:[~2011-09-20  0:59 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 21:25 [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2 Franky Lin
2011-09-19 21:25 ` [PATCH 01/20] staging: brcm80211: sparse endianness warnings on dongle events Franky Lin
2011-09-19 21:25 ` [PATCH 02/20] staging: brcm80211: various fulmac sparse endianness fixes Franky Lin
2011-09-19 21:25 ` [PATCH 03/20] staging: brcm80211: sparse endianness warnings for struct brcmf_proto_cdc_ioctl Franky Lin
2011-09-19 21:25 ` [PATCH 04/20] staging: brcm80211: sparse endianness warnings for struct sdpcm_shared Franky Lin
2011-09-19 21:25 ` [PATCH 05/20] staging: brcm80211: more fullmac sparse endianness scan related changes Franky Lin
2011-09-19 21:25 ` [PATCH 06/20] staging: brcm80211: remove unconditional code blocks from brcmfmac Franky Lin
2011-09-19 21:25 ` [PATCH 07/20] staging: brcm80211: remove event handler thread from fullmac Franky Lin
2011-09-19 21:25 ` [PATCH 08/20] staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize Franky Lin
2011-09-19 21:25 ` [PATCH 09/20] staging: brcm80211: remove fullmac module_param brcmf_sdiod_drive_strength Franky Lin
2011-09-19 21:25 ` [PATCH 10/20] staging: brcm80211: remove fullmac module_param for watchdog Franky Lin
2011-09-19 21:25 ` [PATCH 11/20] staging: brcm80211: remove fullmac module_param brcmf_idletime Franky Lin
2011-09-19 21:26 ` [PATCH 12/20] staging: brcm80211: remove global variables for data frame boundary Franky Lin
2011-09-19 21:26 ` [PATCH 13/20] staging: brcm80211: removed two fullmac sparse spinlock warnings Franky Lin
2011-09-19 21:26 ` [PATCH 14/20] staging: brcm80211: added endianness check flag to fullmac Makefile Franky Lin
2011-09-19 21:26 ` [PATCH 15/20] staging: brcm80211: removed likely/unlikely calls Franky Lin
2011-09-19 21:26 ` [PATCH 16/20] staging: brcm80211: removed log after kzalloc()/kmalloc() failure Franky Lin
2011-09-19 21:26 ` [PATCH 17/20] staging: brcm80211: clarified fullmac io and event codes Franky Lin
2011-09-19 21:26 ` [PATCH 18/20] staging: brcm80211: consistent naming of struct net_device *ndev Franky Lin
2011-09-19 21:26 ` [PATCH 19/20] staging: brcm80211: simplified internal ioctl function once more Franky Lin
2011-09-19 21:26 ` [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero Franky Lin
2011-09-20  0:04   ` Joe Perches
2011-09-20  0:59     ` Joe Perches [this message]
2011-09-20  1:12       ` Franky Lin
2011-09-20  1:04     ` Franky Lin
2011-09-20 13:03 ` [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2 Greg KH
2011-09-20 13:21   ` Johannes Berg
2011-09-20 13:36     ` John W. Linville
2011-09-20 13:45       ` Rafał Miłecki
2011-09-20 13:40     ` Rafał Miłecki
2011-09-20 13:50     ` Rafał Miłecki
2011-09-20 20:56     ` Rafał Miłecki
2011-09-20 21:12       ` Alex Deucher
2011-09-20 21:23         ` Rafał Miłecki
2011-09-21 23:26         ` Luis R. Rodriguez
2011-09-21 13:40       ` John W. Linville
2011-09-21 13:52         ` Rafał Miłecki
2011-09-21 13:55           ` Rafał Miłecki
2011-09-21 14:39             ` Larry Finger
2011-09-20 13:22   ` John W. Linville
2011-09-20 14:00     ` Greg KH
2011-09-21 18:33       ` Brett Rudley
2011-09-21 20:01         ` Rafał Miłecki
2011-09-21 22:12           ` Brett Rudley
2011-09-21 22:35             ` Michael Büsch
2011-09-21 23:15               ` Brett Rudley
2011-09-21 23:28                 ` Michael Büsch
2011-09-22  2:07                   ` Brett Rudley
2011-09-22  6:36                     ` Rafał Miłecki
2011-09-22  8:53                   ` Arend Van Spriel
2011-09-22  8:57                     ` Rafał Miłecki
2011-09-22  9:10                       ` Arend Van Spriel
2011-09-22  9:12                         ` Rafał Miłecki
2011-09-22 10:07                     ` Jonas Gorski
2011-09-22 13:39                       ` Arend Van Spriel
2011-09-22  9:44               ` Johannes Berg
2011-09-22 10:29                 ` Michael Büsch
2011-09-22  6:47             ` Hauke Mehrtens
2011-09-22  9:04               ` Arend Van Spriel
2011-09-22  9:08                 ` Rafał Miłecki
2011-09-22 10:38                   ` Michael Büsch
2011-09-22  6:54             ` Rafał Miłecki
2011-09-22  7:24               ` Rafał Miłecki
2011-09-22  7:28             ` Rafał Miłecki
2011-09-22 14:31             ` Christoph Hellwig
2011-09-22 18:37               ` Arend Van Spriel

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=1316480372.30319.1.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=devel@linuxdriverproject.org \
    --cc=frankyl@broadcom.com \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).