Commit graph

568364 commits

Author SHA1 Message Date
Himanshu Aggarwal
5d64b48dce input: synaptics_dsx_fw_update: update fw based on config id
Update the firmware based on strict config ID versioning, rather than
the entire config ID as a 4 byte number. This will also protect
against config ID major number mismatches and packrat id mismatches.

This is a propagated patch from 3.10 kernel.
commit - 458cbab5c53d5141a66590441f9567d67d580c6f,
input: synaptics_dsx_fw_update: update fw based on config id

Change-Id: I1097585d3bd8b6ab753676dc56f268c7ce52680d
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
2016-03-23 20:57:53 -07:00
Sudhakar Manapati
3c6435a9f5 input: synaptics_dsx: Read touchscreen config-id during probe
Add support for reading configuration ID from the touch controller
during probe and print it. This is required to identify if touch
controller is programmed with correct touch firmware or not.

Change-Id: I155f0392ae67e5f9b184b9cef2a7bbb7666be30d
Signed-off-by: Sudhakar Manapati <smanap@codeaurora.org>
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
2016-03-23 20:57:52 -07:00
Abinaya P
d23166718c input: synaptics_dsx: correct the debug message error
Parse the panel coordinates before using it for the debug
message.

Change-Id: I6e893b91e9f11cf7d80602058358d8256a96726d
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
2016-03-23 20:57:51 -07:00
Mohan Pallaka
358da51dda input: synaptics_dsx: squash commit from 3.14 kernel
Squash and apply the following touchscreen changes taken from the msm-3.14
kernel branch as of msm-3.14 commit 3bc54cf86b
(Merge "msm: camera: Add dummy sub module in sensor pipeline")

 b20792c2 input: synaptics_dsx: Fix security issues
 4f3ec831 input: synaptics_dsx: Remove use of deprecated INIT_COMPLETION
 8c5bd97f input: synaptics_dsx: change permission for sysfs secure_touch_enable
 b22c0b56 input: synaptics_dsx: reconfigure resolution in suspend
 0ea26697 touchscreen: synaptics_dsx: set absolute axes for touchscreen
 6a021e0a input: synaptics_dsx: handle all controller interrupts
 d3de3ed6 input: synaptics_dsx: remove query operation from reinit
 2285a8dd input: synaptics_dsx: remove vkey kobject in remove
 6817aed5 input: synaptics: Fix to secure touch clock unbalance
 44a84a1e input: synaptics_dsx: support for pm ops
 41439903 input: synaptics: add support for unprogrammed panels
 b029351d input: synaptics: remove outdated header
 d065c5e0 input: synaptics: add ability to distinguish touch part
 72ca30da input: synaptics_dsx: release pinctrl resources on probe failure
 0ab5f1e5 input: synaptics: add NULL pointer check
 ad4102c8 input: synaptics: Secure touch clocks
 6a77bbed input: synaptics_dsx: fix compilation warning when !CONFIG_PM_*
 f3488933 input: synaptics_dsx: reorder device resume sequence
 71b65447 input: synaptics_dsx: add support for 2D sensor for soft-keys
 610ecdc2 input: synaptics_dsx: fix data sysfs read-write permission
 06195779 input: synaptics_dsx: fix up world writable sysfs file
 995ed76d input: synaptics_dsx: add ability to identify controller
 69a416fe input: synaptic_dsx: configure touch panel boundary coordinates
 609eb34b input: synaptics_dsx: correct sysfs permissions
 59af5ffb input: synaptics_dsx: remove firmware update at boot
 13b71e2f input: synaptic_dsx: stay awake the device during firmware update
 dccee682 input: synaptic_dsx: add sysfs entry for force firmware update
 a4d13992 input: synaptics: secure touch support
 11c70731 input: synaptic_dsx: add debugfs support for suspend/resume
 2642f2cb input: synaptics_dsx: add standard features for touch support
 72f05e70 input: synaptics_dsx: add dual regulator support
 ab390caa input: synaptics_dsx: add device tree support
 51898424 input: synaptics_dsx: fix conflicts with other drivers

