linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert T. Johnson" <rtjohnso@eecs.berkeley.edu>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: scottm@somanetworks.com, greg@kroah.com, rgooch@atnf.csiro.au,
	mingo@redhat.com, pavel@suse.cz
Subject: 2.6.0-test6: a few __init bugs
Date: 29 Sep 2003 14:58:12 -0700	[thread overview]
Message-ID: <1064872693.5733.42.camel@dooby.cs.berkeley.edu> (raw)

Here are several places where non-__init functions call __init functions
or reference __init data.  I've looked at all of them and believe that
they are all either legitimate bugs or opportunities to declare more
code as __init to save memory.  Thanks for looking over these, and sorry
if I've made any mistakes.

Best,
Rob

P.S. All these bugs were found with Cqual, the bug-finding tool
developed by Jeff Foster, John Kodumal, and many others, and available
at http://www.cs.umd.edu/~jfoster/cqual/, although the currently
released version of cqual only has primitive support for 
__init bug-finding.

Linux 2.6.0-test6:

** Possible bug:
** drivers/pci/quirks.c:asus_hides_smbus_hostbridge()                  (__init)
   in table: drivers/pci/quirks.c:pci_fixups                           (not __init)
     indirect call f->hook(): drivers/pci/quirks.c:pci_do_fixups()     (not __init)
       called by: drivers/pci/quirks.c:pci_fixup_device()              (not __init)
         called by: drivers/pci/probe.c:pci_scan_slot()                (not __init)
           called by lots of hotplug enable() functions, e.g.
           drivers/pci/hotplug/ibmphp_core.c:ibm_configure_device()    (not __init)
             called by drivers/pci/hotplug/ibmphp_core.c:enable_slot() (not __init)

Note: It looks like this may have been originally designed to initialize the
      pci bus at startup, but has been re-used in the hotplug code, which means it 
      can be run after the __init segments have gone away.

Fix: Delete all the __init declarations on the quirks hooks.


** Code can be declared __init:
** arch/i386/kernel/cpu/mtrr/generic.c:get_fixed_ranges()              (__init)
     called by: arch/i386/kernel/cpu/mtrr/generic.c:get_mtrr_state()   (not __init)
       only caller: arch/i386/kernel/cpu/mtrr/main.c:init_other_cpus() (not __init)
         only caller: arch/i386/kernel/cpu/mtrr/main.c:mtrr_init()     (__init)
Fix: Declare get_mtrr_state()  __init
Fix: Declare init_other_cpus() __init


** Code can be declared __init:
** arch/i386/kernel/io_apic.c:io_apic_set_pci_routing() (not __init)
     all callers are __init
Fix: Declare io_apic_set_pci_routing() __init


** Code should be declared __init?
** name_to_dev_t()                                                     (__init)
     called by kernel/power/swsusp.c:read_suspend_image()              (not __init)
       called by kernel/power/swsusp.c:software_resume()               (not __init)
Fix: declare read_suspend_image() __init
Fix: declare software_resume() __init

Note: read_suspend_image() in pmdisk.c is declared __init.



             reply	other threads:[~2003-09-29 21:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-29 21:58 Robert T. Johnson [this message]
2003-09-29 22:07 ` 2.6.0-test6: a few __init bugs Pavel Machek
2003-09-29 22:11 ` Greg KH
     [not found]   ` <1064946634.5734.106.camel@dooby.cs.berkeley.edu>
     [not found]     ` <20030930191117.GA20054@kroah.com>
2003-09-30 21:20       ` Robert T. Johnson
2003-09-30 21:25         ` Greg KH
2003-09-30 21:42           ` Robert T. Johnson
2003-09-30 22:10             ` Greg KH
2003-10-01 21:26             ` bill davidsen

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=1064872693.5733.42.camel@dooby.cs.berkeley.edu \
    --to=rtjohnso@eecs.berkeley.edu \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@suse.cz \
    --cc=rgooch@atnf.csiro.au \
    --cc=scottm@somanetworks.com \
    /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;
as well as URLs for NNTP newsgroup(s).