driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Prakhar Sinha <prakharsinha2808@gmail.com>
Cc: devel@driverdev.osuosl.org, sabrina-gaube@web.de,
	linux-kernel@vger.kernel.org, nishkadg.linux@gmail.com,
	pakki001@umn.edu, tobias.niessen@stud.uni-hannover.de,
	kim.jamie.bradley@gmail.com, qader.aymen@gmail.com
Subject: Re: [PATCH] staging: rts5208: Fix 80 char warning by re-structuring if-blocks.
Date: Wed, 4 Sep 2019 19:14:13 +0200	[thread overview]
Message-ID: <20190904171413.GA18390@kroah.com> (raw)
In-Reply-To: <20190904130523.GA17126@MeraComputer>

On Wed, Sep 04, 2019 at 06:35:23PM +0530, Prakhar Sinha wrote:
> This patch solves the following checkpatch.pl's messages in
> drivers/staging/rts5208/sd.c
> 
> WARNING: line over 80 characters
> 4517: FILE: drivers/staging/rts5208/sd.c:4517:
> +                                               sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST);
> 
> WARNING: line over 80 characters
> 4518: FILE: drivers/staging/rts5208/sd.c:4518:
> +                                               goto sd_execute_write_cmd_failed;
> 
> WARNING: line over 80 characters
> 4522: FILE: drivers/staging/rts5208/sd.c:4522:
> +                               sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST);
> 
> Signed-off-by: Prakhar Sinha <prakharsinha2808@gmail.com>
> ---
>  drivers/staging/rts5208/sd.c | 26 ++++++++++++--------------
>  1 file changed, 12 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
> index a06045344301..7d6f2c56e740 100644
> --- a/drivers/staging/rts5208/sd.c
> +++ b/drivers/staging/rts5208/sd.c
> @@ -4505,22 +4505,20 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
>  
>  		dev_dbg(rtsx_dev(chip), "sd_lock_state = 0x%x, sd_card->sd_lock_status = 0x%x\n",
>  			sd_lock_state, sd_card->sd_lock_status);
> -		if (sd_lock_state ^ (sd_card->sd_lock_status & SD_LOCKED)) {
> +		if (sd_lock_state ^ (sd_card->sd_lock_status & SD_LOCKED))
>  			sd_card->sd_lock_notify = 1;
> -			if (sd_lock_state &&
> -			    (sd_card->sd_lock_status & SD_LOCK_1BIT_MODE)) {
> -				sd_card->sd_lock_status |= (
> -					SD_UNLOCK_POW_ON | SD_SDR_RST);
> -				if (CHK_SD(sd_card)) {
> -					retval = reset_sd(chip);
> -					if (retval != STATUS_SUCCESS) {
> -						sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST);
> -						goto sd_execute_write_cmd_failed;
> -					}
> -				}
> -
> -				sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST);
> +		if ((sd_lock_state & !(sd_card->sd_lock_status & SD_LOCKED)) &&
> +		    (sd_card->sd_lock_status & SD_LOCK_1BIT_MODE)) {
> +			sd_card->sd_lock_status |= (SD_UNLOCK_POW_ON |
> +						    SD_SDR_RST);
> +			if (CHK_SD(sd_card) &&
> +			    reset_sd(chip) != STATUS_SUCCESS) {
> +				sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON |
> +							     SD_SDR_RST);
> +				goto sd_execute_write_cmd_failed;
>  			}
> +			sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON |
> +						     SD_SDR_RST);

Are you sure you can indent and call the if() statement twice like this?

If so, please document this in your changelog text.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

      reply	other threads:[~2019-09-04 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 13:05 [PATCH] staging: rts5208: Fix 80 char warning by re-structuring if-blocks Prakhar Sinha
2019-09-04 17:14 ` Greg KH [this message]

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=20190904171413.GA18390@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=kim.jamie.bradley@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nishkadg.linux@gmail.com \
    --cc=pakki001@umn.edu \
    --cc=prakharsinha2808@gmail.com \
    --cc=qader.aymen@gmail.com \
    --cc=sabrina-gaube@web.de \
    --cc=tobias.niessen@stud.uni-hannover.de \
    /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).