lkml.org 
[lkml]   [2008]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectLogFS: confused with using s64 and u64
Hi Joern

I am a bit confused with mixing signed and unsigned types here:


static inline u64 dev_ofs(struct super_block *sb, u32 segno, u32 ofs)
{
return ((u64)segno << logfs_super(sb)->s_segshift) + ofs;
}

static s64 logfs_get_free_bytes(struct logfs_area *area, size_t bytes)
{
s32 ofs;
...
ofs = area->a_used_bytes;
...
return dev_ofs(area->a_sb, area->a_segno, ofs);
}

Can you please explain why do you use s64 for function which returns u64?


\
 
 \ /
  Last update: 2008-08-08 23:15    [W:0.036 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site