Signed-off-by: Alex Sarraf <asarraf@codeaurora.org>
2016-03-23 20:57:51 -07:00
Alexandra Chin
7ef5f9cf4e input: synaptics_dsx: Add support for synaptics_dsx touch
Change-Id: I1df8a7465fdb5c18cf69e0908347fc78ce7dd07c
Git-commit: 67b7a9d78725d5de2a1899095eb0026e15343a62
Git-repo: git://github.com/synaptics-touch/synaptics-dsx-v2.1
Signed-off-by: Alexandra Chin <alexandra.chin@tw.synaptics.com>
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2016-03-23 20:57:50 -07:00
Matt Wagantall
12cf0ae819 AndroidKernel.mk: snapshot support for building in the Android build system
This snapshot is taken as of msm-3.14 commit 3bc54cf86b (Merge "msm:
camera: Add dummy sub module in sensor pipeline")

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 20:57:49 -07:00
David Ng
f0973f476c arm64: Add 32-bit sigcontext definition to uapi signcontext.h
The arm64 uapi sigcontext.h can be included by 32-bit userspace
modules.  Since arm and arm64 sigcontext definition are not
compatible, add arm sigcontext definition to arm64 sigcontext.h.

Change-Id: I94109b094f6c8376fdaeb2822d7b26d18ddfb2bc
Signed-off-by: David Ng <dave@codeaurora.org>
2016-03-23 20:57:48 -07:00
Trilok Soni
ad00f1292b defconfig: 8996: Enable OPTIMIZE_FOR_SIZE for perf defconfig
Enable OPTMIZE_FOR_SIZE for msm-perf_defconfig and
also fix the forbidden warning found during the compilation.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-03-23 20:57:47 -07:00
Rohit Vaswani
8867904a55 defconfig: arm64: Enable some tracer options
Enable tracer options and do the automatic defconfig update

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-23 20:57:46 -07:00
Rohit Vaswani
fdeaa450d8 fixup! block/fs: keep track of the task that dirtied the page 2016-03-23 20:57:46 -07:00
Matt Wagantall
e1b2469529 trace: cpu_freq_switch: Add profiler for CPU frequency switch times
It is sometimes useful to profile how long CPU frequency switches
take, and traces have already been added for this purpose. Make
use of these and the trace_stat framework to generate statistical
histograms of frequency switch times in the following format:

 # cat /sys/kernel/debug/tracing/trace_stat/cpu_freq_switch
  CPU START_KHZ  END_KHZ COUNT AVG_US MIN_US MAX_US
    |         |        |     |      |      |      |
    0    384000  1512000     3   2787   1648   3418
    0    486000   384000     1   1129   1129   1129
    0   1458000   384000     1   3174   3174   3174
    0   1512000   384000     1   3265   3265   3265
    0   1512000   486000     1   3235   3235   3235
    0   1512000  1458000     1    213    213    213
    0   1512000  1512000     1      0      0      0

Profiling is disabled by default (since it does incur some
overhead). It can be enabled or re-disabled echoing 1 or 0
to /sys/kernel/debug/tracing/cpu_freq_switch_profile_enabled

Change-Id: I3ef7f9d681b7bd13bcaa031003b10312afe1aefe
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 20:57:45 -07:00
Mitchel Humpherys
af7618f309 soc: qcom: Add kernel_protect library and initcall
It's good security practice to make your executable code read-only.  On
hypervisor-enabled targets, this can be trivially accomplished by
removing the writable attribute from all stage-2 mappings of the kernel
text.  Add a small library and initcall to do this.

Due to constraints on the hypervisor, this needs to happen before all of
the cores are brought out of reset, so make it an early_initcall.

Change-Id: I2d3ee4ad69402d98f0f6a9078c58e66cd227d222
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-03-23 20:57:44 -07:00
Trilok Soni
6bc3fcc1f0 defconfig: msm8996: Enable ANDROID_BINDER_IPC
Enable ANDROID_BINDER_IPC for the Android compilation and
runtime dependency.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-03-23 20:57:43 -07:00
David Keitel
2dc81b385a defconfig: msm: enable OPTIMIZE_FOR_SIZE
Turn on OPTIMIZE_FOR_SIZE option to prevent warnings from IPA/MDSS.

Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-03-23 20:57:42 -07:00
David Keitel
6ccaf2a594 scripts: gcc-wrapper: allow a few forbidden warnings
Bypass a few forbidden warnings to allow msm_defconfig to build.

Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-03-23 20:57:41 -07:00
Rohit Vaswani
91a1dd684f drivers: iommu, leds, input, clk, devfreq: fix warnings
Fix some variable initializations which would otherwise cause
forbidden warnings.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-03-23 20:57:40 -07:00
Rohit Vaswani
f52a07bd52 scripts: build-all: Fix the check_kernel for MSM
Update the check in the check_kernel function for
newer kernel.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-23 20:57:40 -07:00
Matt Wagantall
5cc22e2128 checkpatch: Excuse reverts from "summary line over 75 characters" check
Rather than forcing authors of reverts to truncate the summary line
because the "Revert" prefix added pushes it over the character limit,
excuse reverts from this rule.

Change-Id: I395dfff3327e360ef935d4a685c38df6577e3867
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:57:39 -07:00
Steve Muckle
d680dbcb3a checkpatch: recognize only specific tags when ending commit text
There are some very frequently used tags that checkpatch can look
for as an ending to the commit text rather than using a pattern,
which can generate false positives in the "no commit text" rule.

Change-Id: I5b4400017b8273bcd9f5a59b3e28965c0062bef4
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:57:38 -07:00
Steve Muckle
30b0925570 checkpatch: require commit text
Commit text is almost always necessary to explain why a change is
needed. Exceptions are rare enough that these can be granted through
manual checkpatch overrides.

Change-Id: I926b2276f717940c2fec77a6709fa3088b1bf0c3
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:57:37 -07:00
Gregory Bean
8ac754201b Don't complain about MIME headers.
When patches contain extended character sets, patches will contain
MIME headers after the subject line, which should not be confused
for a too-long summary line.

Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 8e6b9d3790595198a34320f1c3f4504cd258fed1)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:57:36 -07:00
David Keitel
7461a98690 checkpatch: warn on subject line not followed by blank line
Fixed case when no warning generated for long subject line that is
wrapped to more than one line, and all lines are less than line limit.

