mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Beregalov <a.beregalov@gmail.com>
To: joern@logfs.org, linux-kernel@vger.kernel.org
Subject: LogFS: confused with using s64 and u64
Date: Sat, 9 Aug 2008 01:12:36 +0400	[thread overview]
Message-ID: <20080808211236.GB5093@orion> (raw)

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?

             reply	other threads:[~2008-08-08 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 21:12 Alexander Beregalov [this message]
2008-08-09 11:16 ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080808211236.GB5093@orion \
    --to=a.beregalov@gmail.com \
    --cc=joern@logfs.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®