aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-07-03rtc: rtc-88pm80x: remove unnecessary platform_set_drvdata()Jingoo Han1-1/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03kprobes: handle empty/invalid input to debugfs "enabled" fileMathias Krause1-0/+3
When writing invalid input to 'debug/kprobes/enabled' it'll silently be ignored. Even worse, when writing an empty string to this file, the outcome is purely random as the switch statement will make its decision based on the value of an uninitialized stack variable. Fix this by handling invalid/empty input as error returning -EINVAL. Signed-off-by: Mathias Krause <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Anil S Keshavamurthy <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Masami Hiramatsu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03insert missing space in printk line of root_delayToralf Förster1-1/+1
Trivial, but it really looks better. Signed-off-by: Toralf Förster <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03init: remove permanent string buffer from do_one_initcall()Steven Rostedt1-2/+1
do_one_initcall() uses a 64 byte string buffer to save a message. This buffer is declared static and is only used at boot up and when a module is loaded. As 64 bytes is very small, and this function has very limited scope, there's no reason to waste permanent memory with this string and not just simply put it on the stack. Signed-off-by: Steven Rostedt <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: cache last camelcase hash as .checkpatch-camelcase.<commit>Joe Perches1-0/+26
Add a file to cache the CamelCase variables found by <commit> to reduce the time it takes to scan the include/ directory. Filename is '.checkpatch-camelcase.<commit>' and it is created only only if a .git directory exists. <commit> is determined by the last non-merge commit id in the include/ path. Reduces checkpatch run time by ~12 cpu seconds on my little netbook. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: allow longer logging function namesJacob Keller1-1/+1
The current $logFunction regular expression allows names like dev_warn, e_dbg, netdev_info, etc, but some log functions are now written like e_dev_warn, so allow 1 or 2 word blocks with an underscore before the logging level. Signed-off-by: Jacob Keller <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: ignore existing CamelCase uses from include/...Joe Perches1-7/+50
When using --strict, CamelCase uses are described with CHECK: messages. These CamelCase uses may be acceptable and should not generate these messages when the variable is already defined in a file from the include/... path. So, change checkpatch to read all the .h files in include/... and look for preexisting CamelCase #defines, typedefs and function prototypes. Add these to the existing camelcase hash so that any uses in the patch or file can be ignored. There are currently ~3500 files in include/. It takes about 10 cpu seconds on my little netbook to grep for and preseed these existing uses. That's about 4x the time for a similar git grep. This preseeding is only done once when using --strict and only when there is a CamelCase use found. If a .git directory is found, it uses 'git ls-files include' If not, it uses 'find $root/include -name "*.h" Signed-off-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: ignore SI unit CamelCase variants like "_uV"Joe Perches1-0/+3
Many existing variable names use SI like variants that should be otherwise obvious and acceptable. Whitelist them from the CamelCase message. Signed-off-by: Joe Perches <[email protected]> Suggested-by: Phil Carmody <[email protected]> Acked-by: Phil Carmody <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: move test for space before semicolon after operator spacingJoe Perches1-10/+10
Moving this test allows the --fix option to work better. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: create an EXPERIMENTAL --fix option to correct patchesJoe Perches1-88/+354
Some patches have simple defects in whitespace and formatting that checkpatch could correct automatically. Attempt to do so. Add a --fix option to create a "<inputfile>.EXPERIMENTAL-checkpatch-fixes" file that tries to use normal kernel style for some of these formatting errors. Add warnings against using this file without verifying the changes. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: improve "no space after cast" testJoe Perches1-2/+3
Some false positives exist on this test. For instance: *va_arg(args, signed char *) = val.s; or memset(foo, 0, sizeof(struct bar *) * baz)); Ignore lines that have an arithmetic operator or assignment after what appears to be a cast to a pointer "(foo *)". Add $Arithmetic convenience variable. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: add a --strict test for comparison to true/falseJoe Perches1-0/+27
Comparing to true or false is error prone. Add tests for the various forms of (foo == true) && (false != bar) that are only reported with --strict. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: don't warn on blank lines before/after braces as oftenJoe Perches1-2/+2
Check to make sure the blank lines aren't comment lines like: bool foo(bool bar) { /* Don't warn on a leading comment */ return !bar; /* Don't warn on a trailing comment either */ } Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: add a placeholder to check blank lines before declarationsJoe Perches1-0/+8
Figure out first how to determine if this is in a struct declaration or in a function body before enabling this. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: reduce false positive rate of "complex macros"Joe Perches1-1/+1
Allow "#define foo struct.member" without bleating a warning. This also allows "#define foo bar.baz->qux" and so on. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: warn on comparisons to get_jiffies_64()Joe Perches1-0/+6
Comparing get_jiffies_64() is almost always wrong and time_before64 and time_after64 should be used instead. Warn on any comparison to get_jiffies_64(). Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: warn on comparisons to jiffiesJoe Perches1-0/+6
Comparing jiffies is almost always wrong and time_before and time_after should be used instead. Warn on any comparison to jiffies. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: warn when networking block comment lines don't start with *Joe Perches1-0/+8
Some block comments in network are written as: /* block comment line 1 block comment line 2 */ Emit a warning on the "block comment line 2" because it should be /* block comment line 1 * block comment line 2 */ This warning is only emitted on the second line of a block comment. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: improve network block comment test and messageJoe Perches1-2/+2
Show the first line of the comment after a line with just /* to better show where the defective comment style is in the file. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: remove quote from CamelCase testJoe Perches1-2/+2
Commit be987d9f80 ("checkpatch: improve CamelCase test for Page") added it but it shouldn't be there. Must have been my fault. Make sure that the tested variable doesn't contain a constant. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: add --strict preference for p = kmalloc(sizeof(*p)...Joe Perches1-0/+8
Add another test for memory allocation style to follow Documentation/CodingStyle: Chapter 14: Allocating memory The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...); Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: warn when using gcc's binary constant ("0b") extensionJoe Perches1-2/+14
The gcc extension for binary constants that start with 0b is only supported with gcc version 4.3 or higher. The kernel can still be compiled with earlier versions of gcc, so have checkpatch emit a warning for these constants. Restructure checkpatch's constant finding code a bit to support finding these binary constants. Signed-off-by: Joe Perches <[email protected]> Suggested-by: Andrew Morton <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03checkpatch: change CamelCase test and make it --strictJoe Perches1-3/+3
Do not bleat a message on nominally acceptable CamelCase uses that are separated by an _ like drm_core_has_MTRR. CamelCase tests are also a bit noisy against certain types of code acceptable to some kernel developers. Make the test applicable only with --strict. Signed-off-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03lib/percpu_counter.c: __this_cpu_write() doesn't need to be protected by ↵Fan Du1-1/+1
spinlock __this_cpu_write doesn't need to be protected by spinlock, AS we are doing per cpu write with preempt disabled. And another reason to remove __this_cpu_write outside of spinlock: __percpu_counter_sum is not an accurate counter. Signed-off-by: Fan Du <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03ipw2200: convert __list_for_each usage to list_for_eachDave Jones1-1/+1
Signed-off-by: Dave Jones <[email protected]> Cc: Stanislav Yakovlev <[email protected]> Cc: "John W. Linville" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03radeon: remove redundant __list_for_each definition from mkregtable.cDave Jones1-13/+0
Signed-off-by: Dave Jones <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03backlight: convert from legacy pm ops to dev_pm_opsShuah Khan1-3/+7
Convert drivers/video/backlight/class to use dev_pm_ops for power management and remove Legacy PM ops hooks. With this change, backlight class registers suspend/resume callbacks via class->pm (dev_pm_ops) instead of Legacy class->suspend/resume. When __device_suspend() runs call-backs, it will find class->pm ops for the backlight class. [[email protected]: add CONFIG_PM_SLEEP to suspend/resume functions] Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Jingoo Han <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Jingoo Han <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Arnd Bergmann <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03MAINTAINERS: add Backlight subsystem co-maintainerJingoo Han1-0/+1
Add myself as co-maintainer for the backlight subsystem. Signed-off-by: Jingoo Han <[email protected]> Cc: Richard Purdie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03lcd: add devm_lcd_device_{register,unregister}()Jingoo Han2-0/+75
These functions allow the driver core to automatically clean up any allocation made by lcd drivers. Thus it simplifies the error paths. Signed-off-by: Jingoo Han <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03backlight: add devm_backlight_device_{register,unregister}()Jingoo Han2-0/+81
These functions allow the driver core to automatically clean up any allocation made by backlight drivers. Thus it simplifies the error paths. Signed-off-by: Jingoo Han <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03backlight: pcf50633: remove unnecessary platform_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03backlight: lp8788: remove unnecessary platform_set_drvdata()Jingoo Han1-1/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03backlight: ep93xx: remove unnecessary platform_set_drvdata()Jingoo Han1-1/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03backlight: atmel-pwm-bl: remove unnecessary platform_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d06310 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03MAINTAINERS: fix tape driver file mappingsJean Delvare1-3/+6
The masks for the st and osst tape drivers in MAINTAINERS are too broad and include unrelated files. Make the file list accurate so that maintainers of these drivers aren't bothered with unrelated work. Signed-off-by: Jean Delvare <[email protected]> Cc: Willem Riede <[email protected]> Cc: Kai Mäkisara <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drivers/misc/sgi-gru/grufault.c: fix a sanity test in gru_set_context_option()Dimitri Sivanich1-2/+3
"req.val1 == -1" is valid but it doesn't make sense to check gru_base[-1]. gru_base[] is a global array. Signed-off-by: Dimitri Sivanich <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Robin Holt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drivers/dma: remove unused support for MEMSET operationsBartlomiej Zolnierkiewicz18-462/+8
There have never been any real users of MEMSET operations since they have been introduced in January 2007 by commit 7405f74badf4 ("dmaengine: refactor dmaengine around dma_async_tx_descriptor"). Therefore remove support for them for now, it can be always brought back when needed. [[email protected]: fix drivers/dma/mv_xor] Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Sebastian Hesselbarth <[email protected]> Cc: Vinod Koul <[email protected]> Acked-by: Dan Williams <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Olof Johansson <[email protected]> Cc: Kevin Hilman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drm/i915: quirk away phantom LVDS on Intel's D525MW mainboardJani Nikula1-0/+8
This replaceable mainboard only has a VGA-out, yet it claims to also have a connected LVDS header. Addresses https://bugs.freedesktop.org/show_bug.cgi?id=65256 Signed-off-by: Jani Nikula <[email protected]> Reported-by: Cornel Panceac <[email protected]> Cc: Chris Wilson <[email protected]> Cc: <[email protected]> Acked-by: Daniel Vetter <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drm/i915: quirk away phantom LVDS on Intel's D510MO mainboardChris Wilson1-0/+8
This replaceable mainboard only has a VGA-out, yet it claims to also have a connected LVDS header. Addresses https://bugs.freedesktop.org/show_bug.cgi?id=63860 [[email protected]: use DMI_EXACT_MATCH for board name.] Signed-off-by: Chris Wilson <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Reported-by: <[email protected]> Cc: Cornel Panceac <[email protected]> Acked-by: Daniel Vetter <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03dmi: add support for exact DMI matches in addition to substring matchingJani Nikula2-5/+13
dmi_match() considers a substring match to be a successful match. This is not always sufficient to distinguish between DMI data for different systems. Add support for exact string matching using strcmp() in addition to the substring matching using strstr(). The specific use case in the i915 driver is to allow us to use an exact match for D510MO, without also incorrectly matching D510MOV: { .ident = "Intel D510MO", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"), }, } Signed-off-by: Jani Nikula <[email protected]> Cc: <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Cornel Panceac <[email protected]> Acked-by: Daniel Vetter <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03kernel/sys.c:do_sysinfo(): use get_monotonic_boottime()Oleg Nesterov1-2/+1
Change do_sysinfo() to use get_monotonic_boottime() instead of do_posix_clock_monotonic_gettime() + monotonic_to_bootbased(). Signed-off-by: Oleg Nesterov <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Acked-by: John Stultz <[email protected]> Cc: Tomas Janousek <[email protected]> Cc: Tomas Smetana <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03kernel/sys.c: sys_reboot(): fix malformed panic messageliguang1-1/+1
If LINUX_REBOOT_CMD_HALT for reboot failed, the message "cannot halt" will stay on the same line with the next message, so append a '\n'. Signed-off-by: liguang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03dump_stack: serialize the output from dump_stack()Alex Thorlton1-2/+45
Add functionality to serialize the output from dump_stack() to avoid mangling of the output when dump_stack is called simultaneously from multiple cpus. [[email protected]: fix comment indenting, avoid inclusion of <asm/> files - use <linux/> where possiblem fix uniprocessor build (__dump_stack undefined), remove unneeded ifdef around smp.h inclusion] Signed-off-by: Alex Thorlton <[email protected]> Reported-by: Russ Anderson <[email protected]> Reviewed-by: Robin Holt <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: David S. Miller <[email protected]> Cc: Richard Kuo <[email protected]> Cc: Jesper Nilsson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drivers: avoid parsing names as kthread_run() format stringsKees Cook19-22/+28
Calling kthread_run with a single name parameter causes it to be handled as a format string. Many callers are passing potentially dynamic string content, so use "%s" in those cases to avoid any potential accidents. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drivers: avoid format strings in names passed to alloc_workqueue()Kees Cook13-27/+24
For the workqueue creation interfaces that do not expect format strings, make sure they cannot accidently be parsed that way. Additionally, clean up calls made with a single parameter that would be handled as a format string. Many callers are passing potentially dynamic string content, so use "%s" in those cases to avoid any potential accidents. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drivers: avoid format string in dev_set_nameKees Cook23-26/+25
Calling dev_set_name with a single paramter causes it to be handled as a format string. Many callers are passing potentially dynamic string content, so use "%s" in those cases to avoid any potential accidents, including wrappers like device_create*() and bdi_register(). Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03clean up scary strncpy(dst, src, strlen(src)) usesKees Cook4-13/+10
Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the NULL should always be copied (using strlcpy), or it should not be copied (using something like memcpy). Readable code should not depend on the weird behavior of strncpy when it hits the length limit. Better to avoid the anti-pattern entirely. [[email protected]: revert getdelays.c part due to missing bsd/string.h] Signed-off-by: Kees Cook <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> [staging] Acked-by: Rafael J. Wysocki <[email protected]> [acpi] Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ursula Braun <[email protected]> Cc: Frank Blaschka <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03err.h: IS_ERR() can accept __user pointersDan Carpenter1-5/+5
Sparse generates a false positive when you pass a __user or __iomem pointer to the IS_ERR() functions. drivers/rtc/rtc-ds1286.c:344:36: sparse: incorrect type in argument 1 (different address spaces) drivers/rtc/rtc-ds1286.c:344:36: expected void const *ptr drivers/rtc/rtc-ds1286.c:344:36: got unsigned int [noderef] [usertype] <asn:2>*rtcregs We can silence these by adding a __force here and upgrading to Sparse v0.4.5-rc1 or later. This change has no effect when using current Sparse releases. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Christopher Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03arch/frv/kernel/setup.c: use strncmp() instead of memcmp()Chen Gang1-1/+1
'cmdline' is a NUL terminated string, when its length < 4, memcmp() will cause memory access out of boundary. So use strncmp() instead of memcmp(). Signed-off-by: Chen Gang <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03arch/frv/kernel/traps.c: using vsnprintf() instead of vsprintf()Chen Gang1-1/+1
Since die_if_kernel() is an extern common used function, better always check the buffer length to avoid memory overflow by a long 'str'. Signed-off-by: Chen Gang <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>