• Immutable Page
  • Info
  • Attachments


Remove unneeded historic code / New API conversions.

  • Code that depends on LINUX_VERSION_CODE & KERNEL_VERSION < 2.6 can be

    • deleted in most cases. (Mostly/all? done)

  • checking for NULL on probe routines for net drivers

  • get rid of init_module / cleanup_module

  • call SET_MODULE_OWNER or use .owner = THIS_MODULE instead of using

    • MOD_{INC,DEC}_USE_COUNT (none left in 2.6.22-rc4-mm2)

  • Use pci_set_drvdata() to set dev->driver_data, likewise use pci_get_drvdata() instead of reading directly.

    • . - dev->driver_data = pcigame; + pci_set_drvdata(dev, pcigame);

  • get rid of access_ok with copy_*_user get/put_user, only needed if using copy_*_user et al

  • MODULE_PARM must die:

  • convert drivers to new PCI API

  • get rid of check_region, use just request_region checking its return (2.2 request_region returned void) and now the driver init sequence is not to be serialized anymore, so races are possible (look at cardbus/pcihotplug code)

  • ALL PCI drivers should call pci_enable_device --before-- reading pdev->irq or pdev->resource[]. irq and resource[] may not have correct values until after PCI hotplug setup occurs at pci_enable_device() time. Many PCI drivers need to be evaluated and checked for this. Many of these fixed already at: http://marc.theaimsgroup.com/?l=linux-kernel&m=98449691919682&w=3

  • convert cli/sti/save_flags/save_flags_cli/restore_flags usage to accepted locking primitives; see Documentation/cli-sti-removal.txt and Documentation/spinlocks.txt for details.

  • yield() considered harmful:

  • Anything which uses sleep_on*() has a 90% chance of being broken. Fix them all, because we want to remove sleep_on() and friends.

  • Callers of schedule_timeout() who pass in an absolute constant (i.e. with no reference to HZ) may be broken, especially with a variable HZ value. Verify which behavior is intended: if the caller needs the shortest delay possible, then schedule_timeout(1) is correct and a comment can be added; if they actually need a certain amount of time, then use msleep() or schedule_timeout with an appropriate {msecs,usecs,nsecs}_to_jiffies() call.

  • Replace (un)register_ioctl32_conversion with ioctl_compat

    • [D: http://lkml.org/lkml/2005/1/5/106]

    • as of 2007/08/16 only ones left are in:

      • Documentation/scsi/ChangeLog.megaraid 
Tell others about this page:

last edited 2007-08-16 06:22:59 by PaulJimenez