1. 29 1月, 2016 4 次提交
  2. 16 1月, 2016 13 次提交
    • D
      bgmac: Fix reversed test of build_skb() return value. · 750afbf8
      David S. Miller 提交于
      Fixes: f1640c3d ("bgmac: fix a missing check for build_skb")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      750afbf8
    • Y
      net: smsc: Add support h8300 · f147d0b3
      Yoshinori Sato 提交于
      Add H8/300 platform support for smc91x
      Signed-off-by: NYoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f147d0b3
    • B
      amdkfd: Copy from the proper user command pointer · 39c01bf9
      Borislav Petkov 提交于
      8f1d57c1 ("amdkfd: don't open-code memdup_user()") mistakenly uses
      an uninitialized local pointer, gcc complains:
      
        drivers/gpu/drm/amd/amdkfd/kfd_chardev.c: In function ‘kfd_ioctl_dbg_address_watch’:
        drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:562:12: warning: ‘args_buff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
          args_buff = memdup_user(args_buff,
                      ^
      
      Fix it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      39c01bf9
    • D
      xen-netback: free queues after freeing the net device · 9c6f3ffe
      David Vrabel 提交于
      If a queue still has a NAPI instance added to the net device, freeing
      the queues early results in a use-after-free.
      
      The shouldn't ever happen because we disconnect and tear down all queues
      before freeing the net device, but doing this makes it obviously safe.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c6f3ffe
    • D
      xen-netback: delete NAPI instance when queue fails to initialize · 4a658527
      David Vrabel 提交于
      When xenvif_connect() fails it may leave a stale NAPI instance added to
      the device.  Make sure we delete it in the error path.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a658527
    • D
      xen-netback: use skb to determine number of required guest Rx requests · 99a2dea5
      David Vrabel 提交于
      Using the MTU or GSO size to determine the number of required guest Rx
      requests for an skb was subtly broken since these value may change at
      runtime.
      
      After 1650d545 (xen-netback: always
      fully coalesce guest Rx packets) we always fully pack a packet into
      its guest Rx slots.  Calculating the number of required slots from the
      packet length is then easy.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99a2dea5
    • S
      net: phy: turn carrier off on phy attach · 113c74d8
      Sjoerd Simons 提交于
      The operstate of a networking device initially IF_OPER_UNKNOWN aka
      "unknown", updated on carrier state changes (with carrier state being on
      by default). This means it will stay unknown unless the carrier state
      goes to off at some point, which is not the case if the phy is already
      up/connected at startup.
      
      Explicitly turn off the carrier on phy attach, leaving the phy state
      machine to turn the carrier on when it has done the initial negotiation.
      Signed-off-by: NSjoerd Simons <sjoerd.simons@collabora.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      113c74d8
    • N
      net: macb: clear interrupts when disabling them · 24468374
      Nathan Sullivan 提交于
      Disabling interrupts with the IDR register does not stop the macb hardware
      from asserting its interrupt line if there are interrupts pending.  Always
      clear the interrupts using ISR, and be sure to write it on hardware that
      is not read-to-clear, like Zynq.  Not doing so will cause interrupts when
      the driver doesn't expect them.
      Signed-off-by: NNathan Sullivan <nathan.sullivan@ni.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24468374
    • S
      zram/zcomp: do not zero out zcomp private pages · e02d238c
      Sergey Senozhatsky 提交于
      Do not __GFP_ZERO allocated zcomp ->private pages.  We keep allocated
      streams around and use them for read/write requests, so we supply a
      zeroed out ->private to compression algorithm as a scratch buffer only
      once -- the first time we use that stream.  For the rest of IO requests
      served by this stream ->private usually contains some temporarily data
      from the previous requests.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e02d238c
    • M
      zram: pass gfp from zcomp frontend to backend · 75d8947a
      Minchan Kim 提交于
      Each zcomp backend uses own gfp flag but it's pointless because the
      context they could be called is driven by upper layer(ie, zcomp
      frontend).  As well, zcomp frondend could call them in different
      context.  One context(ie, zram init part) is it should be better to make
      sure successful allocation other context(ie, further stream allocation
      part for accelarating I/O speed) is just optional so let's pass gfp down
      from driver (ie, zcomp frontend) like normal MM convention.
      
      [sergey.senozhatsky@gmail.com: add missing __vmalloc zero and highmem gfps]
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      75d8947a
    • K
      zram: try vmalloc() after kmalloc() · d913897a
      Kyeongdon Kim 提交于
      When we're using LZ4 multi compression streams for zram swap, we found
      out page allocation failure message in system running test.  That was
      not only once, but a few(2 - 5 times per test).  Also, some failure
      cases were continually occurring to try allocation order 3.
      
      In order to make parallel compression private data, we should call
      kzalloc() with order 2/3 in runtime(lzo/lz4).  But if there is no order
      2/3 size memory to allocate in that time, page allocation fails.  This
      patch makes to use vmalloc() as fallback of kmalloc(), this prevents
      page alloc failure warning.
      
      After using this, we never found warning message in running test, also
      It could reduce process startup latency about 60-120ms in each case.
      
      For reference a call trace :
      
          Binder_1: page allocation failure: order:3, mode:0x10c0d0
          CPU: 0 PID: 424 Comm: Binder_1 Tainted: GW 3.10.49-perf-g991d02b-dirty #20
          Call trace:
            dump_backtrace+0x0/0x270
            show_stack+0x10/0x1c
            dump_stack+0x1c/0x28
            warn_alloc_failed+0xfc/0x11c
            __alloc_pages_nodemask+0x724/0x7f0
            __get_free_pages+0x14/0x5c
            kmalloc_order_trace+0x38/0xd8
            zcomp_lz4_create+0x2c/0x38
            zcomp_strm_alloc+0x34/0x78
            zcomp_strm_multi_find+0x124/0x1ec
            zcomp_strm_find+0xc/0x18
            zram_bvec_rw+0x2fc/0x780
            zram_make_request+0x25c/0x2d4
            generic_make_request+0x80/0xbc
            submit_bio+0xa4/0x15c
            __swap_writepage+0x218/0x230
            swap_writepage+0x3c/0x4c
            shrink_page_list+0x51c/0x8d0
            shrink_inactive_list+0x3f8/0x60c
            shrink_lruvec+0x33c/0x4cc
            shrink_zone+0x3c/0x100
            try_to_free_pages+0x2b8/0x54c
            __alloc_pages_nodemask+0x514/0x7f0
            __get_free_pages+0x14/0x5c
            proc_info_read+0x50/0xe4
            vfs_read+0xa0/0x12c
            SyS_read+0x44/0x74
          DMA: 3397*4kB (MC) 26*8kB (RC) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB
               0*512kB 0*1024kB 0*2048kB 0*4096kB = 13796kB
      
      [minchan@kernel.org: change vmalloc gfp and adding comment about gfp]
      [sergey.senozhatsky@gmail.com: tweak comments and styles]
      Signed-off-by: NKyeongdon Kim <kyeongdon.kim@lge.com>
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Acked-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d913897a
    • S
      zram/zcomp: use GFP_NOIO to allocate streams · 3d5fe03a
      Sergey Senozhatsky 提交于
      We can end up allocating a new compression stream with GFP_KERNEL from
      within the IO path, which may result is nested (recursive) IO
      operations.  That can introduce problems if the IO path in question is a
      reclaimer, holding some locks that will deadlock nested IOs.
      
      Allocate streams and working memory using GFP_NOIO flag, forbidding
      recursive IO and FS operations.
      
      An example:
      
        inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
        git/20158 [HC0[0]:SC0[0]:HE1:SE1] takes:
         (jbd2_handle){+.+.?.}, at:  start_this_handle+0x4ca/0x555
        {IN-RECLAIM_FS-W} state was registered at:
           __lock_acquire+0x8da/0x117b
           lock_acquire+0x10c/0x1a7
           start_this_handle+0x52d/0x555
           jbd2__journal_start+0xb4/0x237
           __ext4_journal_start_sb+0x108/0x17e
           ext4_dirty_inode+0x32/0x61
           __mark_inode_dirty+0x16b/0x60c
           iput+0x11e/0x274
           __dentry_kill+0x148/0x1b8
           shrink_dentry_list+0x274/0x44a
           prune_dcache_sb+0x4a/0x55
           super_cache_scan+0xfc/0x176
           shrink_slab.part.14.constprop.25+0x2a2/0x4d3
           shrink_zone+0x74/0x140
           kswapd+0x6b7/0x930
           kthread+0x107/0x10f
           ret_from_fork+0x3f/0x70
        irq event stamp: 138297
        hardirqs last  enabled at (138297):  debug_check_no_locks_freed+0x113/0x12f
        hardirqs last disabled at (138296):  debug_check_no_locks_freed+0x33/0x12f
        softirqs last  enabled at (137818):  __do_softirq+0x2d3/0x3e9
        softirqs last disabled at (137813):  irq_exit+0x41/0x95
      
                     other info that might help us debug this:
         Possible unsafe locking scenario:
               CPU0
               ----
          lock(jbd2_handle);
          <Interrupt>
            lock(jbd2_handle);
      
                      *** DEADLOCK ***
        5 locks held by git/20158:
         #0:  (sb_writers#7){.+.+.+}, at: [<ffffffff81155411>] mnt_want_write+0x24/0x4b
         #1:  (&type->i_mutex_dir_key#2/1){+.+.+.}, at: [<ffffffff81145087>] lock_rename+0xd9/0xe3
         #2:  (&sb->s_type->i_mutex_key#11){+.+.+.}, at: [<ffffffff8114f8e2>] lock_two_nondirectories+0x3f/0x6b
         #3:  (&sb->s_type->i_mutex_key#11/4){+.+.+.}, at: [<ffffffff8114f909>] lock_two_nondirectories+0x66/0x6b
         #4:  (jbd2_handle){+.+.?.}, at: [<ffffffff811e31db>] start_this_handle+0x4ca/0x555
      
                     stack backtrace:
        CPU: 2 PID: 20158 Comm: git Not tainted 4.1.0-rc7-next-20150615-dbg-00016-g8bdf555-dirty #211
        Call Trace:
          dump_stack+0x4c/0x6e
          mark_lock+0x384/0x56d
          mark_held_locks+0x5f/0x76
          lockdep_trace_alloc+0xb2/0xb5
          kmem_cache_alloc_trace+0x32/0x1e2
          zcomp_strm_alloc+0x25/0x73 [zram]
          zcomp_strm_multi_find+0xe7/0x173 [zram]
          zcomp_strm_find+0xc/0xe [zram]
          zram_bvec_rw+0x2ca/0x7e0 [zram]
          zram_make_request+0x1fa/0x301 [zram]
          generic_make_request+0x9c/0xdb
          submit_bio+0xf7/0x120
          ext4_io_submit+0x2e/0x43
          ext4_bio_write_page+0x1b7/0x300
          mpage_submit_page+0x60/0x77
          mpage_map_and_submit_buffers+0x10f/0x21d
          ext4_writepages+0xc8c/0xe1b
          do_writepages+0x23/0x2c
          __filemap_fdatawrite_range+0x84/0x8b
          filemap_flush+0x1c/0x1e
          ext4_alloc_da_blocks+0xb8/0x117
          ext4_rename+0x132/0x6dc
          ? mark_held_locks+0x5f/0x76
          ext4_rename2+0x29/0x2b
          vfs_rename+0x540/0x636
          SyS_renameat2+0x359/0x44d
          SyS_rename+0x1e/0x20
          entry_SYSCALL_64_fastpath+0x12/0x6f
      
      [minchan@kernel.org: add stable mark]
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Kyeongdon Kim <kyeongdon.kim@lge.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3d5fe03a
    • Y
      net: hns: fixes no syscon error when init mdio · 28052e75
      yankejian 提交于
      As dtsi files use the normal naming conventions using '-' instead of '_'
      inside of property names, the driver needs to update the phandle name
      strings of the of_parse_phandle func.
      Signed-off-by: NKejian Yan <yankejian@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28052e75
  3. 15 1月, 2016 5 次提交
    • J
      drivers/base/memory.c: fix kernel warning during memory hotplug on ppc64 · cb5490a5
      John Allen 提交于
      Fix a bug where a kernel warning is triggered when performing a memory
      hotplug on ppc64.  This warning may also occur on any architecture that
      uses the memory_probe_store interface.
      
        WARNING: at drivers/base/memory.c:200
        CPU: 9 PID: 13042 Comm: systemd-udevd Not tainted 4.4.0-rc4-00113-g0bd0f1e6-dirty #7
        NIP [c00000000055e034] pages_correctly_reserved+0x134/0x1b0
        LR [c00000000055e7f8] memory_subsys_online+0x68/0x140
        Call Trace:
          memory_subsys_online+0x68/0x140
          device_online+0xb4/0x120
          store_mem_state+0xb0/0x180
          dev_attr_store+0x34/0x60
          sysfs_kf_write+0x64/0xa0
          kernfs_fop_write+0x17c/0x1e0
          __vfs_write+0x40/0x160
          vfs_write+0xb8/0x200
          SyS_write+0x60/0x110
          system_call+0x38/0xd0
      
      The warning is triggered because there is a udev rule that automatically
      tries to online memory after it has been added.  The udev rule varies
      from distro to distro, but will generally look something like:
      
        SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"
      
      On any architecture that uses memory_probe_store to reserve memory, the
      udev rule will be triggered after the first section of the block is
      reserved and will subsequently attempt to online the entire block,
      interrupting the memory reservation process and causing the warning.
      This patch modifies memory_probe_store to add a block of memory with a
      single call to add_memory as opposed to looping through and adding each
      section individually.  A single call to add_memory is protected by the
      mem_hotplug mutex which will prevent the udev rule from onlining memory
      until the reservation of the entire block is complete.
      Signed-off-by: NJohn Allen <jallen@linux.vnet.ibm.com>
      Acked-by: NDave Hansen <dave.hansen@intel.com>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      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>
      cb5490a5
    • S
      drivers/base/memory.c: rename remove_memory_block() to remove_memory_section() · cc292b0b
      Seth Jennings 提交于
      The function removes a section, not a block.  Rename to reflect actual
      functionality.
      Signed-off-by: NSeth Jennings <sjennings@variantweb.net>
      Cc: Andrew Banman <abanman@sgi.com>
      Cc: Daniel J Blueman <daniel@numascale.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Russ Anderson <rja@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cc292b0b
    • S
      drivers/base/memory.c: clean up section counting · 56c6b5d3
      Seth Jennings 提交于
      Right now, section_count is calculated in add_memory_block().  However,
      init_memory_block() increments section_count as well, which, at first,
      seems like it would lead to an off-by-one error.  There is no harm done
      because add_memory_block() immediately overwrites the
      mem->section_count, but it is messy.
      
      This commit moves the increment out of the common init_memory_block()
      (called by both add_memory_block() and register_new_memory()) and adds
      it to register_new_memory().
      Signed-off-by: NSeth Jennings <sjennings@variantweb.net>
      Cc: Andrew Banman <abanman@sgi.com>
      Cc: Daniel J Blueman <daniel@numascale.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Russ Anderson <rja@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      56c6b5d3
    • V
      kmemcg: account certain kmem allocations to memcg · 5d097056
      Vladimir Davydov 提交于
      Mark those kmem allocations that are known to be easily triggered from
      userspace as __GFP_ACCOUNT/SLAB_ACCOUNT, which makes them accounted to
      memcg.  For the list, see below:
      
       - threadinfo
       - task_struct
       - task_delay_info
       - pid
       - cred
       - mm_struct
       - vm_area_struct and vm_region (nommu)
       - anon_vma and anon_vma_chain
       - signal_struct
       - sighand_struct
       - fs_struct
       - files_struct
       - fdtable and fdtable->full_fds_bits
       - dentry and external_name
       - inode for all filesystems. This is the most tedious part, because
         most filesystems overwrite the alloc_inode method.
      
      The list is far from complete, so feel free to add more objects.
      Nevertheless, it should be close to "account everything" approach and
      keep most workloads within bounds.  Malevolent users will be able to
      breach the limit, but this was possible even with the former "account
      everything" approach (simply because it did not account everything in
      fact).
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NVladimir Davydov <vdavydov@virtuozzo.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5d097056
    • M
      fsl/fman: Delete one function call "put_device" in dtsec_config() · 5d19c619
      Markus Elfring 提交于
      The Coccinelle semantic patch script "deref_null.cocci" pointed a problem
      out in the implementation of the function "dtsec_config".
      
      A null pointer was assigned to the data structure member "tbiphy" of the
      variable "dtsec" if a matching device was not found.
      A call of the function "put_device" was unnecessary then because
      a previous call of the function "get_device" was not triggered.
      Thus remove the function call "put_device" after the printing of the
      desired error message.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d19c619
  4. 14 1月, 2016 18 次提交
    • L
      mfd: davinci_voicecodec: Remove pointless 'out of memory' error message · 9fb41166
      Lee Jones 提交于
      WARNING: Possible unnecessary 'out of memory' message
      +       if (!davinci_vc) {
      +               dev_dbg(&pdev->dev,
      
      total: 0 errors, 1 warnings, 154 lines checked
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      9fb41166
    • L
      mfd: da9052-irq: Fix trivial 'space before comma' error · 997eea46
      Lee Jones 提交于
      ERROR: space prohibited before that ',' (ctx:WxW)
      +       da9052_free_irq(da9052, DA9052_IRQ_ADC_EOM , da9052);
      
      total: 1 errors, 0 warnings, 290 lines checked
      
      Cc: Support Opensource <support.opensource@diasemi.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      997eea46
    • L
      mfd: da9052-i2c: Fix tabbing/whitespace issue · 5b7b2ac1
      Lee Jones 提交于
      WARNING: suspect code indent for conditional statements (8, 24)
      +       if (!i2c_safe_reg(reg))
      +                       return regmap_read(da9052->regmap,
      
      total: 0 errors, 1 warnings, 226 lines checked
      
      Cc: Support Opensource <support.opensource@diasemi.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      5b7b2ac1
    • L
      mfd: da903x: Fix white space and split string issues · 8b277578
      Lee Jones 提交于
      While we're at it, let's also match the MODULE_LICENSE with the header.
      
      WARNING: please, no space before tabs
      + * ^IMike Rapoport <mike@compulab.co.il>$
      
      WARNING: please, no space before tabs
      + * ^IEric Miao <eric.miao@marvell.com>$
      
      WARNING: quoted string split across lines
      +MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
      +             "Mike Rapoport <mike@compulab.co.il>");
      
      total: 0 errors, 3 warnings, 574 lines checked
      
      Cc: Support Opensource <support.opensource@diasemi.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      8b277578
    • L
      mfd: cs5535-mfd: Add missing line spacing and make local array static · 740c1989
      Lee Jones 提交于
      WARNING: Missing a blank line after declarations
      +       struct resource *res;
      +       res = platform_get_resource(pdev, IORESOURCE_IO, 0);
      
      WARNING: char * array declaration might be better as static const
      +       const char *acpi_clones[] = { "olpc-xo1-pm-acpi", "olpc-xo1-sci-acpi" };
      
      total: 0 errors, 2 warnings, 192 lines checked
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      740c1989
    • L
      mfd: cros_ec_spi: Repair comparison ordering issue · 8827a642
      Lee Jones 提交于
      WARNING: Comparisons should place the constant on the right side of the test
      +       BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size);
      
      WARNING: Comparisons should place the constant on the right side of the test
      +       BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size);
      
      total: 0 errors, 2 warnings, 731 lines checked
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      8827a642
    • L
      mfd: cros_ec_i2c: Fix trivial 'tabs before spaces' whitespace issue. · 2756db6c
      Lee Jones 提交于
      ERROR: code indent should use tabs where possible
      + ^Iec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);$
      
      WARNING: please, no space before tabs
      + ^Iec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);$
      
      WARNING: please, no spaces at the start of a line
      + ^Iec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);$
      
      total: 1 errors, 2 warnings, 366 lines checked
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      2756db6c
    • L
      mfd: asic3: Fix a plethora of Checkpatch errors and warnings · d43c4290
      Lee Jones 提交于
      ERROR: Macros with complex values should be enclosed in parentheses
      +#define INIT_CDEX(_name, _rate)        \
      +       [ASIC3_CLOCK_##_name] = {               \
      +               .cdex = CLOCK_CDEX_##_name,     \
      +               .rate = _rate,                  \
      +       }
      
      WARNING: line over 80 characters
      +                                                           ASIC3_GPIO_INT_STATUS);
      
      WARNING: void function return statements are not generally useful
      +       return;
      +}
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +       msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +       msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +       msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +       msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +       msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +       msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +               msleep(1);
      WARNING: line over 80 characters
      +               asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +
      
      WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then p
      r_err(...  to printk(KERN_ERR ...
      +               printk(KERN_ERR "kzalloc failed\n");
      
      WARNING: Possible unnecessary 'out of memory' message
      +       if (asic == NULL) {
      +               printk(KERN_ERR "kzalloc failed\n");
      
      WARNING: Missing a blank line after declarations
      +       int retval = 0;
      +       retval = platform_driver_probe(&asic3_device_driver, asic3_probe);
      
      total: 1 errors, 13 warnings, 1081 lines checked
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      d43c4290
    • L
      mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings · ae487ae2
      Lee Jones 提交于
      WARNING: Possible unnecessary 'out of memory' message
      +               if (!pdata) {
      +                       dev_err(&client->dev, "Failed to allocate pdata\n");
      
      WARNING: Possible unnecessary 'out of memory' message
      +       if (!as3711) {
      +               dev_err(&client->dev, "Memory allocation failed\n");
      
      WARNING: line over 80 characters
      +               dev_err(&client->dev, "regmap initialization failed: %d\n", ret);
      
      WARNING: line over 80 characters
      +       /* We can reuse as3711_subdevs[], it will be copied in mfd_add_devices() */
      
      WARNING: line over 80 characters
      +               as3711_subdevs[AS3711_REGULATOR].platform_data = &pdata->regulator;
      
      WARNING: line over 80 characters
      +               as3711_subdevs[AS3711_REGULATOR].pdata_size = sizeof(pdata->regulator);
      
      WARNING: line over 80 characters
      +               as3711_subdevs[AS3711_BACKLIGHT].platform_data = &pdata->backlight;
      
      WARNING: line over 80 characters
      +               as3711_subdevs[AS3711_BACKLIGHT].pdata_size = sizeof(pdata->backlight);
      
      total: 0 errors, 8 warnings, 236 lines checked
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      ae487ae2
    • L
      mfd: arizona-i2c: Add blank line formatting after declaration · 9f6e872a
      Lee Jones 提交于
      WARNING: Missing a blank line after declarations
      +       struct arizona *arizona = dev_get_drvdata(&i2c->dev);
      +       arizona_dev_exit(arizona);
      
      total: 0 errors, 1 warnings, 120 lines checked
      
      Cc: patches@opensource.wolfsonmicro.com
      Acked-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      9f6e872a
    • L
      mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead · b79a980f
      Lee Jones 提交于
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +               msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +                       msleep(5);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +               msleep(1);
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +               msleep(1);
      
      total: 0 errors, 4 warnings, 1407 lines checked
      
      Cc: patches@opensource.wolfsonmicro.com
      Acked-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      b79a980f
    • L
      mfd: adp5520: Some trivial 'no space before tab' fixes · 3103d44e
      Lee Jones 提交于
      WARNING: please, no space before tabs
      + * ^IMike Rapoport <mike@compulab.co.il>$
      
      WARNING: please, no space before tabs
      + * ^IEric Miao <eric.miao@marvell.com>$
      
      WARNING: please, no space before tabs
      +^I.id_table ^I= adp5520_id,$
      
      total: 0 errors, 3 warnings, 365 lines checked
      
      Cc: Michael Hennerich <michael.hennerich@analog.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      3103d44e
    • L
      mfd: ab8500-sysctrl: Fix Constify, printk => pr_info and formatting issues · 63b4fd75
      Lee Jones 提交于
      WARNING: char * array declaration might be better as static const
      +       static char *pss[] = {"ab8500_ac", "pm2301", "ab8500_usb"};
      
      WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then
       pr_info(...  to printk(KERN_INFO ...
      +                       printk(KERN_INFO
      
      WARNING: quoted string split across lines
      +                              "Charger \"%s\" is connected with known battery."
      +                              " Rebooting.\n",
      
      WARNING: quoted string split across lines
      +                                       "unable to set sysClkReq%dRfClkBuf: "
      +                                       "%d\n", j + 1, ret);
      
      total: 0 errors, 4 warnings, 199 lines checked
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      63b4fd75
    • L
      mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error · df36442c
      Lee Jones 提交于
      WARNING: line over 80 characters
      +#define ADC_CH_IBAT_MIN                        (-6000) /* mA range measured by ADC for ib
      t*/
      
      WARNING: line over 80 characters
      +#define ADC_CH_IBAT_MIN_V              (-60)   /* mV range measured by ADC for ibat*/
      
      WARNING: suspect code indent for conditional statements (16, 20)
      +               if (!strcmp(name, dev_name(gpadc->dev)))
      +                   return gpadc;
      
      WARNING: suspect code indent for conditional statements (0, 16)
      +if (ad_value < 0) {
      +               dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n",
      
      WARNING: quoted string split across lines
      +               dev_err(gpadc->dev, "GPADC to voltage conversion failed ch:"
      +                       " %d AD: 0x%x\n", channel, ad_value);
      
      WARNING: Missing a blank line after declarations
      +       int raw_data;
      +       raw_data = ab8500_gpadc_double_read_raw(gpadc, channel,
      
      WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
      +               msleep(10);
      
      ERROR: else should follow close brace '}'
      +       }
      +       else
      
      WARNING: line over 80 characters
      +                       delay_max = 10000; /* large range to optimise sleep mode */
      
      WARNING: line over 80 characters
      +                       gpadc->cal_data[ADC_INPUT_IBAT].gain = V_gain * V2A_gain;
      
      WARNING: line over 80 characters
      +       gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL);
      
      WARNING: Possible unnecessary 'out of memory' message
      +       if (!gpadc) {
      +               dev_err(&pdev->dev, "Error: No memory\n");
      
      WARNING: space prohibited before semicolon
      +       return ;
      
      WARNING: void function return statements are not generally useful
      +       return ;
      +}
      
      WARNING: quoted string split across lines
      +MODULE_AUTHOR("Arun R Murthy, Daniel Willerud, Johan Palsson,"
      +               "M'boumba Cedric Madianga");
      
      total: 1 errors, 14 warnings, 1089 lines checked
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      df36442c
    • L
      mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting · de6a7693
      Lee Jones 提交于
      WARNING: Block comments use a trailing */ on a separate line
      +                        * not be accessed from here */
      
      WARNING: Block comments use a trailing */ on a separate line
      +                        * not be accessed from here */
      
      WARNING: Block comments use a trailing */ on a separate line
      +                                * the output is wanted in any case */
      
      WARNING: Consecutive strings are generally better as a single string
      +               "  addr=0x%08X, mask=0x%X, shift=%d" "value=0x%X\n",
      
      total: 0 errors, 4 warnings, 3331 lines checked
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      de6a7693
    • L
      mfd: ab8500-core: Fix many warnings reported by Checkpatch · 500e69a1
      Lee Jones 提交于
      WARNING: Block comments use a trailing */ on a separate line
      +        * */
      
      WARNING: Block comments use a trailing */ on a separate line
      +        * bank on higher 8 bits and reg in lower */
      
      WARNING: Block comments use a trailing */ on a separate line
      +        * bank on higher 8 bits and reg in lower */
      
      WARNING: suspect code indent for conditional statements (8, 24)
      +       if (unlikely(*offset == 17))
      +                       *offset = 24;
      
      WARNING: suspect code indent for conditional statements (8, 24)
      +       if (unlikely(*offset == 16))
      +                       *offset = 25;
      
      WARNING: suspect code indent for conditional statements (8, 24)
      +       if ((i == 3) && (*offset >= 24))
      +                       *offset += 2;
      
      WARNING: ENOSYS means 'invalid syscall nr' and nothing else
      +               return -ENOSYS;
      
      WARNING: static const char * array should probably be static const char * const
      +       static const char *switch_off_status[] = {
      
      WARNING: static const char * array should probably be static const char * const
      +       static const char *turn_on_status[] = {
      
      total: 0 errors, 9 warnings, 1867 lines checked
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      500e69a1
    • L
      mfd: ab2100-otp: Remove pointless 'out of memory' error message · 845b76f8
      Lee Jones 提交于
      WARNING: Possible unnecessary 'out of memory' message
      +       if (!otp) {
      +               dev_err(&pdev->dev, "could not allocate AB3100 OTP device\n");
      
      total: 0 errors, 1 warnings, 250 lines checked
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      845b76f8
    • L
      mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch · 15544cab
      Lee Jones 提交于
      WARNING: Missing a blank line after declarations
      +       struct ab3100 *ab3100 = dev_get_drvdata(dev->parent);
      +       if (!ab3100->startup_events_read)
      
      WARNING: Possible unnecessary 'out of memory' message
      +       if (!ab3100) {
      +               dev_err(&client->dev, "could not allocate AB3100 device\n");
      
      WARNING: else is not generally useful after a break or return
      +                               break;
      +                       } else {
      
      total: 0 errors, 3 warnings, 996 lines checked
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      15544cab