09 Nov, 2011

1 commit


21 Jul, 2011

1 commit


24 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    b43: fix comment typo reqest -> request
    Haavard Skinnemoen has left Atmel
    cris: typo in mach-fs Makefile
    Kconfig: fix copy/paste-ism for dell-wmi-aio driver
    doc: timers-howto: fix a typo ("unsgined")
    perf: Only include annotate.h once in tools/perf/util/ui/browsers/annotate.c
    md, raid5: Fix spelling error in comment ('Ofcourse' --> 'Of course').
    treewide: fix a few typos in comments
    regulator: change debug statement be consistent with the style of the rest
    Revert "arm: mach-u300/gpio: Fix mem_region resource size miscalculations"
    audit: acquire creds selectively to reduce atomic op overhead
    rtlwifi: don't touch with treewide double semicolon removal
    treewide: cleanup continuations and remove logging message whitespace
    ath9k_hw: don't touch with treewide double semicolon removal
    include/linux/leds-regulator.h: fix syntax in example code
    tty: fix typo in descripton of tty_termios_encode_baud_rate
    xtensa: remove obsolete BKL kernel option from defconfig
    m68k: fix comment typo 'occcured'
    arch:Kconfig.locks Remove unused config option.
    treewide: remove extra semicolons
    ...

    Linus Torvalds
     

20 May, 2011

1 commit


10 May, 2011

1 commit


08 Apr, 2011

1 commit


01 Apr, 2011

1 commit


31 Mar, 2011

1 commit


23 Mar, 2011

1 commit

  • There may be multiple ways of controlling the backlight on a given
    machine. Allow drivers to expose the type of interface they are
    providing, making it possible for userspace to make appropriate policy
    decisions.

    Signed-off-by: Matthew Garrett
    Cc: Richard Purdie
    Cc: Chris Wilson
    Cc: David Airlie
    Cc: Alex Deucher
    Cc: Ben Skeggs
    Cc: Zhang Rui
    Cc: Len Brown
    Cc: Jesse Barnes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Garrett
     

18 Mar, 2011

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (62 commits)
    powerpc/85xx: Fix signedness bug in cache-sram
    powerpc/fsl: 85xx: document cache sram bindings
    powerpc/fsl: define binding for fsl mpic interrupt controllers
    powerpc/fsl_msi: Handle msi-available-ranges better
    drivers/serial/ucc_uart.c: Add of_node_put to avoid memory leak
    powerpc/85xx: Fix SPE float to integer conversion failure
    powerpc/85xx: Update sata controller compatible for p1022ds board
    ATA: Add FSL sata v2 controller support
    powerpc/mpc8xxx_gpio: simplify searching for 'fsl, qoriq-gpio' compatiable
    powerpc/8xx: remove obsolete mgsuvd board
    powerpc/82xx: rename and update mgcoge board support
    powerpc/83xx: rename and update kmeter1
    powerpc/85xx: Workaroudn e500 CPU erratum A005
    powerpc/fsl_pci: Add support for FSL PCIe controllers v2.x
    powerpc/85xx: Fix writing to spin table 'cpu-release-addr' on ppc64e
    powerpc/pseries: Disable MSI using new interface if possible
    powerpc: Enable GENERIC_HARDIRQS_NO_DEPRECATED.
    powerpc: core irq_data conversion.
    powerpc: sysdev/xilinx_intc irq_data conversion.
    powerpc: sysdev/uic irq_data conversion.
    ...

    Fix up conflicts in arch/powerpc/sysdev/fsl_msi.c (due to getting rid of
    of_platform_driver in arch/powerpc)

    Linus Torvalds
     

02 Mar, 2011

1 commit

  • The following warning was seen building rack-meter.c

    WARNING: drivers/built-in.o(.text+0xac784): Section mismatch in reference from the function rackmeter_shutdown() to the function .devexit.text:rackmeter_stop_cpu_sniffer()
    The function rackmeter_shutdown() references a function in an exit section.
    Often the function rackmeter_stop_cpu_sniffer() has valid usage outside the exit section
    and the fix is to remove the __devexit annotation of rackmeter_stop_cpu_sniffer.

    This patch resolves the warning by removing the __devexit annotation from
    rackmeter_stop_cpu_sniffer().

    Signed-off-by: Grant Likely
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Benjamin Herrenschmidt

    Grant Likely
     

28 Feb, 2011

1 commit


21 Jan, 2011

1 commit


14 Jan, 2011

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    Documentation/trace/events.txt: Remove obsolete sched_signal_send.
    writeback: fix global_dirty_limits comment runtime -> real-time
    ppc: fix comment typo singal -> signal
    drivers: fix comment typo diable -> disable.
    m68k: fix comment typo diable -> disable.
    wireless: comment typo fix diable -> disable.
    media: comment typo fix diable -> disable.
    remove doc for obsolete dynamic-printk kernel-parameter
    remove extraneous 'is' from Documentation/iostats.txt
    Fix spelling milisec -> ms in snd_ps3 module parameter description
    Fix spelling mistakes in comments
    Revert conflicting V4L changes
    i7core_edac: fix typos in comments
    mm/rmap.c: fix comment
    sound, ca0106: Fix assignment to 'channel'.
    hrtimer: fix a typo in comment
    init/Kconfig: fix typo
    anon_inodes: fix wrong function name in comment
    fix comment typos concerning "consistent"
    poll: fix a typo in comment
    ...

    Fix up trivial conflicts in:
    - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
    - fs/ext4/ext4.h

    Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.

    Linus Torvalds
     

12 Jan, 2011

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (72 commits)
    powerpc/pseries: Fix build of topology stuff without CONFIG_NUMA
    powerpc/pseries: Fix VPHN build errors on non-SMP systems
    powerpc/83xx: add mpc8308_p1m DMA controller device-tree node
    powerpc/83xx: add DMA controller to mpc8308 device-tree node
    powerpc/512x: try to free dma descriptors in case of allocation failure
    powerpc/512x: add MPC8308 dma support
    powerpc/512x: fix the hanged dma transfer issue
    powerpc/512x: scatter/gather dma fix
    powerpc/powermac: Make auto-loading of therm_pm72 possible
    of/address: Use propper endianess in get_flags
    powerpc/pci: Use printf extension %pR for struct resource
    powerpc: Remove unnecessary casts of void ptr
    powerpc: Disable VPHN polling during a suspend operation
    powerpc/pseries: Poll VPA for topology changes and update NUMA maps
    powerpc: iommu: Add device name to iommu error printks
    powerpc: Record vma->phys_addr in ioremap()
    powerpc: Update compat_arch_ptrace
    powerpc: Fix PPC_PTRACE_SETHWDEBUG on PPC_BOOK3S
    powerpc/time: printk time stamp init not correct
    powerpc: Minor cleanups for machdep.h
    ...

    Linus Torvalds
     

11 Jan, 2011

1 commit


08 Jan, 2011