New warning message added:
"non-blank line after summary line"
Now there are two warnings possible for the subject line, the original
line over limit and the new one. Depending on the error(s) any
combination of the two warnings are possible.

Commit text requirements now:
1) Must be less than 75 characters
2) Must be followed by blank line.

Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-03-23 20:57:21 -07:00
David Keitel
acdce03516 checkpatch: warn on long summary, commit text lines
Warn on summary or commit text lines greater than 75 characters.
The summary and commit text are indented and may wrap on a terminal
if they are longer than 75 characters.

Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-03-23 20:55:48 -07:00
Sarangdhar Joshi
790b5c34d2 checkpatch: Add exceptions for "dsb" keyword usage
Currently checkpatch.pl throws error for any use of "dsb"
keyword.  Add exceptions when it is used in a variable or a
function name.  Expectations are when 'dsb' keyword is used in a
variable or a function name, it is prefixed with class [-_>*\.]
and/or suffixed with class [-_\.;].

Change-Id: I06cd21e42135334bb41cf31f13088b118fcf3ac9
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
2016-03-23 20:52:02 -07:00
Matt Wagantall
c05453536a script: check-config-exemptions: add exemption for USB_CONFIGFS
Current MSM targets continue to use the USB_G_ANDROID composite
driver rather than USB_CONFIGFS.

Change-Id: Iaeab9effcea1276cbe85ebb70f5e7e2c664dccd9
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 20:52:01 -07:00
David Brown
f57edcbf72 scripts: Add script to verify Android configurations
Android kernel trees include some config fragments of options that are
required to be set or unset.  This script compares a specific full
.config with these fragments to determine which configs are possibly
missing. An exemption file for the current msm-3.18 kernel tip is
included with this commit for perf and debug defconfigs. Errors related
to configs in these files are ignored.

Change-Id: I66e65dbc01081921f6695ec626594ec022a3f3c0
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2016-03-23 20:52:00 -07:00
David Brown
0bba5777ad scripts: Call out python2 explicitly
Many systems these days have both python2 and python3 installed.  The
unversioned executable `python` may point to either version.  Per
https://www.python.org/dev/peps/pep-0394/ , scripts that need Python 2
should explicitly call this out in the shebang line.

These build scripts are both specific to python 2, so call this out in
the shebang line.

Change-Id: I11f70c341e484254dc1679db65c2ed5ac61e510f
Signed-off-by: David Brown <davidb@codeaurora.org>
2016-03-23 20:51:59 -07:00
Se Wang (Patrick) Oh
f98d3ccfab scripts: gcc-wrapper: bypass forbidden warnings with gcc5
Bypass forbidden warnings in code coming from upstream in order to
avoid compilation errors with gcc5.
sysrq.c:956:33: warning: array subscript is above array bounds
hci_sock.c:980:8: warning: passing argument 2 of 'hci_test_bit'
discards 'const' qualifier from pointer target type

Change-Id: I5056078112fdc457c424c0f49c4dca70c6b97c29
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
2016-03-23 20:51:59 -07:00
Abhimanyu Kapur
aa10e64c96 scripts: build_all: stop building mdm targets
Stop building mdm based defconfigs until all kernel
upgrade issues are resolved.

Change-Id: I988ea872c70d5c6645d52ae9d8abc1e1fcb4ec16
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-23 20:51:58 -07:00
Ian Maund
f7d2e58ed9 Revert "checkpatch.pl: add check for Change-Id"
This reverts commit 7ebd05ef16.

Our process requires Change-Id lines in our commit text while upstream
considers them to be "noise". Remove the blocking checkpatch error for
having a gerrit Change-Id line in the commit text.

Change-Id: I21c6f0e11ecd94facfc2b9a3bbfee4ed4d39609f
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2016-03-23 20:51:57 -07:00
David Brown
ccd9bd0de7 scripts: Restore some of the parallism in "all" builds
The use of min/max should not have been switched, and instead of
forcing at least "-j2" for builds, it is enforcing no more than two
jobs in parallel.  This has drastically reduced the parallelism of the
builds.

Change this to use "max" as intended so that we do make use of
available CPUs, using at least two.

Change-Id: Ifad0c98ef0ce56fc6c2368321a6cfd763e81b370
Signed-off-by: David Brown <davidb@codeaurora.org>
2016-03-23 20:51:56 -07:00
Ian Maund
f47e8c3743 scripts: gcc-wrapper: Allow upstream forbidden warnings
Bypass forbidden warnings in code coming from upstream in order to
avoid compilation errors for msm-3.18 and remove bypassed warnings
from msm-3.14.

Signed-off-by: Ian Maund <imaund@codeaurora.org>
2016-03-23 20:51:55 -07:00
David Brown
0a46b62c87 scripts: Reduce parallelism in "all" builds
Kernel builds are a bit asymmetrical in as far as CPU and memory
resources go.  Compilation itself tends to scale fairly linearly in
RAM usage per number of CPUs.  However, the link phase tends to use a
fairly constant large amount of RAM and generally only one CPU.

The existing attempt to build more in parallel has mostly resulted in
too many link steps running, which ends up swapping.

Instead of dividing the CPUs by the number of targets, just divide it
by two, and assume this will at least get us some compilation
happening during the link phase of one target build.

Change-Id: I0f8cac2d73600700d8ad6cb2a1b98e9529bb53a8
Signed-off-by: David Brown <davidb@codeaurora.org>
2016-03-23 20:51:54 -07:00
Jeff Johnson
fa047df067 checkpatch: add support for --noauthor
Commit "scripts: checkpatch.pl: warn on invalid credentials" added
to checkpatch.pl logic to unconditionally check for invalid author
credentials.  Add a flag to allow override of this behavior.

Change-Id: Ib254cc6f73c4de857ba923e6170750262cde01ad
Signed-off-by: Jeff Johnson <jjohnson@codeaurora.org>
2016-03-23 20:51:53 -07:00
Vijay Kumar Pendoti
7f055e49d5 dtc: add integer overflow checks in fdt header
Protect against integer overflows caused by malformed fdt headers.

CRs-Fixed: 749977
Change-Id: I51d87038f520bc761b163d291b0138c513c69a33
Signed-off-by: Vijay Kumar Pendoti <vpendo@codeaurora.org>
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 20:51:53 -07:00
David Brown
fb89f1cbee scripts: Add build-all.py kernel building utility
A small script to make it easier to build and test all target
configurations.  Assumes the cross compiler is in the path, and
builds all defconfigs matching certain patterns.

Change-Id: Iffe265f417a32101cfc3b054eaf3c6d6a5784ca9
Signed-off-by: David Brown <davidb@codeaurora.org>
2016-03-23 20:51:52 -07:00
David Brown
cc95d2b6c2 scripts: gcc-wrapper: Use wrapper to check compiler warnings
Rather than telling gcc to make warnings as errors, and then hunting
down make rules to disable this, leave them as warnings, but invoke
gcc through a wrapper that checks the warnings against a whitelist.

The initial whitelist comes from the warnings in the current build,
all of which have been allowed through Make overrides.

Change-Id: I5e0b199f9803d072537eeb77cb38d91cc06e951b
Signed-off-by: David Brown <davidb@codeaurora.org>
[mattw@codeaurora.org: update allowed_warnings for msm-3.14]
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 20:51:51 -07:00
Bryan Huntsman
e320afbfb1 scripts: checkpatch.pl: warn on invalid credentials
@quicinc.com identities are not allowed.  Check the "From:" field in the
patch, equivalent to the author in the git commit, and the Signed-off-by
field.

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
[imaund@codeaurora.org: Resolved context conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2016-03-23 20:51:50 -07:00
Stephen Boyd
8d19f9538f setlocalversion: Include post Linus git tags in LOCALVERSION_AUTO
The localversion detection script assumes that if there's a tag
describing the commit the toplevel Makefile would indicate what
that version is. This is usually true because Linus tags a commit
and updates the Makefile at the same time to make a release.
Unfortunately this means that any other tags made on the kernel
are ignored and not used in the localversion output.

For example, consider Linus tagged v3.0-rc5 and I have worked on
a bunch of commits based off that tag and then tagged my branch
with another tag called "changes-for-linus". Ideally I would like
to see the kernel is based off v3.0-rc5 at the tag
changes-for-linus. When localversion detects the version it
assumes that the kernel is v3.0-rc5 because a tag is on the
current commit but it doesn't confirm that the tag matches the
Makefile. It then proceeds to throw away everything after the
patch level and git commit hash from git describe output so we
lost the tag changes-for-linus and are left with:

  v3.0-rc5-0003-g234ad

Instead of doing that always try to describe the tree regardless
of whether or not there is an exact match (unless we are doing
--short output and just want to put a + after the version).
Include the hash of the tag so that we get a bit more information
about the tree that was built, but be sure to throw away any tags
from Linus himself that start with v3.* so that we get output
like:

  v3.0-rc5-g1561da-linus-0003-g234ad

Change-Id: I9c4d03c61650658676f221680c61899305c6217a
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-03-23 20:51:49 -07:00
Pankaj Kumar
feaafb2b8c checkpatch: Add check for vreg_xxx api in opensource drivers
Vreg API implementation is deprecated. We are using
Linux regulator framework now. Hence vreg API should
not be used.

Change-Id: I8e31dac66592d2d195d190b770a436e93206cf8b
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
(cherry picked from commit adfb933a24911e3514a2f1b6fe1b1a9151fec56d)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:48 -07:00
Rohit Vaswani
1660c32b1a checkpatch: Add check for gpiomux usage in msm board files
MSM has a board-*-gpiomux file where all the gpiomux configs reside.
Warn if a non gpiomux board file tries to add gpiomux configs.
The camera board file is an exception to this rule.

Change-Id: Ibab190dcbd7ea78e7ca150142c68c5ae881e4e06
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit 60d78bb9809e7d4d1c3dc1425cbfd9e649e87c1c)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:47 -07:00
Gregory Bean
994349a24e checkpatch: complain about the use of dsb().
Now that mb() does what we want, dsb() should be discouraged.

Change-Id: Ib8fe8f44f669753c3d91fac3c6e598e117d6d90e
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 9c0619be7b93ad114d6f33a749d905ddff93df7d)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:46 -07:00
Gregory Bean
fde5c031c6 checkpatch: close filp_open loophole.
filp_open allows people to get around the ban on sys_open.
Close the loophole.

Change-Id: I6e2be62e848cbc064e07008d0886c0d003c8be4b
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit bb181a18a813a70176f71a0c64aa572fcfbef0f0)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:46 -07:00
Gregory Bean
b88c73213a checkpatch: Handle long multi-line macros better.
Improve parsing of multiline macros which run beyond the available
diff context.  These beyond-the-horizon macros previously caused
two distinct naughty behaviors:
  - The scanner, confused by the trailing backslash, would grab
    the header of the next context hunk and treat it as the last
    line of the preceding macro.
  - The analyzer, unable to fully reduce the macro, would blame
    the patch for submitting an unbalanced or unprotected macro.

Change-Id: I6b7dd3d577c524d30b59dff7b20393bb5135f16d
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit ddd028c47b4d91aa9c0e97445eb584b2de367769)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:45 -07:00
Gregory Bean
cf032648eb checkpatch: deprecate unbounded string functions.
Unbounded string functions are overflow risks.  The 'n'
versions of those functions should be used instead.

Change-Id: Ice0fb3ebdae9aa88cc7e764ffdf68cbed857febf
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 15e1e97d66dd6a6039c1ec2bd549a632fe361128)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:44 -07:00
Gregory Bean
05379004cc checkpatch: forbid implied-barrier I/O functions.
Forbid read[bwl], write[bwl], in[bwl], and out[bwl], as they
contain a 'stealth barrier' which can harm performance.
Developers are expected to call appropriate __raw_* or *_relaxed
APIs and manage barriers explicitly.

Change-Id: Ie4da221c91a0505917199db9e2fdb704c3e47d44
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 032fd4ba09e195d9913c08f460130da9905936ef)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:43 -07:00
Gregory Bean
e446047078 checkpatch: Merge continuation-header handling from .38.
This commit is a cherry pick and squash of commits:
85c2ee62d37c19456c6dc83db262123956f010ac
4bc7c6001daba7d4037f54f67bae7fa90f759402

  checkpatch: Handle continuation headers.

  Continuation headers baffle checkpatch, as it can only operate
  on one line of context at a time.  When continuation headers are found,
  put them up with the header they're continuing so the whole thing
  can be parsed in a single line of context.

  checkpatch: Don't treat diffs as patches.

  The patch-header cleanup code assumed that it would only ever
  see patches, which was of course hogwash.  This lead to crazy
  results as it tried to wrap what it thought were continuation
  lines at the beginnings of raw diffs.

Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 57d50ae730a057ee1099a94a397475bfd147d97b)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:42 -07:00
Gregory Bean
40bec6699a checkpatch: forbid filesystem accesses from within the kernel.
Use of the sys_open/close/read/write system calls from within
kernel code is inappropriate, and now triggers errors.

Change-Id: I98e20513c257d0664684b7144585853f617d771a
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit ee62f2afcac1bcb180b2f0dddf2c8f5cda54bc5b)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-23 20:51:41 -07:00
Patrick Pannuto
84ea4512d9 Checkpatch: Print location when catching return code error
Display context so users can see where there error was

OLD:
	ERROR: illegal return value, please use an error code

NEW:
	ERROR: illegal return value, please use an error code
	#152: test.c:5:
	+	return -1;

Change-Id: I098004d9a5dbeb6c39b35b84ac94fd7a861849d7
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit 8d09803de5d629f3ebc9cb357a40b5937a5d171e)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:40 -07:00
Patrick Pannuto
769b0796d5 checkpatch: Check for illegal return codes
The only legal integer return is 0, anything else
following "return" should be -ERRCODE or a function.

http://lkml.org/lkml/2010/7/23/318
  There's lots of "return -1;" statements in this patch - it's obscene
  that this is used to indicate "some error occurred" in kernel space
  rather than a real errno value - even when an existing function
  (eg, request_irq) gave you an error code already.

  Please note this for the future - and please review patches on this
  point internally first.

Change-Id: I16268b2ee034f0b3b899115e45c28acfa734ddec
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit 39531a47164294315b5a7256b520fe22d6e87013)
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:51:39 -07:00