All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tony Cho <tony.cho@atmel.com>
Cc: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
	johnny.kim@atmel.com, chris.park@atmel.com, rachel.kim@atmel.com,
	austin.shin@atmel.com, glen.lee@atmel.com, leo.kim@atmel.com,
	jude.lee@atmel.com, robin.hwang@atmel.com,
	Nicolas.FERRE@atmel.com
Subject: Re: [PATCH 09/21] staging: wilc1000: #ifdef conditionals cover entire functions
Date: Wed, 29 Jul 2015 13:54:54 -0700	[thread overview]
Message-ID: <20150729205454.GA7965@kroah.com> (raw)
In-Reply-To: <1438073261-28315-10-git-send-email-tony.cho@atmel.com>

On Tue, Jul 28, 2015 at 05:47:28PM +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>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/staging/wilc1000/wilc_sdio.c | 482 +++++++++++++++++++++--------------
>  1 file changed, 293 insertions(+), 189 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
> index 8f674ad..83b8da9 100644
> --- a/drivers/staging/wilc1000/wilc_sdio.c
> +++ b/drivers/staging/wilc1000/wilc_sdio.c
> @@ -155,22 +155,9 @@ _fail_:
>  	return 0;
>  }
>  
> +#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 */

Why does this have to be a config option anyway?  Shouldn't this be
dynamically determined?  How should someone know which to choose?

>  uint32_t sdio_xfer_cnt(void)
>  {
> @@ -521,14 +522,16 @@ static int sdio_deinit(void *pv)
>  	return 1;
>  }
>  
> +#ifdef WILC_SDIO_IRQ_GPIO
>  static int sdio_sync(void)
>  {
>  	uint32_t reg;
> +	int ret;
>  
>  	/**
>  	 *      Disable power sequencer
>  	 **/
> -	if (!sdio_read_reg(WILC_MISC, &reg)) {
> +	if(!sdio_read_reg(WILC_MISC, &reg)) {

You just reverted this coding style change, why?

I can't take this patch, sorry.  Please sync up and make sure you do not
revert changes that other people have already made to the code, and
resend the remaining patches in this series.

thanks,

greg k-h

  reply	other threads:[~2015-07-29 20:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28  8:47 [PATCH 00/21] cover letter of Atmel WILC1000 patches Tony Cho
2015-07-28  8:47 ` [PATCH 01/21] staging: wilc1000: remove unnecessary files Tony Cho
2015-07-28  8:47 ` [PATCH 02/21] staging: wilc1000: describe the config symbol fully Tony Cho
2015-07-28  8:47 ` [PATCH 03/21] staging: wilc1000: remove dead codes related to SIMULATION Tony Cho
2015-07-28  8:47 ` [PATCH 04/21] staging: wilc1000: remove warnings on the multiple line uses Tony Cho
2015-07-28  8:47 ` [PATCH 05/21] staging: wilc1000: remove the warnings on missing blank line Tony Cho
2015-07-28  8:47 ` [PATCH 06/21] staging: wilc1000: remove the warnings on unnecessary braces Tony Cho
2015-07-29 20:50   ` Greg KH
2015-07-28  8:47 ` [PATCH 07/21] staging: wilc1000: remove preprocessor conditionals unused Tony Cho
2015-07-28  8:47 ` [PATCH 08/21] staging: wilc1000: remove a dead preprocessor conditionals Tony Cho
2015-07-28  8:47 ` [PATCH 09/21] staging: wilc1000: #ifdef conditionals cover entire functions Tony Cho
2015-07-29 20:54   ` Greg KH [this message]
2015-07-29 21:14     ` Dan Carpenter
2015-07-29 21:29       ` Greg KH
2015-07-29 21:37         ` Dan Carpenter
2015-07-28  8:47 ` [PATCH 10/21] staging: wilc1000: remove unused functions Tony Cho
2015-07-28  8:47 ` [PATCH 11/21] staging: wilc1000: remove multiple blank lines Tony Cho
2015-07-28  8:47 ` [PATCH 12/21] staging: wilc1000: alignment should match open parenthesis Tony Cho
2015-07-28  8:47 ` [PATCH 13/21] staging: wilc1000: remove errors on required space Tony Cho
2015-07-28  8:47 ` [PATCH 14/21] staging: wilc1000: remove warnings on unnecessary braces Tony Cho
2015-07-28  8:47 ` [PATCH 15/21] staging: wilc1000: remove warnings on missing blank line Tony Cho
2015-07-28  8:47 ` [PATCH 16/21] staging: wilc1000: remove unnecessary inner braces Tony Cho
2015-07-28  8:47 ` [PATCH 17/21] staging: wilc1000: remove unnecessary blank lines Tony Cho
2015-07-28  8:47 ` [PATCH 18/21] staging: wilc1000: remove braces {} for single statement blocks Tony Cho
2015-07-28  8:47 ` [PATCH 19/21] staging: wilc1000: remove warnings on the multiple blank lines uses Tony Cho
2015-07-28  8:47 ` [PATCH 20/21] staging: wilc1000: remove unnecessary spcae Tony Cho
2015-07-28  8:47 ` [PATCH 21/21] staging: wilc1000: update TODO list of WILC1000 Tony Cho
2015-07-29 21:01   ` Greg KH
     [not found]     ` <55B97E17.5050007@atmel.com>
2015-07-30  1:40       ` Greg KH
2015-07-28  9:28 ` [PATCH 00/21] cover letter of Atmel WILC1000 patches Dan Carpenter

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=20150729205454.GA7965@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=glen.lee@atmel.com \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.