mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: create_proc_entry and !CONFIG_PROC_FS
Date: Sun, 31 Aug 2003 14:40:33 -0700	[thread overview]
Message-ID: <20030831144033.6f9d8708.akpm@osdl.org> (raw)
In-Reply-To: <20030831150632.GU7038@fs.tum.de>

Adrian Bunk <bunk@fs.tum.de> wrote:
>
> Hi,
> 
> I've observed a possible problem with create_proc_entry and 
> !CONFIG_PROC_FS.
> 
> If !CONFIG_PROC_FS include/linux/proc_fs.h includes a dummy 
> create_proc_entry that simply returns NULL.
> 
> Unfortunately, many callers of this function do things like e.g.
> 
> static int __init br2684_init(void)
> {
>         struct proc_dir_entry *p;
>         if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL)
>                 return -ENOMEM;
>         p->proc_fops = &br2684_proc_operations;
>         br2684_ioctl_set(br2684_ioctl);
>         return 0;
> }
> 
> 
> IOW, the dummy create_proc_entry fixes the compilation but the init 
> function always returns -ENOMEM if !CONFIG_PROC_FS.
> 
> Is there any better solution than removing the dummy create_proc_entry 
> and #ifdef'ing all places where it's used?

The normal fix would be to sprinkle ifdefs throughout the driver itself.

You need to lok at the driver and ask yourself "is anyone ever going to want
to use this in a no-procfs system".  Probably, the answer is always "no". 
In which case appropriate fixes would be to ignore the problem, or disable
the driver in config if !CONFIG_PROC_FS.


  reply	other threads:[~2003-08-31 21:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-31 15:06 Adrian Bunk
2003-08-31 21:40 ` Andrew Morton [this message]
2003-08-31 21:45   ` Adrian Bunk

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=20030831144033.6f9d8708.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=bunk@fs.tum.de \
    --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®