Skip to contentSkip to conversation

aacraid 2.5

PATCH Peter Chubb 2 participants 2 messages Dec 9, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Mark" == Mark Haverkamp <[email protected]> writes:

Quoted 8 lines · Christoph Hellwig
Quoted 8 lines

On Fri, Dec 06, 2002 at 07:45:42AM -0800, Mark Haverkamp wrote: > +/** > + * Convert capacity to cylinders > + * accounting for the fact capacity could be a 64 bit value > + * > + */ > +static inline u32 cap_to_cyls(sector_t capacity, u32 divisor) > +{ > +#ifdef CONFIG_LBD > + do_div(capacity, divisor); > +#else > + capacity /= divisor; > +#endif > + return (u32) capacity; > +}

Please use sector_div() instead. It exists for a reason.

Mark> Thanks for finding this. I have enclosed a change using your Mark> suggestion.

sector_div(a, b) is just like do_div(a, b) -- it returns the remainder, and sets a to a/b which is not reflected in your patch...

--
Dr Peter Chubb [email protected]
You are lost in a maze of BitKeeper repositories, all almost the same.

#2 lore raw
Quoted 13 lines · Peter Chubb
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Mark" == Mark Haverkamp <[email protected]> writes:

Quoted 8 lines · Christoph Hellwig
Quoted 8 lines

On Fri, Dec 06, 2002 at 07:45:42AM -0800, Mark Haverkamp wrote: > +/** > + * Convert capacity to cylinders > + * accounting for the fact capacity could be a 64 bit value > + * > + */ > +static inline u32 cap_to_cyls(sector_t capacity, u32 divisor) > +{ > +#ifdef CONFIG_LBD > + do_div(capacity, divisor); > +#else > + capacity /= divisor; > +#endif > + return (u32) capacity; > +}

Please use sector_div() instead. It exists for a reason.

Quoted 7 lines

Mark> Thanks for finding this. I have enclosed a change using your Mark> suggestion.

sector_div(a, b) is just like do_div(a, b) -- it returns the remainder, and sets a to a/b which is not reflected in your patch...

oops, I didn't look closely enough at the sector_div code.

Signature · 1 line
Mark Haverkamp <[email protected]>