Skip to contentSkip to conversation

hypfs sparse warnings.

S390 Martin Schwidefsky 5 participants 8 messages Sep 28, 2006 s390

lore
Share & tools
lore
#0 lore raw

From: Michael Holzheu <[email protected]>

[S390] hypfs sparse warnings.

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

---

 arch/s390/hypfs/hypfs_diag.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
arch/s390/hypfs/hypfs_diag.c +2 -1
diff -urpN linux-2.6/arch/s390/hypfs/hypfs_diag.c linux-2.6-patched/arch/s390/hypfs/hypfs_diag.c
@@ -403,7 +403,8 @@ static void *diag204_get_buffer(enum dia
 		*pages = 1;
 		return diag204_alloc_rbuf();
 	} else {/* INFO_EXT */
-		*pages = diag204(SUBC_RSI | INFO_EXT, 0, NULL);
+		*pages = diag204((unsigned long)SUBC_RSI |
+				 (unsigned long)INFO_EXT, 0, NULL);
 		if (*pages <= 0)
 			return ERR_PTR(-ENOSYS);
 		else
#1 lore raw
Quoted 3 lines · Martin Schwidefsky

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

At this point I start to wonder which part should be changed. Is it better to
a) cast some more, as you started to do,
b) change enums to #defines or
c) change '|' to '+'?

At any rate, you have the same problem in 5 seperate places by my count and only changed 1 of them. Nak - in case anyone cares.

Jörn

Signature · 4 lines
The competent programmer is fully aware of the strictly limited size of
his own skull; therefore he approaches the programming task in full
humility, and among other things he avoids clever tricks like the plague.
-- Edsger W. Dijkstra
#2 lore raw
Quoted 5 lines · J?rn Engel
Quoted 3 lines · Martin Schwidefsky

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

Quoted 8 lines

At this point I start to wonder which part should be changed. Is it better to
a) cast some more, as you started to do,
b) change enums to #defines or
c) change '|' to '+'?

At any rate, you have the same problem in 5 seperate places by my count and only changed 1 of them. Nak - in case anyone cares.

Split enums sanely.

#3 lore raw
In reply to Jörn Engel
Quoted 5 lines · J?rn Engel
Quoted 3 lines · Martin Schwidefsky

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

Quoted 8 lines

At this point I start to wonder which part should be changed. Is it better to
a) cast some more, as you started to do,
b) change enums to #defines or
c) change '|' to '+'?

At any rate, you have the same problem in 5 seperate places by my count and only changed 1 of them. Nak - in case anyone cares.

That would be where? My sparse run didn't reveal anything else.

#4 lore raw
Quoted 12 lines · Heiko Carstens
Quoted 11 lines · J?rn Engel
Quoted 3 lines · Martin Schwidefsky

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

At this point I start to wonder which part should be changed. Is it better to
a) cast some more, as you started to do,
b) change enums to #defines or
c) change '|' to '+'?

Quoted 4 lines
Quoted 2 lines

At any rate, you have the same problem in 5 seperate places by my count and only changed 1 of them. Nak - in case anyone cares.

That would be where? My sparse run didn't reveal anything else.

Search for diag204. All calls have the same format with bitwise or of two enums, so they are all equally (in-)correct.

Jörn

Signature · 2 lines
Prosperity makes friends, adversity tries them.
-- Publilius Syrus
#7 lore raw
In reply to Jörn Engel

Hi Jörn,

Jörn Engel <[email protected]> wrote on 09/28/2006 03:25:40 PM:

Quoted 8 lines · Martin Schwidefsky
Quoted 3 lines

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

At this point I start to wonder which part should be changed. Is it better to
a) cast some more, as you started to do,

I have done that! Martin already has submitted this patch.

Michael

#5 lore raw
In reply to Jörn Engel
Quoted 13 lines · J?rn Engel
Quoted 12 lines · Heiko Carstens
Quoted 11 lines · J?rn Engel
Quoted 3 lines · Martin Schwidefsky

sparse complains, if we use bitwise operations on enums. Cast enum to long in order to fix that problem!

At this point I start to wonder which part should be changed. Is it better to
a) cast some more, as you started to do,
b) change enums to #defines or
c) change '|' to '+'?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

At any rate, you have the same problem in 5 seperate places by my count and only changed 1 of them. Nak - in case anyone cares.

That would be where? My sparse run didn't reveal anything else.

Search for diag204. All calls have the same format with bitwise or of two enums, so they are all equally (in-)correct.

You probably need to update your git tree. All of them have casts in the meantime. Except for the one addressed with this patch.
See: 331c982d4a6b43cdc0d056956a1cae8a7d6237bf

#6 lore raw
Quoted 4 lines · Heiko Carstens

You probably need to update your git tree. All of them have casts in the meantime. Except for the one addressed with this patch.
See: 331c982d4a6b43cdc0d056956a1cae8a7d6237bf

Doh!

Jörn

Signature · 2 lines
He who knows that enough is enough will always have enough.
-- Lao Tsu