linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "tony.cho" <tony.cho@atmel.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	devel@driverdev.osuosl.org, rachel.kim@atmel.com,
	chris.park@atmel.com, austin.shin@atmel.com,
	linux-wireless@vger.kernel.org, johnny.kim@atmel.com,
	Nicolas.FERRE@atmel.com, robin.hwang@atmel.com,
	jude.lee@atmel.com, leo.kim@atmel.com
Subject: Re: [PATCH V2 1/5] staging: wilc1000: #ifdef conditionals cover entire functions
Date: Thu, 30 Jul 2015 20:48:21 -0700	[thread overview]
Message-ID: <20150731034821.GA8945@kroah.com> (raw)
In-Reply-To: <55BAEB08.8090705@atmel.com>

On Fri, Jul 31, 2015 at 12:27:04PM +0900, tony.cho wrote:
> 
> 
> On 2015년 07월 30일 20:56, Sudip Mukherjee wrote:
> >On Thu, Jul 30, 2015 at 06:10:10PM +0900, Tony Cho wrote:
> >>This patch lets preprocessor conditionals (#ifdef) related to
> >>WILC_SDIO_IRQ_GPIO to compile out the entire functions. Compiling out
> >>the entire functions is preferred rather than portions of functions or
> >>expressions becausue doing so makes code harder to read.
> >>
> >>Signed-off-by: Tony Cho <tony.cho@atmel.com>
> >>---
> ><snip>
> >>+#ifdef WILC_SDIO_IRQ_GPIO
> >>  static int sdio_clear_int(void)
> >>  {
> >>-#ifndef WILC_SDIO_IRQ_GPIO
> >>-	/* uint32_t sts; */
> >>-	sdio_cmd52_t cmd;
> >>-
> >>-	cmd.read_write = 0;
> >>-	cmd.function = 1;
> >>-	cmd.raw = 0;
> >>-	cmd.address = 0x4;
> >>-	cmd.data = 0;
> >>-	g_sdio.sdio_cmd52(&cmd);
> >>-	int_clrd++;
> >>-
> >>-	return cmd.data;
> >>-#else
> >>  	uint32_t reg;
> >>  	if (!sdio_read_reg(WILC_HOST_RX_CTRL_0, &reg)) {
> >>@@ -181,9 +168,23 @@ static int sdio_clear_int(void)
> >>  	sdio_write_reg(WILC_HOST_RX_CTRL_0, reg);
> >>  	int_clrd++;
> >>  	return 1;
> >>-#endif
> >>+}
> >>+#else
> >>+static int sdio_clear_int(void)
> >>+{
> >>+	sdio_cmd52_t cmd;
> >>+
> >>+	cmd.read_write = 0;
> >>+	cmd.function = 1;
> >>+	cmd.raw = 0;
> >>+	cmd.address = 0x4;
> >>+	cmd.data = 0;
> >>+	g_sdio.sdio_cmd52(&cmd);
> >>+	int_clrd++;
> >>+	return cmd.data;
> >>  }
> >>+#endif /* WILC_SDIO_IRQ_GPIO */
> >instead of changing #ifndef to #ifdef i think the following would have
> >been easier:
> 
> Yes, I agree with you.

Great!

> I will rewrite them after important patches are accepted.

This is the first patch in the series, I'm not going to take it if you
are going to redo it later, please fix it correctly.

I'll drop this series from my queue.

thanks,

greg k-h

  parent reply	other threads:[~2015-07-31  3:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30  9:10 [PATCH 0/5] 2nd patch for illegal coding style Tony Cho
2015-07-30  9:10 ` [PATCH V2 1/5] staging: wilc1000: #ifdef conditionals cover entire functions Tony Cho
2015-07-30  9:19   ` Johnny Kim
2015-07-30 11:56   ` Sudip Mukherjee
     [not found]     ` <55BAEB08.8090705@atmel.com>
2015-07-31  3:48       ` Greg KH [this message]
2015-07-30  9:10 ` [PATCH V2 2/5] staging: wilc1000: remove unnecessary blank lines Tony Cho
2015-07-30  9:10 ` [PATCH V2 3/5] staging: wilc1000: remove warnings on missing blank line Tony Cho
2015-07-30 12:10   ` Sudip Mukherjee
2015-07-30  9:10 ` [PATCH V2 4/5] staging: wilc1000: remove errors on required space Tony Cho
2015-07-30  9:10 ` [PATCH V2 5/5] staging: wilc1000: remove unused functions Tony Cho
2015-07-31  3:49 ` [PATCH 0/5] 2nd patch for illegal coding style 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=20150731034821.GA8945@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Nicolas.FERRE@atmel.com \
    --cc=austin.shin@atmel.com \
    --cc=chris.park@atmel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=johnny.kim@atmel.com \
    --cc=jude.lee@atmel.com \
    --cc=leo.kim@atmel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rachel.kim@atmel.com \
    --cc=robin.hwang@atmel.com \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=tony.cho@atmel.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;
as well as URLs for NNTP newsgroup(s).