Skip to contentSkip to conversation

s390 update (4/9): common i/o layer update.

PATCH Martin Schwidefsky 4 participants 4 messages Mar 26, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines
Quoted 3 lines

+ typeof (chsc_area_ssd.response_block)
+ *ssd_res = &chsc_area_ssd.response_block;

Yikes! Please use the actual type here instead of typeof()

Trouble is that response_block is an anonymous structure. There is not type...

Quoted 7 lines

Review

Quoted 4 lines

+ if (sch->lpm == 0)

(quoted diff) +3 -0
+       return -ENODEV;
+ else
+       return -EACCES;

I'd write this as return (sch->lpm ? -EACCES : -ENODEV), but maybe I'm just too picky..

No, you are not. return (sch->lpm ? -EACCES : -ENODEV) is better.

Quoted 5 lines
Quoted 2 lines

- sch = kmalloc (sizeof (*sch), GFP_DMA);
+ sch = kmalloc (sizeof (*sch), GFP_KERNEL | GFP_DMA);

What about using GFP_KERNEL | __GFP_DMA instead? This makes it more clear that it's just a qualifier.

Hmm, GFP_DMA and __GFP_DMA are equivalent. I don't quite see your point here.

blue skies,
Martin

#1 lore raw
Quoted 9 lines · Martin Schwidefsky
Quoted 8 lines

Review

Quoted 5 lines

+ if (sch->lpm == 0)

(quoted diff) +3 -0
+       return -ENODEV;
+ else
+       return -EACCES;

I'd write this as return (sch->lpm ? -EACCES : -ENODEV), but maybe I'm just too picky..

No, you are not. return (sch->lpm ? -EACCES : -ENODEV) is better.

Are the brackets really necessary? This is highly personal, but I spend a few second "stubling" over them, which makes the code less readable for me.

Jörn

Signature · 3 lines
With a PC, I always felt limited by the software available. On Unix, 
I am limited only by my knowledge.
-- Peter J. Schoenster
#2 lore raw
Quoted 6 lines · Jörn Engel
Quoted 5 lines · Martin Schwidefsky
Quoted 5 lines
Quoted 4 lines

+ if (sch->lpm == 0)

(quoted diff) +3 -0
+       return -ENODEV;
+ else
+       return -EACCES;
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

I'd write this as return (sch->lpm ? -EACCES : -ENODEV), but maybe I'm just too picky..

No, you are not. return (sch->lpm ? -EACCES : -ENODEV) is better.

Are the brackets really necessary? This is highly personal, but I spend a few second "stubling" over them, which makes the code less readable for me.

Hey, after all it's a return we're doing here, no?

if (sch->lpm)

	return -EACCESS;

return -ENODEV;

Signature · 5 lines
Francis Galiegue <[email protected]>
Vatican (Score:5, Funny) 
by Anonymous Coward on Friday January 24, @11:26AM (#5151284) 
"Scientists at the Vatican Praying Center found that 98% of the prayer queries
at the God level are unnecessary."
#3 lore raw
In reply to Martin Schwidefsky
Quoted 7 lines · Martin Schwidefsky
Quoted 5 lines
Quoted 3 lines

+ typeof (chsc_area_ssd.response_block)
+ *ssd_res = &chsc_area_ssd.response_block;

Yikes! Please use the actual type here instead of typeof()

Trouble is that response_block is an anonymous structure. There is not type...

Then add one.

Quoted 4 lines
Quoted 2 lines

What about using GFP_KERNEL | __GFP_DMA instead? This makes it more clear that it's just a qualifier.

Hmm, GFP_DMA and __GFP_DMA are equivalent. I don't quite see your point here.

The __GFP flags are modifiers, the GFP_ flags usually can be used standalone - with the exception of GFP_DMA which shouldn't exist.