Skip to contentSkip to conversation

Hexagon: Use resource_size function

PATCH In review Thomas Meyer 3 participants 5 messages Nov 8, 2011 – Nov 10, 2011 Qualcomm hexagon architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Hexagon: Use resource_size function

From: Thomas Meyer <[email protected]>

Use resource_size function on resource object
instead of explicit computation.

The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

---

arch/hexagon/kernel/time.c 2011-11-08 12:21:17.722176538 +0100 renamed from arch/hexagon/kernel/time.c 2011-11-07 19:37:21.719553477 +0100 +2 -4
diff -u -p a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
@@ -200,12 +200,10 @@ void __init time_init_deferred(void)
 		resource = rtos_timer_device.resource;
 
 	/*  ioremap here means this has to run later, after paging init  */
-	rtos_timer = ioremap(resource->start, resource->end
-		- resource->start + 1);
+	rtos_timer = ioremap(resource->start, resource_size(resource));
 
 	if (!rtos_timer) {
-		release_mem_region(resource->start, resource->end
-			- resource->start + 1);
+		release_mem_region(resource->start, resource_size(resource));
 	}
 	clocksource_register_khz(&hexagon_clocksource, pcycle_freq_mhz * 1000);
 
#1 lore raw

Some minor nits about the formatting of the patch.

Quoted 1 line · Thomas Meyer

From: Thomas Meyer <[email protected]>

Shouldn't need a From: line, since it is the same as the email you sent it from.

Quoted 2 lines

Use resource_size function on resource object
instead of explicit computation.

The commit text shouldn't be indented.

Quoted 5 lines

The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

I'm curious if these patches are generated directly by coccinelle, since they don't appear to be coming from git. It'd be nice to have diffstats in them (especially when they are larger).

Thanks,
David

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#2 lore raw

Am Dienstag, den 08.11.2011, 17:02 -0800 schrieb David Brown:

Quoted 7 lines

Some minor nits about the formatting of the patch.

Quoted 1 line · Thomas Meyer

From: Thomas Meyer <[email protected]>

Shouldn't need a From: line, since it is the same as the email you sent it from.

So do I need a From: line or not?

Documentation/SubmittingPatches says:

The "from" line must be the very first line in the message body, and has the form:

From: Original Author <[email protected]>

The "from" line specifies who will be credited as the author of the patch in the permanent changelog. If the "from" line is missing, then the "From:" line from the email header will be used to determine the patch author in the changelog.

MUST in the meaning of RFC2119, means it is an absolut requirment. What should I do?

OTOH some people seems to ignore this, too:

Do not send more than 15 patches at once to the vger mailing lists!!!

Quoted 5 lines
Quoted 3 lines

Use resource_size function on resource object
instead of explicit computation.

The commit text shouldn't be indented.

Will fix that.

Quoted 10 lines
Quoted 6 lines

The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

I'm curious if these patches are generated directly by coccinelle, since they don't appear to be coming from git. It'd be nice to have diffstats in them (especially when they are larger).

coccinelle doesn't work that way. It's independent from git. I need to check the manual of spatch.bin if it's possible to produce a diffstat.

Quoted 3 lines

Thanks,
David

#3 lore raw
Quoted 18 lines · Thomas Meyer

Am Dienstag, den 08.11.2011, 17:02 -0800 schrieb David Brown:

Quoted 7 lines

Some minor nits about the formatting of the patch.

Quoted 1 line · Thomas Meyer

From: Thomas Meyer <[email protected]>

Shouldn't need a From: line, since it is the same as the email you sent it from.

So do I need a From: line or not?

Documentation/SubmittingPatches says:

The "from" line must be the very first line in the message body, and has the form:

From: Original Author <[email protected]>

Quoted 7 lines

The "from" line specifies who will be credited as the author of the patch in the permanent changelog. If the "from" line is missing, then the "From:" line from the email header will be used to determine the patch author in the changelog.

MUST in the meaning of RFC2119, means it is an absolut requirment. What should I do?

The absolute requirement is that the from line must be the first line in the message body. The "If the 'from' line is missing" even suggests that it is optional. I agree that the wording isn't all that great.

I don't believe it hurts anything to use it, it just looks kind of odd to have a From line that is the same as the originating email address.

You certainly don't need it, given that a vast majority of patches posted don't contain a from line. Git send-email only generates one if the author is different from the one sending the message.

David

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#4 lore raw
In reply to Thomas Meyer
Quoted 25 lines

From: Thomas Meyer <[email protected]>

Use resource_size function on resource object
instead of explicit computation.

The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

---

diff -u -p a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c

arch/hexagon/kernel/time.c 2011-11-08 12:21:17.722176538 +0100 renamed from arch/hexagon/kernel/time.c 2011-11-07 19:37:21.719553477 +0100 +0 -1
@@ -200,12 +200,10 @@ void __init time_init_deferred(void)
 		resource = rtos_timer_device.resource;
 
 	/*  ioremap here means this has to run later, after paging init  */
-	rtos_timer = ioremap(resource->start, resource->end

arch/hexagon/kernel/time.c 2011-11-08 12:21:17.722176538 +0100 void __init time_init_deferred(void) · line 209

Quoted 10 lines
arch/hexagon/kernel/time.c 2011-11-08 12:21:17.722176538 +0100 renamed from arch/hexagon/kernel/time.c 2011-11-07 19:37:21.719553477 +0100 +2 -3
-		- resource->start + 1);
+	rtos_timer = ioremap(resource->start, resource_size(resource));
 
 	if (!rtos_timer) {
-		release_mem_region(resource->start, resource->end
-			- resource->start + 1);
+		release_mem_region(resource->start, resource_size(resource));
 	}
 	clocksource_register_khz(&hexagon_clocksource, pcycle_freq_mhz * 1000);
 

I don't have much to add about the form of the patch; David noticed more than I did, but as far as content, it looks good and I will have this patch applied to my tree. Thanks!