Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548837

[PATCH 3/6] staging: vchiq_arm: One check less in dump_phys_mem() after error detection

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 3/6] staging: vchiq_arm: One check less in dump_phys_mem() after error detection
Date 2016-12-31 23:10 +0100
Message-ID <sUA0F-eE-5@gated-at.bofh.it> (permalink)
References <sUzQZ-8nq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 31 Dec 2016 21:26:09 +0100

Adjust a jump target according to the Linux coding style convention
so that a redundant check for a null pointer can be avoided
in this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 2a260034189d..a316cf9ac626 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -1581,7 +1581,7 @@ dump_phys_mem(void *virt_addr, uint32_t num_bytes)
 	if (rc < 0) {
 		vchiq_log_error(vchiq_arm_log_level,
 				"Failed to get user pages: %d\n", rc);
-		goto out;
+		goto put_pages;
 	}
 
 	while (offset < end_offset) {
@@ -1607,10 +1607,9 @@ dump_phys_mem(void *virt_addr, uint32_t num_bytes)
 		offset += 16;
 	}
 
-out:
 	if (page)
 		kunmap(page);
-
+put_pages:
 	for (page_idx = 0; page_idx < num_pages; page_idx++)
 		put_page(pages[page_idx]);
 
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] staging: vchiq_arm: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-12-31 23:00 +0100
  [PATCH 6/6] staging: vchiq_arm: Delete an unnecessary return  statement in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-12-31 23:10 +0100
  [PATCH 3/6] staging: vchiq_arm: One check less in dump_phys_mem()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-12-31 23:10 +0100
  [PATCH 4/6] staging: vchiq_arm: Delete an error message for a failed  memory allocation in dump_phys_mem() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-12-31 23:10 +0100
  [PATCH 2/6] staging: vchiq_arm: Adjust 13 checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2016-12-31 23:10 +0100
  [PATCH 5/6] staging: vchiq_arm: Combine substrings for 24 messages SF Markus Elfring <elfring@users.sourceforge.net> - 2016-12-31 23:10 +0100

csiph-web