All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Eduard-Gabriel Munteanu <maxdamage@aladin.ro>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] UML: fix missing non-blocking I/O, now DEBUG_SHIRQ works
Date: Mon, 11 Jun 2007 20:48:04 -0400	[thread overview]
Message-ID: <20070612004804.GA9871@c2.user-mode-linux.org> (raw)
In-Reply-To: <466DCF1D.9050508@aladin.ro>

On Tue, Jun 12, 2007 at 01:39:25AM +0300, Eduard-Gabriel Munteanu wrote:
> The cast isn't done right. Doing "fd = (long) dev_id;" doesn't help, 
> since you pass fd to mconsole_get_request() as is. And 
> mconsole_get_request() expects an integer:
> int mconsole_get_request(int fd, struct mc_request *req)

gcc will trim a long to an integer correctly.  You can pass a long to
an integer without casting.

> This will generate at least a warning on arches where sizeof(int) != 
> sizeof(long). 

No it won't.  UML builds without warnings here on x86_64.

> And by the way, AFAIK, GCC has the habit of breaking compatibility with 
> some userspace apps when a new GCC major version is released. And, 
> AFAIK, they're moving towards standards, so relying on GCC's 
> "guarantees" may backfire.

The GCC guarantee I'm talking about it LP64 - I'm highly confident
that's not changing any time soon.

> >>You're calling glibc functions
> >>with that fd as a parameter. On some arches, compiling will issue
> >>warnings or simply fail. 
> >
> >Which ones?
> >
> 
> An example is sparc64:
> quote from
> >>http://lxr.linux.no/source/include/asm-sparc64/types.h#L49

What warnings does this produce?  These are the same sizes as x86_64
(and every other 64-bit arch that Linux runs on, I bet), where this
code compiles without warning.

> Really, a kmalloc() isn't such a big deal, it only happens once and 
> we're not in interrupt context.

It's not the runtime cost - it's the extra code.

> One the other hand, ensuring safety and 
> portability on other arches is something that needs to be taken care
> of.

You haven't demonstrated any safety or portability problems yet.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

  reply	other threads:[~2007-06-12  0:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-10 22:01 [PATCH 1/1] UML: fix missing non-blocking I/O, now DEBUG_SHIRQ works Eduard-Gabriel Munteanu
2007-06-11 17:31 ` Jeff Dike
2007-06-11 19:39   ` Eduard-Gabriel Munteanu
2007-06-11 21:16     ` Jeff Dike
2007-06-11 22:39       ` Eduard-Gabriel Munteanu
2007-06-12  0:48         ` Jeff Dike [this message]
2007-06-12  5:44           ` Eduard-Gabriel Munteanu
2007-06-12 13:26             ` Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2007-06-10 22:20 Eduard-Gabriel Munteanu
2007-06-11 10:26 ` Eduard-Gabriel Munteanu

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=20070612004804.GA9871@c2.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxdamage@aladin.ro \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.