1. 21 8月, 2014 1 次提交
    • J
      Bluetooth: Fix hci_conn reference counting for auto-connections · f161dd41
      Johan Hedberg 提交于
      Recently the LE passive scanning and auto-connections feature was
      introduced. It uses the hci_connect_le() API which returns a hci_conn
      along with a reference count to that object. All previous users would
      tie this returned reference to some existing object, such as an L2CAP
      channel, and there'd be no leaked references this way. For
      auto-connections however the reference was returned but not stored
      anywhere, leaving established connections with one higher reference
      count than they should have.
      
      Instead of playing special tricks with hci_conn_hold/drop this patch
      associates the returned reference from hci_connect_le() with the object
      that in practice does own this reference, i.e. the hci_conn_params
      struct that caused us to initiate a connection in the first place. Once
      the connection is established or fails to establish this reference is
      removed appropriately.
      
      One extra thing needed is to call hci_pend_le_actions_clear() before
      calling hci_conn_hash_flush() so that the reference is cleared before
      the hci_conn objects are fully removed.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      f161dd41
  2. 20 8月, 2014 5 次提交
  3. 15 8月, 2014 1 次提交
  4. 12 8月, 2014 4 次提交
  5. 07 8月, 2014 29 次提交
    • L
      Merge branch 'akpm' (patchbomb from Andrew Morton) · 33caee39
      Linus Torvalds 提交于
      Merge incoming from Andrew Morton:
       - Various misc things.
       - arch/sh updates.
       - Part of ocfs2.  Review is slow.
       - Slab updates.
       - Most of -mm.
       - printk updates.
       - lib/ updates.
       - checkpatch updates.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (226 commits)
        checkpatch: update $declaration_macros, add uninitialized_var
        checkpatch: warn on missing spaces in broken up quoted
        checkpatch: fix false positives for --strict "space after cast" test
        checkpatch: fix false positive MISSING_BREAK warnings with --file
        checkpatch: add test for native c90 types in unusual order
        checkpatch: add signed generic types
        checkpatch: add short int to c variable types
        checkpatch: add for_each tests to indentation and brace tests
        checkpatch: fix brace style misuses of else and while
        checkpatch: add --fix option for a couple OPEN_BRACE misuses
        checkpatch: use the correct indentation for which()
        checkpatch: add fix_insert_line and fix_delete_line helpers
        checkpatch: add ability to insert and delete lines to patch/file
        checkpatch: add an index variable for fixed lines
        checkpatch: warn on break after goto or return with same tab indentation
        checkpatch: emit a warning on file add/move/delete
        checkpatch: add test for commit id formatting style in commit log
        checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings
        checkpatch: improve "no space after cast" test
        checkpatch: allow multiple const * types
        ...
      33caee39
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 6456a043
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
       "This fixes the most immediate fallout from yesterday's networking
        merge:
      
         1) sock_tx_timestamp() must not clear the passed in tx_flags, but
            rather add to them.  Fix from Eric Dumazet.
      
         2) The hyperv driver sendbuf region increase needs to be decreased
            slightly to handle older backends.  From KY Srinivasan.
      
         3) Fix RCU lockdep splats in netlink diag after recent hashing
            changes, from Thomas Graf.
      
         4) The new IPV6_FLOWLABEL was given a socket option number that
            overlapped with an existing IP6 tables one, breaking ip6_tables.
            Fixed by Pablo Neira Ayuso"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        netlink: hold nl_sock_hash_lock during diag dump
        tcp: md5: check md5 signature without socket lock
        net: fix USB network driver config option.
        net: reallocate new socket option number for IPV6_AUTOFLOWLABEL
        vmxnet3: fix decimal printf format specifiers prefixed with 0x
        net-timestamp: cumulative tcp timestamping fixes
        hyperv: Adjust the size of sendbuf region to support ws2008r2
        cxgb4: Fix for SR-IOV VF initialization
        net-timestamp: sock_tx_timestamp() fix
      6456a043
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial · 158c1294
      Linus Torvalds 提交于
      Pull trivial tree changes from Jiri Kosina:
       "Summer edition of trivial tree updates"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
        doc: fix two typos in watchdog-api.txt
        irq-gic: remove file name from heading comment
        MAINTAINERS: Add miscdevice.h to file list for char/misc drivers.
        scsi: mvsas: mv_sas.c: Fix for possible null pointer dereference
        doc: replace "practise" with "practice" in Documentation
        befs: remove check for CONFIG_BEFS_RW
        scsi: doc: fix 'SCSI_NCR_SETUP_MASTER_PARITY'
        drivers/usb/phy/phy.c: remove a leading space
        mfd: fix comment
        cpuidle: fix comment
        doc: hpfall.c: fix missing null-terminate after strncpy call
        usb: doc: hotplug.txt code typos
        kbuild: fix comment in Makefile.modinst
        SH: add proper prompt to SH_MAGIC_PANEL_R2_VERSION
        ARM: msm: Remove MSM_SCM
        crypto: Remove MPILIB_EXTRA
        doc: CN: remove dead link, kerneltrap.org no longer works
        media: update reference, kerneltrap.org no longer works
        hexagon: update reference, kerneltrap.org no longer works
        doc: LSM: update reference, kerneltrap.org no longer works
        ...
      158c1294
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 172bfe09
      Linus Torvalds 提交于
      Pull HID updates from Jiri Kosina:
       "Some highlights:
      
         - hid-sony improvements of Sixaxis device support by Antonio Ospite
         - hid-hyperv driven devices can now be used as wakeup source, by
           Dexuan Cui
         - hid-lenovo driver is now more generic and supports more devices, by
           Jamie Lentin
         - hid-huion now supports wider range of tablets, by Nikolai
           Kondrashov
         - other various unsorted fixes and device ID additions"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (30 commits)
        HID: hyperv: register as a wakeup source
        HID: sony: Default initialize all elements of the LED max_brightness array to 1
        HID: huion: Fix sparse warnings
        HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed
        HID: ignore jabra gn9350e
        HID: cp2112: add I2C mode
        HID: use multi input quirk for 22b9:2968
        HID: rmi: only bind the hid-rmi driver to the mouse interface of composite USB devices
        HID: rmi: check that report ids exist in the report_id_hash before accessing their size
        HID: lenovo: Add support for Compact (BT|USB) keyboard
        HID: lenovo: Don't call function in condition, show error codes
        HID: lenovo: Prepare support for adding other devices
        HID: lenovo: Rename hid-lenovo-tpkbd to hid-lenovo
        HID: huion: Handle tablets with UC-Logic vendor ID
        HID: huion: Switch to generating report descriptor
        HID: huion: Don't ignore other interfaces
        HID: huion: Use "tablet" instead of specific model
        HID: add quirk for 0x04d9:0xa096 device
        HID: i2c-hid: call the hid driver's suspend and resume callbacks
        HID: rmi: change logging level of log messages related to unexpected reports
        ...
      172bfe09
    • L
      Merge git://www.linux-watchdog.org/linux-watchdog · a1b0a006
      Linus Torvalds 提交于
      Pull watchdog updates from Wim Van Sebroeck:
       - remove unnecessary checks after platform_get_resource()
       - fix watchdog api documentation typo's
       - imx2_wdt: adds big endianness support
       - move restart code to the sunxi watchdog driver
      
      * git://www.linux-watchdog.org/linux-watchdog:
        wdt: sunxi: Move restart code to the watchdog driver
        Documentation: fix two typos in watchdog-api.txt
        watchdog: imx2_wdt: adds big endianness support.
        watchdog: shwdt: Remove the unnecessary check of resource after platform_get_resource()
        watchdog: lantiq_wdt: Remove the un-necessary check of resource after platform_get_resource()
        watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource()
      a1b0a006
    • L
      Merge tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 77251319
      Linus Torvalds 提交于
      Pull ACPI and power management updates from Rafael Wysocki:
       "Again, ACPICA leads the pack (47 commits), followed by cpufreq (18
        commits) and system suspend/hibernation (9 commits).
      
        From the new code perspective, the ACPICA update brings ACPI 5.1 to
        the table, including a new device configuration object called _DSD
        (Device Specific Data) that will hopefully help us to operate device
        properties like Device Trees do (at least to some extent) and changes
        related to supporting ACPI on ARM.
      
        Apart from that we have hibernation changes making it use radix trees
        to store memory bitmaps which should speed up some operations carried
        out by it quite significantly.  We also have some power management
        changes related to suspend-to-idle (the "freeze" sleep state) support
        and more preliminary changes needed to support ACPI on ARM (outside of
        ACPICA).
      
        The rest is fixes and cleanups pretty much everywhere.
      
        Specifics:
      
         - ACPICA update to upstream version 20140724.  That includes ACPI 5.1
           material (support for the _CCA and _DSD predefined names, changes
           related to the DMAR and PCCT tables and ARM support among other
           things) and cleanups related to using ACPICA's header files.  A
           major part of it is related to acpidump and the core code used by
           that utility.  Changes from Bob Moore, David E Box, Lv Zheng,
           Sascha Wildner, Tomasz Nowicki, Hanjun Guo.
      
         - Radix trees for memory bitmaps used by the hibernation core from
           Joerg Roedel.
      
         - Support for waking up the system from suspend-to-idle (also known
           as the "freeze" sleep state) using ACPI-based PCI wakeup signaling
           (Rafael J Wysocki).
      
         - Fixes for issues related to ACPI button events (Rafael J Wysocki).
      
         - New device ID for an ACPI-enumerated device included into the
           Wildcat Point PCH from Jie Yang.
      
         - ACPI video updates related to backlight handling from Hans de Goede
           and Linus Torvalds.
      
         - Preliminary changes needed to support ACPI on ARM from Hanjun Guo
           and Graeme Gregory.
      
         - ACPI PNP core cleanups from Arjun Sreedharan and Zhang Rui.
      
         - Cleanups related to ACPI_COMPANION() and ACPI_HANDLE() macros
           (Rafael J Wysocki).
      
         - ACPI-based device hotplug cleanups from Wei Yongjun and Rafael J
           Wysocki.
      
         - Cleanups and improvements related to system suspend from Lan
           Tianyu, Randy Dunlap and Rafael J Wysocki.
      
         - ACPI battery cleanup from Wei Yongjun.
      
         - cpufreq core fixes from Viresh Kumar.
      
         - Elimination of a deadband effect from the cpufreq ondemand governor
           and intel_pstate driver cleanups from Stratos Karafotis.
      
         - 350MHz CPU support for the powernow-k6 cpufreq driver from Mikulas
           Patocka.
      
         - Fix for the imx6 cpufreq driver from Anson Huang.
      
         - cpuidle core and governor cleanups from Daniel Lezcano, Sandeep
           Tripathy and Mohammad Merajul Islam Molla.
      
         - Build fix for the big_little cpuidle driver from Sachin Kamat.
      
         - Configuration fix for the Operation Performance Points (OPP)
           framework from Mark Brown.
      
         - APM cleanup from Jean Delvare.
      
         - cpupower utility fixes and cleanups from Peter Senna Tschudin,
           Andrey Utkin, Himangi Saraogi, Rickard Strandqvist, Thomas
           Renninger"
      
      * tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (118 commits)
        ACPI / LPSS: add LPSS device for Wildcat Point PCH
        ACPI / PNP: Replace faulty is_hex_digit() by isxdigit()
        ACPICA: Update version to 20140724.
        ACPICA: ACPI 5.1: Update for PCCT table changes.
        ACPICA/ARM: ACPI 5.1: Update for GTDT table changes.
        ACPICA/ARM: ACPI 5.1: Update for MADT changes.
        ACPICA/ARM: ACPI 5.1: Update for FADT changes.
        ACPICA: ACPI 5.1: Support for the _CCA predifined name.
        ACPICA: ACPI 5.1: New notify value for System Affinity Update.
        ACPICA: ACPI 5.1: Support for the _DSD predefined name.
        ACPICA: Debug object: Add current value of Timer() to debug line prefix.
        ACPICA: acpihelp: Add UUID support, restructure some existing files.
        ACPICA: Utilities: Fix local printf issue.
        ACPICA: Tables: Update for DMAR table changes.
        ACPICA: Remove some extraneous printf arguments.
        ACPICA: Update for comments/formatting. No functional changes.
        ACPICA: Disassembler: Add support for the ToUUID opererator (macro).
        ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro.
        ACPICA: Work around an ancient GCC bug.
        ACPI / processor: Make it possible to get local x2apic id via _MAT
        ...
      77251319
    • L
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 6b22df74
      Linus Torvalds 提交于
      Pull SCSI updates from James Bottomley:
       "This patch set consists of the usual driver updates (ufs, storvsc,
        pm8001 hpsa).  It also has removal of the user space target driver
        code (everyone is using LIO now), a partial PCI MSI-X update, more
        multi-queue updates, conversion to 64 bit LUNs (so we could
        theoretically cope with any LUN returned by a device) and placeholder
        support for the ZBC device type (Shingle drives), plus an assortment
        of minor updates and bug fixes"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (143 commits)
        scsi: do not issue SCSI RSOC command to Promise Vtrak E610f
        vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix()
        pm8001: Fix invalid return when request_irq() failed
        lpfc: Remove superfluous call to pci_disable_msix()
        isci: Use pci_enable_msix_exact() instead of pci_enable_msix()
        bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()
        bfa: Cleanup bfad_setup_intr() function
        bfa: Do not call pci_enable_msix() after it failed once
        fnic: Use pci_enable_msix_exact() instead of pci_enable_msix()
        scsi: use short driver name for per-driver cmd slab caches
        scsi_debug: support scsi-mq, queues and locks
        Drivers: add blist flags
        scsi: ufs: fix endianness sparse warnings
        scsi: ufs: make undeclared functions static
        bnx2i: Update driver version to 2.7.10.1
        pm8001: fix a memory leak in nvmd_resp
        pm8001: fix update_flash
        pm8001: fix a memory leak in flash_update
        pm8001: Cleaning up uninitialized variables
        pm8001: Fix to remove null pointer checks that could never happen
        ...
      6b22df74
    • L
      Merge tag 'sound-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 930e0312
      Linus Torvalds 提交于
      Pull sound updates from Takashi Iwai:
       "There've been many updates in ASoC side at this time, especially the
        framework enhancement for multiple CODECs on a single DAI and more
        componentization works.
      
        The only major change in ALSA core is the addition of timestamp type
        in sw_params field.  This should behave in backward compatible way.
      
        Other than that, there are lots of small changes and new drivers in
        wide range, including a large code cut in HD-audio driver for
        deprecated static quirks.  Some highlights are below:
      
        ALSA Core:
         - Add the new timestamp type field to sw_params to choose
           MONOTONIC_RAW type
      
        HD-audio:
         - Continued conversion to standard printk macros, generic code
           cleanups
         - Removal of obsoleted static quirk codes for Conexant and C-Media
           codecs
         - Fixups for HP Envy TS, Dell XPS 15, HP and Dell mute/mic LED,
           Gigabyte BXBT-2807 mobo
         - Intel Braswell support
      
        ASoC:
         - Support for multiple CODECs attached to a single DAI, enabling
           systems with for example multiple DAC/speaker drivers on a single
           link, contributed by Benoit Cousson based on work from Misael Lopez
           Cruz
         - Support for byte controls larger than 256 bytes based on the use of
           TLVs contributed by Omair Mohammed Abdullah
         - More componentisation work from Lars-Peter Clausen
         - The remainder of the conversions of CODEC drivers to params_width()
           by Mark Brown
         - Drivers for Cirrus Logic CS4265, Freescale i.MX ASRC blocks,
           Realtek RT286 and RT5670, Rockchip RK3xxx I2S controllers and Texas
           Instruments TAS2552
         - Lots of updates and fixes, especially to the DaVinci, Intel,
           Freescale, Realtek, and rcar drivers"
      
      * tag 'sound-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (402 commits)
        ALSA: usb-audio: Whitespace cleanups for sound/usb/midi.*
        ALSA: usb-audio: Respond to suspend and resume callbacks for MIDI input
        sound/oss/pss: Remove typedefs pss_mixerdata and pss_confdata
        sound/oss/opl3: Remove typedef opl_devinfo
        ALSA: fireworks: fix specifiers in format strings for propper output
        ASoC: imx-audmux: Use uintptr_t for port numbers
        ASoC: davinci: Enable menuconfig entry for McASP
        ASoC: fsl_asrc: Don't access members of config before checking it
        ASoC: fsl_sarc_dma: Check pair before using it
        ASoC: adau1977: Fix truncation warning on 64 bit architectures
        ALSA: virtuoso: add Xonar Essence STX II support
        ALSA: riptide: fix %d confusingly prefixed with 0x in format strings
        ALSA: fireworks: fix %d confusingly prefixed with 0x in format strings
        ALSA: hda - add codec ID for Braswell display audio codec
        ALSA: hda - add PCI IDs for Intel Braswell
        ALSA: usb-audio: Adjust Gamecom 780 volume level
        ALSA: usb-audio: improve dmesg source grepability
        ASoC: rt5670: Fix duplicate const warnings
        ASoC: rt5670: Staticise non-exported symbols
        ASoC: Intel: update stream only on stream IPC msgs
        ...
      930e0312
    • L
      Merge tag 'hsi-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi · ec6c0a77
      Linus Torvalds 提交于
      Pull HSI changes from Sebastian Reichel:
       "Misc fixes in SSI related drivers"
      
      * tag 'hsi-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
        HSI: omap_ssi: Fix return value check in ssi_debug_add_ctrl()
        HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
        HSI: ssi_protocol: Fix sparse non static symbol warning
        drivers/hsi/controllers/omap_ssi{,_port}.c: fix failure checks
      ec6c0a77
    • L
      Merge tag 'for-v3.17' of git://git.infradead.org/battery-2.6 · 0498cf84
      Linus Torvalds 提交于
      Pull power supply changes from Sebastian Reichel:
       - Added iPaq h3xxx battery driver
       - Added Broadcom STB reset driver
       - DT support for rx51-battery
       - misc. fixes
      
      * tag 'for-v3.17' of git://git.infradead.org/battery-2.6:
        ipaq_micro_battery: fix sparse non static symbol warning
        power: add driver for battery reading on iPaq h3xxx
        power: twl4030_charger: detect battery presence prior to enabling charger
        power: reset: Add reboot driver for brcmstb
        power_supply: Fix sparse non static symbol warning
        power_supply: Add inlmt,iterm, min/max temp props
        charger: tps65090: Allow charger module to be used when no irq
        power/reset: Fix GPL v2 license string typo
        power: poweroff: gpio: convert to use descriptors
        bq27000: report missing device better.
        bq27x00_battery: Introduce the use of the managed version of kzalloc
        Documentation: DT: Document rx51-battery binding
        rx51_battery: convert to iio consumer
        bq2415x_charger: Fix Atomic Sleep Bug
      0498cf84
    • T
      netlink: hold nl_sock_hash_lock during diag dump · 6c8f7e70
      Thomas Graf 提交于
      Although RCU protection would be possible during diag dump, doing
      so allows for concurrent table mutations which can render the
      in-table offset between individual Netlink messages invalid and
      thus cause legitimate sockets to be skipped in the dump.
      
      Since the diag dump is relatively low volume and consistency is
      more important than performance, the table mutex is held during
      dump.
      Reported-by: NAndrey Wagin <avagin@gmail.com>
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Fixes: e341694e ("netlink: Convert netlink_lookup() to use RCU protected hash table")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c8f7e70
    • J
      checkpatch: update $declaration_macros, add uninitialized_var · f8422308
      Joe Perches 提交于
      Using uninitialized_var reports a false positive for "Missing blank line
      after declarations".
      
      Fix it by adding uninitialized_var to the $declaration_macros exceptions
      list.
      
      Move the macro list after $Type is declared.
      
      Add optional prefixes to DECLARE_<FOO> and DEFINE_<BAR>
      macro declarations to allow forms like:
      	MLX4_DECLARE_DOORBELL_LOCK
      Signed-off-by: NJoe Perches <joe@perches.com>
      Reported-by: NDotan Barak <dotanb@mellanox.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f8422308
    • D
      checkpatch: warn on missing spaces in broken up quoted · ece9659f
      Dan Carpenter 提交于
      Checkpatch already complains when people break up quoted strings but
      it's still pretty common.  One mistake that people often make is they
      leave out the space character between the two strings.
      
      This check adds around 450 new warnings and has a low rate of false
      positives.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: Andy Whitcroft <apw@canonical.com>
      Acked-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ece9659f
    • J
      checkpatch: fix false positives for --strict "space after cast" test · 308cc8d8
      Joe Perches 提交于
      Commit 89da401f6cff ("checkpatch: improve "no space after cast" test")
      in -next improved the cast test for non pointer types, but also
      introduced false positives for some types of static inlines.
      
      Add a test for an open brace to the exclusions to avoid these false
      positives.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Reported-by: NHartley Sweeten <HartleyS@visionengravers.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      308cc8d8
    • J
      checkpatch: fix false positive MISSING_BREAK warnings with --file · e81f239b
      Joe Perches 提交于
      Using --file mode can give false positives with MISSING_BREAK
      fall-through warnings on simple but long multiple consecutive case
      statements.
      
      Look for all lines before a case statement for a switch or a statement
      when using --file mode.
      
      Fix a misspelling of preceded while there.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Reported-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e81f239b
    • J
      checkpatch: add test for native c90 types in unusual order · 1813087d
      Joe Perches 提交于
      c90 section "6.7.2 Type Specifiers" says:
          "type specifiers may occur in any order"
      
      That means that:
          short int is the same as int short
          unsigned short int is the same as int unsigned short
          etc...
      
      checkpatch currently parses only a subset of these allowed types.
      
      For instance: "unsigned short" and "signed short" are found by
      checkpatch as a specific type, but none of the or "int short" or "int
      signed short" variants are found.
      
      Add another table for the "kernel style misordered" variants.
      
      Add this misordered table to the findable types.
      
      Warn when the misordered style is used.
      
      This improves the "Missing a blank line after declarations" test as it
      depends on the correct parsing of the $Declare variable which looks for
      "$Type $Ident;" (ie: declarations like "int foo;").
      Signed-off-by: NJoe Perches <joe@perches.com>
      Acked-by: NAndy Whitcroft <apw@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1813087d
    • J
      checkpatch: add signed generic types · 0c773d9d
      Joe Perches 提交于
      Current generic types are unsigned or unspecified.  Add signed to the
      types.
      
      Reorder the types to find the longest match first.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Acked-by: NAndy Whitcroft <apw@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0c773d9d
    • J
      checkpatch: add short int to c variable types · 3f7bc4e1
      Joe Perches 提交于
      short int is one of the 6.7.2 c90 types.
      Find it appropriately.
      
      This fixes a defect in checkpatch where it suggests that a line break
      after declaration is required using an input like:
      
      	int foo;
      	short int bar;
      
      Without this change, it warns on the short int line.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Reported-by: NHartley Sweeten <HartleyS@visionengravers.com>
      Acked-by: NAndy Whitcroft <apw@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3f7bc4e1
    • J
      checkpatch: add for_each tests to indentation and brace tests · 0fe3dc2b
      Joe Perches 提交于
      All the various for_each loop macros were not tested for trailing brace
      on the following lines and for bad indentation.
      
      Add them.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Reported-by: NGreg KH <gregkh@linuxfoundation.org>
      Cc: Andy Whitcroft <apw@canonical.com
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0fe3dc2b
    • J
      checkpatch: fix brace style misuses of else and while · 8b8856f4
      Joe Perches 提交于
      Add --fix corrections for ELSE_AFTER_BRACE and WHILE_AFTER_BRACE
      misuses.
      
      	if (x) {
      		...
      	}
      	else {
      		...
      	}
      
      is corrected to
      
      	if (x) {
      		...
      	} else {
      		...
      	}
      
      and
      
      	do {
      		...
      	}
      	while (x);
      
      is corrected to
      
      	do {
      		...
      	} while (x);
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8b8856f4
    • J
      checkpatch: add --fix option for a couple OPEN_BRACE misuses · 8d182478
      Joe Perches 提交于
      Style misuses of these types are corrected:
      
        typedef struct foo
        {
              int bar;
        };
      
        int foo(int bar) { return bar+1;
        }
      
        int foo(int bar) {
              return bar+1;
        }
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d182478
    • J
      checkpatch: use the correct indentation for which() · bd474ca0
      Joe Perches 提交于
      I copied the which subroutine from get_maintainer.pl.
      
      Unfortunately, get_maintainer uses a 4 space indentation so use the
      proper tab indentation instead.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd474ca0
    • J
      checkpatch: add fix_insert_line and fix_delete_line helpers · f2d7e4d4
      Joe Perches 提交于
      Neaten the uses of patch/file line insertions or deletions.  Hide the
      mechanism used.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f2d7e4d4
    • J
      checkpatch: add ability to insert and delete lines to patch/file · d752fcc8
      Joe Perches 提交于
      This can be valuable to insert or delete blank lines as well as fix
      misplaced brace or else uses.
      
      Store indexes of lines to be added/deleted and the new lines.
      
      When creating the --fix file, insert or delete the appropriate lines and
      update the patch range information.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: Andy Whitcroft <apw@canonical.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d752fcc8
    • J
      checkpatch: add an index variable for fixed lines · 194f66fc
      Joe Perches 提交于
      Make the fix code a bit easier to read.
      
      This should also start to allow an easier mechanism to insert/delete
      lines eventually too.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: Andy Whitcroft <apw@canonical.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      194f66fc
    • J
      checkpatch: warn on break after goto or return with same tab indentation · c00df19a
      Joe Perches 提交于
      Using break; after a goto or return is unnecessary so emit a warning
      when the break is at the same indent level.
      
      So this emits a warning on:
      
      	switch (foo) {
      	case 1:
      		goto err;
      		break;
      	}
      
      but not on:
      
      	switch (foo) {
      	case 1:
      		if (bar())
      			goto err;
      		break;
      	}
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c00df19a
    • J
      checkpatch: emit a warning on file add/move/delete · 13f1937e
      Joe Perches 提交于
      Whenever files are added, moved, or deleted, the MAINTAINERS file
      patterns can be out of sync or outdated.
      
      To try to keep MAINTAINERS more up-to-date, add a one-time warning
      whenever a patch does any of those.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Acked-by: NAndy Whitcroft <apw@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      13f1937e
    • J
      checkpatch: add test for commit id formatting style in commit log · d311cd44
      Joe Perches 提交于
      Commit logs have various forms of commit id references.
      
      Try to standardize on a 12 character long lower case commit id along
      with a description of parentheses and the quoted subject line.
      
      ie: commit 0123456789ab ("commit description")
      
      If git and a git tree exists, look up the commit id and emit the
      appropriate line as part of the message.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Requested-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d311cd44
    • J
      checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings · e367455a
      Joe Perches 提交于
      Avoid matching allocs that appear to be known small multiplications of a
      sizeof with a constant because gcc as of 4.8 cannot optimize the code in
      a calloc() exactly the same way as an alloc().
      
      Look for numeric constants or what appear to be upper case only macro
      #defines.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Reported-by: NTheodore Ts'o <tytso@mit.edu>
      Original-patch-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e367455a