From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Mikael Pettersson <mikpe@csd.uu.se>, akpm@osdl.org
Cc: dgilbert@interlog.com, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH][2.6.8-rc1-mm1] drivers/scsi/sg.c gcc341 inlining fix
Date: Wed, 14 Jul 2004 17:57:48 +0200 [thread overview]
Message-ID: <200407141757.48937.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <200407141216.i6ECGHxg008332@harpo.it.uu.se>
Hi,
On Wednesday 14 of July 2004 14:16, Mikael Pettersson wrote:
> gcc-3.4.1 errors out in 2.6.8-rc1-mm1 at drivers/scsi/sg.c:
>
> drivers/scsi/sg.c: In function `sg_ioctl':
> drivers/scsi/sg.c:209: sorry, unimplemented: inlining failed in call to
> 'sg_jif_to_ms': function body not available drivers/scsi/sg.c:930: sorry,
> unimplemented: called from here
> make[2]: *** [drivers/scsi/sg.o] Error 1
> make[1]: *** [drivers/scsi] Error 2
> make: *** [drivers] Error 2
>
> sg_jif_to_ms() is marked inline but used defore its function
> body is available. Moving it nearer the top of sg.c (together
> with sg_ms_to_jif() for consistency) fixes the problem.
While your patch is perfectly fine I think we can do better.
I think that we may try converting sg.c to use jiffies_to_msecs()
and msecs_to_jiffies() from <linux/time.h>.
> Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
>
> --- linux-2.6.8-rc1-mm1/drivers/scsi/sg.c.~1~ 2004-07-14 12:58:34.000000000
> +0200 +++ linux-2.6.8-rc1-mm1/drivers/scsi/sg.c 2004-07-14
> 13:45:26.000000000 +0200 @@ -225,6 +225,30 @@
> #define SZ_SG_REQ_INFO sizeof(sg_req_info_t)
>
> static int
> +sg_ms_to_jif(unsigned int msecs)
> +{
> + if ((UINT_MAX / 2U) < msecs)
> + return INT_MAX; /* special case, set largest possible */
I don't understand what for is this special case.
> + else
> + return ((int) msecs <
> + (INT_MAX / 1000)) ? (((int) msecs * HZ) / 1000)
> + : (((int) msecs / 1000) * HZ);
> +}
jiffies are unsigned long, isn't this buggy on 64-bit archs?
> +static inline unsigned
> +sg_jif_to_ms(int jifs)
> +{
ditto
> + if (jifs <= 0)
> + return 0U;
> + else {
> + unsigned int j = (unsigned int) jifs;
> + return (j <
> + (UINT_MAX / 1000)) ? ((j * 1000) / HZ) : ((j / HZ) *
> + 1000);
> + }
> +}
also rounding up is missing (jiffies_to_msecs()/msecs_to_jiffies() does it)
Bartlomiej
next prev parent reply other threads:[~2004-07-14 15:52 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-14 12:16 Mikael Pettersson
2004-07-14 15:52 ` Jeff Garzik
2004-07-14 16:42 ` Adrian Bunk
2004-07-14 16:44 ` Jeff Garzik
2004-07-14 16:54 ` Adrian Bunk
2004-07-14 17:31 ` Bartlomiej Zolnierkiewicz
2004-07-14 18:33 ` Adrian Bunk
2004-07-14 18:44 ` Jeff Garzik
2004-07-14 19:06 ` Douglas Gilbert
2004-07-26 22:09 ` Andrew Morton
2004-07-14 18:34 ` Jeff Garzik
2004-07-14 18:31 ` Jeff Garzik
2004-07-14 15:57 ` Bartlomiej Zolnierkiewicz [this message]
2004-07-14 15:59 ` Jeff Garzik
2004-07-26 21:53 ` Andrew Morton
2004-07-14 17:51 Mikael Pettersson
2004-07-14 18:36 ` Jeff Garzik
2004-07-14 19:05 ` Adrian Bunk
2004-07-14 21:35 ` Andrew Morton
2004-07-14 23:39 ` Jeff Garzik
2004-07-14 22:39 ` Andrew Morton
2004-07-15 0:19 ` Matthew Wilcox
2004-07-15 5:56 ` Jens Axboe
2004-07-15 6:12 ` William Lee Irwin III
2004-07-15 15:42 ` Douglas Gilbert
2004-07-15 9:46 Mikael Pettersson
2004-07-15 13:09 ` Jeff Garzik
2004-07-15 15:58 ` Matthew Wilcox
2004-07-15 14:36 ` William Lee Irwin III
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=200407141757.48937.bzolnier@elka.pw.edu.pl \
--to=b.zolnierkiewicz@elka.pw.edu.pl \
--cc=akpm@osdl.org \
--cc=dgilbert@interlog.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mikpe@csd.uu.se \
/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®