linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [S390] hypfs sparse warnings.
@ 2006-09-28 13:07 Martin Schwidefsky
  2006-09-28 13:25 ` Jörn Engel
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Schwidefsky @ 2006-09-28 13:07 UTC (permalink / raw)
  To: linux-kernel, holzheu

From: Michael Holzheu <holzheu@de.ibm.com>

[S390] hypfs sparse warnings.

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

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/hypfs/hypfs_diag.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -urpN linux-2.6/arch/s390/hypfs/hypfs_diag.c linux-2.6-patched/arch/s390/hypfs/hypfs_diag.c
--- linux-2.6/arch/s390/hypfs/hypfs_diag.c	2006-09-28 14:58:39.000000000 +0200
+++ linux-2.6-patched/arch/s390/hypfs/hypfs_diag.c	2006-09-28 14:58:52.000000000 +0200
@@ -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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 13:07 [S390] hypfs sparse warnings Martin Schwidefsky
@ 2006-09-28 13:25 ` Jörn Engel
  2006-09-28 13:31   ` Al Viro
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jörn Engel @ 2006-09-28 13:25 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: linux-kernel, holzheu

On Thu, 28 September 2006 15:07:37 +0200, Martin Schwidefsky wrote:
> 
> 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

-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 13:25 ` Jörn Engel
@ 2006-09-28 13:31   ` Al Viro
  2006-09-28 13:42   ` Heiko Carstens
  2006-09-28 13:54   ` Michael Holzheu
  2 siblings, 0 replies; 8+ messages in thread
From: Al Viro @ 2006-09-28 13:31 UTC (permalink / raw)
  To: J?rn Engel; +Cc: Martin Schwidefsky, linux-kernel, holzheu

On Thu, Sep 28, 2006 at 03:25:40PM +0200, J?rn Engel wrote:
> On Thu, 28 September 2006 15:07:37 +0200, Martin Schwidefsky wrote:
> > 
> > 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.

Split enums sanely.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 13:25 ` Jörn Engel
  2006-09-28 13:31   ` Al Viro
@ 2006-09-28 13:42   ` Heiko Carstens
  2006-09-28 13:54     ` Jörn Engel
  2006-09-28 13:54   ` Michael Holzheu
  2 siblings, 1 reply; 8+ messages in thread
From: Heiko Carstens @ 2006-09-28 13:42 UTC (permalink / raw)
  To: J?rn Engel; +Cc: Martin Schwidefsky, linux-kernel, holzheu

On Thu, Sep 28, 2006 at 03:25:40PM +0200, J?rn Engel wrote:
> On Thu, 28 September 2006 15:07:37 +0200, Martin Schwidefsky wrote:
> > 
> > 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.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 13:42   ` Heiko Carstens
@ 2006-09-28 13:54     ` Jörn Engel
  2006-09-28 14:21       ` Heiko Carstens
  0 siblings, 1 reply; 8+ messages in thread
From: Jörn Engel @ 2006-09-28 13:54 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Martin Schwidefsky, linux-kernel, holzheu

On Thu, 28 September 2006 15:42:47 +0200, Heiko Carstens wrote:
> On Thu, Sep 28, 2006 at 03:25:40PM +0200, J?rn Engel wrote:
> > On Thu, 28 September 2006 15:07:37 +0200, Martin Schwidefsky wrote:
> > > 
> > > 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.
> 
> 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

-- 
Prosperity makes friends, adversity tries them.
-- Publilius Syrus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 13:25 ` Jörn Engel
  2006-09-28 13:31   ` Al Viro
  2006-09-28 13:42   ` Heiko Carstens
@ 2006-09-28 13:54   ` Michael Holzheu
  2 siblings, 0 replies; 8+ messages in thread
From: Michael Holzheu @ 2006-09-28 13:54 UTC (permalink / raw)
  To: Jörn Engel; +Cc: linux-kernel, mschwid2

Hi Jörn,

Jörn Engel <joern@wohnheim.fh-wedel.de> wrote on 09/28/2006 03:25:40 PM:

> On Thu, 28 September 2006 15:07:37 +0200, Martin Schwidefsky wrote:
> >
> > 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 13:54     ` Jörn Engel
@ 2006-09-28 14:21       ` Heiko Carstens
  2006-09-28 14:41         ` Jörn Engel
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Carstens @ 2006-09-28 14:21 UTC (permalink / raw)
  To: J?rn Engel; +Cc: Martin Schwidefsky, linux-kernel, holzheu

On Thu, Sep 28, 2006 at 03:54:06PM +0200, J?rn Engel wrote:
> On Thu, 28 September 2006 15:42:47 +0200, Heiko Carstens wrote:
> > On Thu, Sep 28, 2006 at 03:25:40PM +0200, J?rn Engel wrote:
> > > On Thu, 28 September 2006 15:07:37 +0200, Martin Schwidefsky wrote:
> > > > 
> > > > 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.
> > 
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [S390] hypfs sparse warnings.
  2006-09-28 14:21       ` Heiko Carstens
@ 2006-09-28 14:41         ` Jörn Engel
  0 siblings, 0 replies; 8+ messages in thread
From: Jörn Engel @ 2006-09-28 14:41 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Martin Schwidefsky, linux-kernel, holzheu

On Thu, 28 September 2006 16:21:39 +0200, Heiko Carstens wrote:
> 
> 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

-- 
He who knows that enough is enough will always have enough.
-- Lao Tsu

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-09-28 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-28 13:07 [S390] hypfs sparse warnings Martin Schwidefsky
2006-09-28 13:25 ` Jörn Engel
2006-09-28 13:31   ` Al Viro
2006-09-28 13:42   ` Heiko Carstens
2006-09-28 13:54     ` Jörn Engel
2006-09-28 14:21       ` Heiko Carstens
2006-09-28 14:41         ` Jörn Engel
2006-09-28 13:54   ` Michael Holzheu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).