Skip to contentSkip to conversation

Fix compilation warning

PATCH In review Bernhard Walle 2 participants 6 messages Feb 20, 2008 – Feb 27, 2008

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

PATCH 1/1 Fix compilation warning

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

---
 purgatory/purgatory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
purgatory/purgatory.c +1 -1
@@ -18,7 +18,7 @@ void verify_sha256_digest(void)
 	sha256_starts(&ctx);
 	end = &sha256_regions[sizeof(sha256_regions)/sizeof(sha256_regions[0])];
 	for(ptr = sha256_regions; ptr < end; ptr++) {
-		sha256_update(&ctx, ptr->start, ptr->len);
+		sha256_update(&ctx, (uint8_t *)ptr->start, ptr->len);
 	}
 	sha256_finish(&ctx, digest);
 	if (memcmp(digest, sha256_digest, sizeof(digest)) != 0) {

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 4 lines · Bernhard Walle

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

Thanks Bernhard, I have queued that up. Although I notice that on arm the warning turns into

purgatory/purgatory.c: In function 'verify_sha256_digest':
purgatory/purgatory.c:21: warning: cast to pointer from integer of different size

Signature · 7 lines
Horms


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#2 lore raw
Quoted 11 lines · Simon Horman
Quoted 4 lines · Bernhard Walle

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

Thanks Bernhard, I have queued that up. Although I notice that on arm the warning turns into

purgatory/purgatory.c: In function 'verify_sha256_digest':
purgatory/purgatory.c:21: warning: cast to pointer from integer of different size

Isn't this the case on every 32 bit system?

Bernhard

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 7 lines · Bernhard Walle
Quoted 6 lines · Simon Horman
Quoted 4 lines · Bernhard Walle

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

Quoted 7 lines
Quoted 5 lines

Thanks Bernhard, I have queued that up. Although I notice that on arm the warning turns into

purgatory/purgatory.c: In function 'verify_sha256_digest':
purgatory/purgatory.c:21: warning: cast to pointer from integer of different size

Isn't this the case on every 32 bit system?

Yes, now you mention it, I expect so. I guess its not a problem.

Signature · 7 lines
Horms


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#4 lore raw
Quoted 11 lines · Simon Horman
Quoted 10 lines · Bernhard Walle
Quoted 9 lines · Simon Horman
Quoted 4 lines · Bernhard Walle

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

Thanks Bernhard, I have queued that up. Although I notice that on arm the warning turns into

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

purgatory/purgatory.c: In function 'verify_sha256_digest':
purgatory/purgatory.c:21: warning: cast to pointer from integer of different size

Isn't this the case on every 32 bit system?

Yes, now you mention it, I expect so. I guess its not a problem.

But you didn't merge the patch. ;) Here's a version that should not give any warnings ...

----------------------------

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

---
 purgatory/purgatory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
purgatory/purgatory.c +1 -1
@@ -18,7 +18,7 @@ void verify_sha256_digest(void)
 	sha256_starts(&ctx);
 	end = &sha256_regions[sizeof(sha256_regions)/sizeof(sha256_regions[0])];
 	for(ptr = sha256_regions; ptr < end; ptr++) {
-		sha256_update(&ctx, ptr->start, ptr->len);
+		sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start), ptr->len);
 	}
 	sha256_finish(&ctx, digest);
 	if (memcmp(digest, sha256_digest, sizeof(digest)) != 0) {

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw
Quoted 15 lines · Bernhard Walle
Quoted 14 lines · Simon Horman
Quoted 13 lines · Bernhard Walle
Quoted 11 lines · Simon Horman
Quoted 4 lines · Bernhard Walle

This patch fixes following compilation warning:

purgatory/purgatory.c:21: warning: passing argument 2 of 'sha256_update' makes pointer from integer without a cast

Thanks Bernhard, I have queued that up. Although I notice that on arm the warning turns into

purgatory/purgatory.c: In function 'verify_sha256_digest':
purgatory/purgatory.c:21: warning: cast to pointer from integer of different size

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Isn't this the case on every 32 bit system?

Yes, now you mention it, I expect so. I guess its not a problem.

But you didn't merge the patch. ;) Here's a version that should not give any warnings ...

Sorry, I had queued it up awaiting the release. I now have applied this updated fix in git.

Signature · 7 lines
Horms


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec