staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
x86,ioapic: Cleanup irq_trigger/polarity()

These functions are full of pointless indentations, useless comments
and even more useless printks.

Clean them up.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: x86@kernel.org
staging: clocking-wizard: check for a valid clk_name pointer

The clk_name gets the return value from kasprintf (part of which does the
allocation of the returned buffer). So check the return pointer
before using it for clk_register_fixed_factor.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Reviewed-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Drivers:staging:clocking-wizard: Added a newline

Fixed checkpatch warning:
Missing a newline after declarations

Signed-off-by: Athira Sharikkal <athirasnamby@gmail.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Drivers:staging:rtl8192e: Fixed checkpatch warning

Fixed checkpatch warning:
WARNING: space prohibited before semicolon

Signed-off-by: Athira Lekshmi <andnlnbn18@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c"

"asm/unaligned.h" is more generic than "access_ok.h", and it may include
"access_ok.h", so need use it instead of "access_ok.h".

During building, "rtllib.h" has already include "asm/unaligned.h", so
will cause building issue. The related error (with allmodconfig under
parisc):

    CC [M]  drivers/staging/rtl8192e/rtl819x_BAProc.o
  In file included from ./arch/parisc/include/asm/unaligned.h:4:0,
                   from include/linux/ieee80211.h:22,
                   from include/net/lib80211.h:31,
                   from drivers/staging/rtl8192e/rtllib.h:45,
                   from drivers/staging/rtl8192e/rtl819x_BAProc.c:20:
  include/linux/unaligned/be_struct.h:6:19: error: redefinition of 'get_unaligned_be16'
   static inline u16 get_unaligned_be16(const void *p)
                   ^
  In file included from drivers/staging/rtl8192e/rtl819x_BAProc.c:19:0:
  include/linux/unaligned/access_ok.h:22:19: note: previous definition of 'get_unaligned_be16' was here
   static inline u16 get_unaligned_be16(const void *p)
                   ^
  ...

For independent from other include files, still suggest it includes
"asm/unaligned.h" too. And also include "asm/byteorder.h" since it is
the first include file".

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: ft1000 : replace __attribute ((__packed__) with __packed

Replace two instances of __attribute ((__packed__) with __packed macro
to address the warning found by the checkpatch.pl tool.

Signed-off-by: Geoff Darst <geoffda@comcast.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: unisys: remove unneeded structure

Delete a local structure that is only used to be initialized by memset.

A semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x,i;
@@

{
... when any
-struct i x;
<+... when != x
- memset(&x,...);
...+>
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: unisys: remove duplicate header

these header files were included multiple times

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: lustre: fixed sparse warnings related to static declarations

drivers/staging/lustre/lustre/mdc/mdc_request.c:63:5: warning: symbol 'mdc_unpack_capa' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:150:5: warning: symbol 'mdc_getstatus' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:217:5: warning: symbol 'mdc_getattr' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:261:5: warning: symbol 'mdc_getattr_name' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:444:5: warning: symbol 'mdc_setxattr' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:455:5: warning: symbol 'mdc_getxattr' was not declared. Should it be static?

Signed-off-by: Janet Liu <jianhua.ljh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: lustre: fix sparse warnings: static function declaration

Signed-off-by: Vincenzo Scotti <vinc94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lustre: Deletion of unnecessary checks before three function calls

The functions free_ll_remote_perm(), free_rmtperm_hash() and iput() test
whether their argument is NULL and then return immediately.
Thus the test around their calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rtl8723au: hal: Removed the extra semicolon

This patch fix the checkpatch.pl warning:

WARNING: Statement terminations use 1 semicolon

Signed-off-by: Anjana Sasindran <anjanasasindran123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: change some printk calls to pr_err

There are a handful of calls to printk in ni_stc.h without specified log
levels, as well as one in ni_mio_common.c.  This patch converts these
calls to pr_err() instead, so that they are now explicitly log level
ERR.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rtl8712: remove unnecessary else after return

Fixes checkpatch warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: slicoss: Fix long line issues in slicoss.c

 A patch to the slicoss.c file to fix some of the long line issues found by the
 checkpath.pl tool
 Signed-off-by: Sean Cleator <seancleator@hotmail.co.uk>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm: do not overwrite reserved pages counter at show_mem()

Minor fixlet to perform the reserved pages counter aggregation for each
node, at show_mem()

Signed-off-by: Rafael Aquini <aquini@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Johannes Weiner <jweiner@redhat.com>
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm: frontswap: invalidate expired data on a dup-store failure

If a frontswap dup-store failed, it should invalidate the expired page
in the backend, or it could trigger some data corruption issue.
Such as:
 1. use zswap as the frontswap backend with writeback feature
 2. store a swap page(version_1) to entry A, success
 3. dup-store a newer page(version_2) to the same entry A, fail
 4. use __swap_writepage() write version_2 page to swapfile, success
 5. zswap do shrink, writeback version_1 page to swapfile
 6. version_2 page is overwrited by version_1, data corrupt.

This patch fixes this issue by invalidating expired data immediately
when meet a dup-store failure.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Seth Jennings <sjennings@variantweb.net>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmpressure.c: fix race in vmpressure_work_fn()

In some android devices, there will be a "divide by zero" exception.
vmpr->scanned could be zero before spin_lock(&vmpr->sr_lock).

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=88051

[akpm@linux-foundation.org: neaten]
Reported-by: ji_ang <ji_ang@163.com>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
random: add and use memzero_explicit() for clearing data

[Cherry-picked commit d4c5efdb97773f59a2b711754ca0953f24516739 to the tip
 of linux-dm.git 'for-next' to allow for dm-crypt.c to compile without
 the need to rebase to 3.18-rcX just before the 3.19 merge window
 opens. -- snitm]

zatimend has reported that in his environment (3.16/gcc4.8.3/corei7)
memset() calls which clear out sensitive data in extract_{buf,entropy,
entropy_user}() in random driver are being optimized away by gcc.

Add a helper memzero_explicit() (similarly as explicit_bzero() variants)
that can be used in such cases where a variable with sensitive data is
being cleared out in the end. Other use cases might also be in crypto
code. [ I have put this into lib/string.c though, as it's always built-in
and doesn't need any dependencies then. ]

Fixes kernel bugzilla: 82041

Reported-by: zatimend@hotmail.co.uk
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org