public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anastasiia Lukianenko <vicooodin@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 5/5] xen: Code style conformity
Date: Wed, 19 Aug 2020 15:42:21 +0300	[thread overview]
Message-ID: <20200819124221.30615-6-vicooodin@gmail.com> (raw)
In-Reply-To: <20200819124221.30615-1-vicooodin@gmail.com>

From: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>

Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
---
 drivers/xen/gnttab.c  |  3 ++-
 drivers/xen/pvblock.c | 12 ++++++------
 include/xen/gnttab.h  |  3 +--
 lib/sscanf.c          |  3 ++-
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/xen/gnttab.c b/drivers/xen/gnttab.c
index becf7a79fb..9bf1091ab3 100644
--- a/drivers/xen/gnttab.c
+++ b/drivers/xen/gnttab.c
@@ -100,7 +100,8 @@ int gnttab_end_access(grant_ref_t ref)
 
 	nflags = gnttab_table[ref].flags;
 	do {
-		if ((flags = nflags) & (GTF_reading | GTF_writing)) {
+		flags = nflags;
+		if ((flags) & (GTF_reading | GTF_writing)) {
 			printf("WARNING: g.e. still in use! (%x)\n", flags);
 			return 0;
 		}
diff --git a/drivers/xen/pvblock.c b/drivers/xen/pvblock.c
index 76e82fbf41..87e33afeb0 100644
--- a/drivers/xen/pvblock.c
+++ b/drivers/xen/pvblock.c
@@ -294,8 +294,8 @@ static void shutdown_blkfront(struct blkfront_dev *dev)
 	snprintf(path, sizeof(path), "%s/state", dev->backend);
 	snprintf(nodename, sizeof(nodename), "%s/state", dev->nodename);
 
-	if ((err = xenbus_switch_state(XBT_NIL, nodename,
-				       XenbusStateClosing)) != NULL) {
+	err = xenbus_switch_state(XBT_NIL, nodename, XenbusStateClosing);
+	if (err != NULL) {
 		printf("%s: error changing state to %d: %s\n", __func__,
 		       XenbusStateClosing, err);
 		goto close;
@@ -306,8 +306,8 @@ static void shutdown_blkfront(struct blkfront_dev *dev)
 		err = xenbus_wait_for_state_change(path, &state);
 	free(err);
 
-	if ((err = xenbus_switch_state(XBT_NIL, nodename,
-				       XenbusStateClosed)) != NULL) {
+	err = xenbus_switch_state(XBT_NIL, nodename, XenbusStateClosed);
+	if (err != NULL) {
 		printf("%s: error changing state to %d: %s\n", __func__,
 		       XenbusStateClosed, err);
 		goto close;
@@ -319,8 +319,8 @@ static void shutdown_blkfront(struct blkfront_dev *dev)
 		free(err);
 	}
 
-	if ((err = xenbus_switch_state(XBT_NIL, nodename,
-				       XenbusStateInitialising)) != NULL) {
+	err = xenbus_switch_state(XBT_NIL, nodename, XenbusStateInitialising);
+	if (err != NULL) {
 		printf("%s: error changing state to %d: %s\n", __func__,
 		       XenbusStateInitialising, err);
 		goto close;
diff --git a/include/xen/gnttab.h b/include/xen/gnttab.h
index db1d5361fe..db615004aa 100644
--- a/include/xen/gnttab.h
+++ b/include/xen/gnttab.h
@@ -1,5 +1,4 @@
-/*
- * SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0
  *
  * (C) 2006, Steven Smith <sos22@cam.ac.uk>
  * (C) 2006, Grzegorz Milos <gm281@cam.ac.uk>
diff --git a/lib/sscanf.c b/lib/sscanf.c
index d1e2dc272c..4c35c035fe 100644
--- a/lib/sscanf.c
+++ b/lib/sscanf.c
@@ -555,7 +555,8 @@ literal:
 			if (flags & SUPPRESS) {
 				size_t sum = 0;
 
-				if ((n = inr) < width) {
+				n = inr;
+				if (n < width) {
 					sum += n;
 					width -= n;
 					inp += n;
-- 
2.17.1

  parent reply	other threads:[~2020-08-19 12:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 12:42 [PATCH 0/5] Follow up to "Add new board: Xen guest for ARM64" series Anastasiia Lukianenko
2020-08-19 12:42 ` [PATCH 1/5] board: xen: Remove unnecessary CONFIG_BOARD_EARLY_INIT_F define and board_early_init_f function Anastasiia Lukianenko
2020-08-19 13:16   ` Tom Rini
2020-08-19 12:42 ` [PATCH 2/5] MAINTAINERS: Add maintainers to XEN section Anastasiia Lukianenko
2020-08-19 13:16   ` Tom Rini
2020-08-19 12:42 ` [PATCH 3/5] board: xen: Remove CONFIG_CMD_RUN define as it is set on by default in Kconfig Anastasiia Lukianenko
2020-08-20  9:52   ` Michal Simek
2020-08-19 12:42 ` [PATCH 4/5] board: xen: Remove unnecessary CONFIG_INITRD_TAG and CONFIG_CMDLINE_TAG Anastasiia Lukianenko
2020-08-19 12:42 ` Anastasiia Lukianenko [this message]
2020-08-19 13:18   ` [PATCH 5/5] xen: Code style conformity Tom Rini

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=20200819124221.30615-6-vicooodin@gmail.com \
    --to=vicooodin@gmail.com \
    --cc=u-boot@lists.denx.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