mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Evgeny Polyakov <johnpol@2ka.mipt.ru>
To: Bob McElrath <mcelrath@draal.physics.wisc.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: basic module bug
Date: Sat, 25 Aug 2001 23:04:09 +0400	[thread overview]
Message-ID: <200108251903.f7PJ3Zl21152@www.2ka.mipt.ru> (raw)
In-Reply-To: <20010825105645.T21497@draal.physics.wisc.edu>
In-Reply-To: <20010825005957.Q21497@draal.physics.wisc.edu> <200108251122.f7PBMvl17221@www.2ka.mipt.ru> <20010825102756.R21497@draal.physics.wisc.edu> <20010825105645.T21497@draal.physics.wisc.edu>

Hello.

On Sat, 25 Aug 2001 10:56:45 -0500
Bob McElrath <mcelrath@draal.physics.wisc.edu> wrote:

BM> Where can I find a "skeleton" kernel module for comparison?

You wrote it some strins below.

BM> Here's a simpler case more compatible with the options passed to gcc
BM> when the kernel is compiled:

BM> /* test module.  Compile with: gcc -c -I/usr/src/linux/include
BM> * -D__KERNEL__ -DMODULE test.c  */
BM> #include <linux/module.h>
BM> #include <linux/kernel.h>
BM> #include <asm/current.h>
BM> #ifdef MODULE
BM> int init_module(void)
BM> #else
BM> int test_init(void)
BM> #endif
BM> {
BM> return 0;
BM> }
BM> #ifdef MODULE
BM> void cleanup_module(void)
BM> {
BM> }
BM> #endif

BM> (0)<mcelrath@draal:/home/mcelrath> gcc -c -I/usr/src/linux/include
-D__KERNEL__
BM> -DMODULE test.c
BM> In file included from test.c:5:
BM> /usr/src/linux/include/asm/current.h:4: warning: call-clobbered
register
BM> used for global register variable

[s0mbre@Sombre /tmp]$ gcc ./test.c -c -o ./test.o -D__KERNEL__ -DMODULE
-I/usr/src/linux/include
[s0mbre@Sombre /tmp]$ 

All is OK.

BM> Yet a simpler case:

BM> #include <asm/current.h>
BM> int main() {}

[s0mbre@Sombre /tmp]$ gcc ./test1.c -o ./test1
[s0mbre@Sombre /tmp]$ cat ./test1.c
#include <asm/current.h>
int main()
        {}
[s0mbre@Sombre /tmp]$

BM> Generates the same warning message.  Why does this message not occur
BM> when compiling the kernel?

I have no problem.
But if i would have this problem, i 
a) rewrite include dir and check symlink
b) reinstall system :)

BM> Cheers,
BM> -- Bob

---
WBR. //s0mbre

  parent reply	other threads:[~2001-08-25 19:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-25  5:59 Bob McElrath
2001-08-25 11:21 ` Evgeny Polyakov
2001-08-25 15:27   ` Bob McElrath
2001-08-25 15:56     ` Bob McElrath
2001-08-25 19:04     ` Evgeny Polyakov [this message]
2001-08-25 21:03       ` Bob McElrath

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=200108251903.f7PJ3Zl21152@www.2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcelrath@draal.physics.wisc.edu \
    /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®