Skip to contentSkip to conversation

staging: vc04_services: Removed unnecessary variable

PATCH In review Narcisa Ana Maria Vasile 2 participants 2 messages Mar 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vc04_services: Removed unnecessary variable

Removed unnecessary variable and used instead the parameter that was already defined

---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +1 -3
index 2815387..ff0a1ff 100644
@@ -755,9 +755,7 @@ static const char *msg_type_str(unsigned int msg_type)
 	void *context, void *dest,
 	size_t offset, size_t maxsize)
 {
-	void *src = context;
-
-	memcpy(dest + offset, src + offset, maxsize);
+	memcpy(dest + offset, context + offset, maxsize);
 	return maxsize;
 }
 
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Narcisa Ana Maria Vasile

Removed unnecessary variable and used instead the parameter that was already defined

---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +0 -0
index 2815387..ff0a1ff 100644

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c static const char *msg_type_str(unsigned int msg_type) · line 758

Quoted 7 lines
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +1 -3
@@ -755,9 +755,7 @@ static const char *msg_type_str(unsigned int msg_type)
 	void *context, void *dest,
 	size_t offset, size_t maxsize)
 {
-	void *src = context;
-
-	memcpy(dest + offset, src + offset, maxsize);
+	memcpy(dest + offset, context + offset, maxsize);

You have to watch for this, because the type could change, which could change the result of the pointer arithmetic. But that doens't happen here
- it's void * both times.

Quoted 13 lines
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +0 -1
 	return maxsize;
 }
 
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1488328859-6925-1-git-send-email-narcisaanamaria12%40gmail.com.
For more options, visit https://groups.google.com/d/optout.