2 commits

  • * 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (33 commits)
    usb: don't use flush_scheduled_work()
    speedtch: don't abuse struct delayed_work
    media/video: don't use flush_scheduled_work()
    media/video: explicitly flush request_module work
    ioc4: use static work_struct for ioc4_load_modules()
    init: don't call flush_scheduled_work() from do_initcalls()
    s390: don't use flush_scheduled_work()
    rtc: don't use flush_scheduled_work()
    mmc: update workqueue usages
    mfd: update workqueue usages
    dvb: don't use flush_scheduled_work()
    leds-wm8350: don't use flush_scheduled_work()
    mISDN: don't use flush_scheduled_work()
    macintosh/ams: don't use flush_scheduled_work()
    vmwgfx: don't use flush_scheduled_work()
    tpm: don't use flush_scheduled_work()
    sonypi: don't use flush_scheduled_work()
    hvsi: don't use flush_scheduled_work()
    xen: don't use flush_scheduled_work()
    gdrom: don't use flush_scheduled_work()
    ...

    Fixed up trivial conflict in drivers/media/video/bt8xx/bttv-input.c
    as per Tejun.

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (58 commits)
    Input: wacom_w8001 - support pen or touch only devices
    Input: wacom_w8001 - use __set_bit to set keybits
    Input: bu21013_ts - fix misuse of logical operation in place of bitop
    Input: i8042 - add Acer Aspire 5100 to the Dritek list
    Input: wacom - add support for digitizer in Lenovo W700
    Input: psmouse - disable the synaptics extension on OLPC machines
    Input: psmouse - fix up Synaptics comment
    Input: synaptics - ignore bogus mt packet
    Input: synaptics - add multi-finger and semi-mt support
    Input: synaptics - report clickpad property
    input: mt: Document interface updates
    Input: fix double equality sign in uevent
    Input: introduce device properties
    hid: egalax: Add support for Wetab (726b)
    Input: include MT library as source for kerneldoc
    MAINTAINERS: Update input-mt entry
    hid: egalax: Add support for Samsung NB30 netbook
    hid: egalax: Document the new devices in Kconfig
    hid: egalax: Add support for Wetab
    hid: egalax: Convert to MT slots
    ...

    Fixed up trivial conflict in drivers/input/keyboard/Kconfig

    Linus Torvalds
     

24 Dec, 2010

1 commit


23 Dec, 2010

1 commit


15 Dec, 2010

1 commit

  • cancel_rearming_delayed_work[queue]() has been superceded by
    cancel_delayed_work_sync() quite some time ago. Convert all the
    in-kernel users. The conversions are completely equivalent and
    trivial.

    Signed-off-by: Tejun Heo
    Acked-by: "David S. Miller"
    Acked-by: Greg Kroah-Hartman
    Acked-by: Evgeniy Polyakov
    Cc: Jeff Garzik
    Cc: Benjamin Herrenschmidt
    Cc: Mauro Carvalho Chehab
    Cc: netdev@vger.kernel.org
    Cc: Anton Vorontsov
    Cc: David Woodhouse
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Alex Elder
    Cc: xfs-masters@oss.sgi.com
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Andrew Morton
    Cc: netfilter-devel@vger.kernel.org
    Cc: Trond Myklebust
    Cc: linux-nfs@vger.kernel.org

    Tejun Heo
     

09 Dec, 2010

1 commit

  • The therm_pm72 driver, used on the PowerMac G5 range, cannot be
    auto-loaded, since the driver itself creates both the device node
    and the driver instance.

    Moving the device node creation to the platform setup code and
    adding the necessary MODULE_DEVICE_TABLE() information allows the
    driver to be automatically loaded by udev on any semi-modern
    distribution.

    It "fixes" a major source of problem on G5 machines where the
    driver wasn't explicitely loaded by default, and the system
    would automatically shutdown under load.

    Tested on an Xserve G5.

    Signed-off-by: Marc Zyngier
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Benjamin Herrenschmidt

    Marc Zyngier
     

03 Dec, 2010

1 commit

  • It's not useful to build LED triggers when there's no LEDs that can be
    triggered by them. Therefore, fix up the dependencies so that this
    cannot happen, and fix a few users that select triggers to depend on
    LEDS_CLASS as well (there is also one user that also selects LEDS_CLASS,
    which is OK).

    Signed-off-by: Johannes Berg
    Reported-by: Randy Dunlap
    Acked-by: Randy Dunlap
    Tested-by: Ingo Molnar
    Cc: Arnd Hannemann
    Cc: Michal Hocko
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     

29 Nov, 2010

1 commit


16 Nov, 2010

