From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 13/13] staging: sm750: move assignment out of if cond
Date: Mon, 23 Mar 2015 11:29:10 +0000 [thread overview]
Message-ID: <20150323112910.GH10964@mwanda> (raw)
In-Reply-To: <20150322231516.GA17336@x230-arch.club.entropia.de>
On Mon, Mar 23, 2015 at 12:15:16AM +0100, Michel von Czettritz wrote:
> This patch moves the assignments from the if conditions to the line before the condition.
> The 3 occurrence are return values and the checks for errors.
>
> Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index c250882..a4a7fed 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -474,7 +474,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
>
> console_lock();
>
> - if ((ret = pci_set_power_state(pdev, PCI_D0)) != 0) {
> + ret = pci_set_power_state(pdev, PCI_D0);
> + if (ret != 0) {
Use "if (ret) ". The double negative is not not a waste of time.
regards,
dan carpenter
prev parent reply other threads:[~2015-03-23 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-22 23:15 [PATCH 13/13] staging: sm750: move assignment out of if cond Michel von Czettritz
2015-03-23 11:29 ` Dan Carpenter [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=20150323112910.GH10964@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-fbdev@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 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.