2 commits

  • While at it, fix two checkpatch errors.
    Several non-const struct instances constified by this patch were added after
    the introduction of platform_suspend_ops in checkpatch.pl's list of "should
    be const" structs (79404849e90a41ea2109bd0e2f7c7164b0c4ce73).

    Patch against mainline.
    Inspired by hunks of the grsecurity patch, updated for newer kernels.

    Signed-off-by: Lionel Debroux
    Acked-by: Ingo Molnar
    Signed-off-by: Jiri Kosina

    Lionel Debroux
     
  • backlight_device_register has been expecting a const "ops" argument, and using
    it as such, since 9905a43b2d563e6f89e4c63c4278ada03f2ebb14. Let's make the
    remaining backlight_ops instances const.

    Inspired by hunks of the grsecurity patch, updated for newer kernels.

    Signed-off-by: Lionel Debroux
    Acked-by: Ingo Molnar
    Signed-off-by: Jiri Kosina

    Lionel Debroux
     

12 Nov, 2010

2 commits

  • Fix these warnings:

    drivers/macintosh/adb-iop.c: In function `adb_iop_complete':
    drivers/macintosh/adb-iop.c:85: warning: comparison of distinct pointer types lacks a cast
    drivers/macintosh/adb-iop.c:92: warning: comparison of distinct pointer types lacks a cast
    drivers/macintosh/adb-iop.c: In function ¡adb_iop_listen¢:
    drivers/macintosh/adb-iop.c:111: warning: comparison of distinct pointer types lacks a cast
    drivers/macintosh/adb-iop.c:151: warning: comparison of distinct pointer types lacks a cast

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • We need to add appropriate locking when toggling mac mouse emulation
    on and off to ensure that input device and handler are in consistent
    state.

    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

29 Oct, 2010

1 commit

  • The ams driver isn't a hardware monitoring driver, so it shouldn't
    live under driver/hwmon. drivers/macintosh seems much more
    appropriate, as the driver is only useful on PowerBooks and iBooks.

    Signed-off-by: Jean Delvare
    Cc: Guenter Roeck
    Cc: Stelian Pop
    Cc: Michael Hanselmann
    Cc: Benjamin Herrenschmidt
    Cc: Grant Likely

    Jean Delvare
     

27 Oct, 2010

1 commit

  • Use the new {max,min}3 macros to save some cycles and bytes on the stack.
    This patch substitutes trivial nested macros with their counterpart.

    Signed-off-by: Hagen Paul Pfeifer
    Cc: Joe Perches
    Cc: Ingo Molnar
    Cc: Hartley Sweeten
    Cc: Russell King
    Cc: Benjamin Herrenschmidt
    Cc: Thomas Gleixner
    Cc: Herbert Xu
    Cc: Roland Dreier
    Cc: Sean Hefty
    Cc: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hagen Paul Pfeifer
     

25 Oct, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     

23 Oct, 2010

2 commits

  • * 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    vfs: make no_llseek the default
    vfs: don't use BKL in default_llseek
    llseek: automatically add .llseek fop
    libfs: use generic_file_llseek for simple_attr
    mac80211: disallow seeks in minstrel debug code
    lirc: make chardev nonseekable
    viotape: use noop_llseek
    raw: use explicit llseek file operations
    ibmasmfs: use generic_file_llseek
    spufs: use llseek in all file operations
    arm/omap: use generic_file_llseek in iommu_debug
    lkdtm: use generic_file_llseek in debugfs
    net/wireless: use generic_file_llseek in debugfs
    drm: use noop_llseek

    Linus Torvalds
     
  • * 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    block: autoconvert trivial BKL users to private mutex
    drivers: autoconvert trivial BKL users to private mutex
    ipmi: autoconvert trivial BKL users to private mutex
    mac: autoconvert trivial BKL users to private mutex
    mtd: autoconvert trivial BKL users to private mutex
    scsi: autoconvert trivial BKL users to private mutex

    Fix up trivial conflicts (due to addition of private mutex right next to
    deletion of a version string) in drivers/char/pcmcia/cm40[04]0_cs.c

    Linus Torvalds
     

22 Oct, 2010

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (71 commits)
    powerpc/44x: Update ppc44x_defconfig
    powerpc/watchdog: Make default timeout for Book-E watchdog a Kconfig option
    fsl_rio: Add comments for sRIO registers.
    powerpc/fsl-booke: Add e55xx (64-bit) smp defconfig
    powerpc/fsl-booke: Add p5020 DS board support
    powerpc/fsl-booke64: Use TLB CAMs to cover linear mapping on FSL 64-bit chips
    powerpc/fsl-booke: Add support for FSL Arch v1.0 MMU in setup_page_sizes
    powerpc/fsl-booke: Add support for FSL 64-bit e5500 core
    powerpc/85xx: add cache-sram support
    powerpc/85xx: add ngPIXIS FPGA device tree node to the P1022DS board
    powerpc: Fix compile error with paca code on ppc64e
    powerpc/fsl-booke: Add p3041 DS board support
    oprofile/fsl emb: Don't set MSR[PMM] until after clearing the interrupt.
    powerpc/fsl-booke: Add PCI device ids for P2040/P3041/P5010/P5020 QoirQ chips
    powerpc/mpc8xxx_gpio: Add support for 'qoriq-gpio' controllers
    powerpc/fsl_booke: Add support to boot from core other than 0
    powerpc/p1022: Add probing for individual DMA channels
    powerpc/fsl_soc: Search all global-utilities nodes for rstccr
    powerpc: Fix invalid page flags in create TLB CAM path for PTE_64BIT
    powerpc/mpc83xx: Support for MPC8308 P1M board
    ...

    Fix up conflict with the generic irq_work changes in arch/powerpc/kernel/time.c

    Linus Torvalds
     

18 Oct, 2010

1 commit

  • The patch below updates broken web addresses in the kernel

    Signed-off-by: Justin P. Mattock
    Cc: Maciej W. Rozycki
    Cc: Geert Uytterhoeven
    Cc: Finn Thain
    Cc: Randy Dunlap
    Cc: Matt Turner
    Cc: Dimitry Torokhov
    Cc: Mike Frysinger
    Acked-by: Ben Pfaff
    Acked-by: Hans J. Koch
    Reviewed-by: Finn Thain
    Signed-off-by: Jiri Kosina

    Justin P. Mattock
     

15 Oct, 2010

1 commit

  • All file_operations should get a .llseek operation so we can make
    nonseekable_open the default for future file operations without a
    .llseek pointer.

    The three cases that we can automatically detect are no_llseek, seq_lseek
    and default_llseek. For cases where we can we can automatically prove that
    the file offset is always ignored, we use noop_llseek, which maintains
    the current behavior of not returning an error from a seek.

    New drivers should normally not use noop_llseek but instead use no_llseek
    and call nonseekable_open at open time. Existing drivers can be converted
    to do the same when the maintainer knows for certain that no user code
    relies on calling seek on the device file.

    The generated code is often incorrectly indented and right now contains
    comments that clarify for each added line why a specific variant was
    chosen. In the version that gets submitted upstream, the comments will
    be gone and I will manually fix the indentation, because there does not
    seem to be a way to do that using coccinelle.

    Some amount of new code is currently sitting in linux-next that should get
    the same modifications, which I will do at the end of the merge window.

    Many thanks to Julia Lawall for helping me learn to write a semantic
    patch that does all this.

    ===== begin semantic patch =====
    // This adds an llseek= method to all file operations,
    // as a preparation for making no_llseek the default.
    //
    // The rules are
    // - use no_llseek explicitly if we do nonseekable_open
    // - use seq_lseek for sequential files
    // - use default_llseek if we know we access f_pos
    // - use noop_llseek if we know we don't access f_pos,
    // but we still want to allow users to call lseek
    //
    @ open1 exists @
    identifier nested_open;
    @@
    nested_open(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ read disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {

    }

    @ read_no_fpos disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ write @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {

    }

    @ write_no_fpos @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ fops0 @
    identifier fops;
    @@
    struct file_operations fops = {
    ...
    };

    @ has_llseek depends on fops0 @
    identifier fops0.fops;
    identifier llseek_f;
    @@
    struct file_operations fops = {
    ...
    .llseek = llseek_f,
    ...
    };

    @ has_read depends on fops0 @
    identifier fops0.fops;
    identifier read_f;
    @@
    struct file_operations fops = {
    ...
    .read = read_f,
    ...
    };

    @ has_write depends on fops0 @
    identifier fops0.fops;
    identifier write_f;
    @@
    struct file_operations fops = {
    ...
    .write = write_f,
    ...
    };

    @ has_open depends on fops0 @
    identifier fops0.fops;
    identifier open_f;
    @@
    struct file_operations fops = {
    ...
    .open = open_f,
    ...
    };

    // use no_llseek if we call nonseekable_open
    ////////////////////////////////////////////
    @ nonseekable1 depends on !has_llseek && has_open @
    identifier fops0.fops;
    identifier nso ~= "nonseekable_open";
    @@
    struct file_operations fops = {
    ... .open = nso, ...
    +.llseek = no_llseek, /* nonseekable */
    };

    @ nonseekable2 depends on !has_llseek @
    identifier fops0.fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ... .open = open_f, ...
    +.llseek = no_llseek, /* open uses nonseekable */
    };

    // use seq_lseek for sequential files
    /////////////////////////////////////
    @ seq depends on !has_llseek @
    identifier fops0.fops;
    identifier sr ~= "seq_read";
    @@
    struct file_operations fops = {
    ... .read = sr, ...
    +.llseek = seq_lseek, /* we have seq_read */
    };

    // use default_llseek if there is a readdir
    ///////////////////////////////////////////
    @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier readdir_e;
    @@
    // any other fop is used that changes pos
    struct file_operations fops = {
    ... .readdir = readdir_e, ...
    +.llseek = default_llseek, /* readdir is present */
    };

    // use default_llseek if at least one of read/write touches f_pos
    /////////////////////////////////////////////////////////////////
    @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read.read_f;
    @@
    // read fops use offset
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = default_llseek, /* read accesses f_pos */
    };

    @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ... .write = write_f, ...
    + .llseek = default_llseek, /* write accesses f_pos */
    };

    // Use noop_llseek if neither read nor write accesses f_pos
    ///////////////////////////////////////////////////////////

    @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    identifier write_no_fpos.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ...
    .write = write_f,
    .read = read_f,
    ...
    +.llseek = noop_llseek, /* read and write both use no f_pos */
    };

    @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write_no_fpos.write_f;
    @@
    struct file_operations fops = {
    ... .write = write_f, ...
    +.llseek = noop_llseek, /* write uses no f_pos */
    };

    @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    @@
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = noop_llseek, /* read uses no f_pos */
    };

    @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    @@
    struct file_operations fops = {
    ...
    +.llseek = noop_llseek, /* no read or write fn */
    };
    ===== End semantic patch =====

    Signed-off-by: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann
     

12 Oct, 2010

1 commit


16 Sep, 2010

1 commit

  • All these files use the big kernel lock in a trivial
    way to serialize their private file operations,
    typically resulting from an earlier semi-automatic
    pushdown from VFS.

    None of these drivers appears to want to lock against
    other code, and they all use the BKL as the top-level
    lock in their file operations, meaning that there
    is no lock-order inversion problem.

    Consequently, we can remove the BKL completely,
    replacing it with a per-file mutex in every case.
    Using a scripted approach means we can avoid
    typos.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: linuxppc-dev@ozlabs.org

    Arnd Bergmann
     

02 Sep, 2010

1 commit

  • Add a call to of_node_put in the error handling code following a call to
    of_find_node_by_path.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r exists@
    local idexpression x;
    expression E,E1;
    statement S;
    @@

    *x =
    (of_find_node_by_path
    |of_find_node_by_name
    |of_find_node_by_phandle
    |of_get_parent
    |of_get_next_parent
    |of_get_next_child
    |of_find_compatible_node
    |of_match_node
    )(...);
    ...
    if (x == NULL) S
    ;
    |
    * return ...;
    )
    }
    ...>
    of_node_put(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Benjamin Herrenschmidt

    Julia Lawall
     

24 Aug, 2010

1 commit