summaryrefslogtreecommitdiff
path: root/drivers/staging/pi433
AgeCommit message (Collapse)Author
2017-11-17Merge branch 'misc.compat' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull compat and uaccess updates from Al Viro: - {get,put}_compat_sigset() series - assorted compat ioctl stuff - more set_fs() elimination - a few more timespec64 conversions - several removals of pointless access_ok() in places where it was followed only by non-__ variants of primitives * 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (24 commits) coredump: call do_unlinkat directly instead of sys_unlink fs: expose do_unlinkat for built-in callers ext4: take handling of EXT4_IOC_GROUP_ADD into a helper, get rid of set_fs() ipmi: get rid of pointless access_ok() pi433: sanitize ioctl cxlflash: get rid of pointless access_ok() mtdchar: get rid of pointless access_ok() r128: switch compat ioctls to drm_ioctl_kernel() selection: get rid of field-by-field copyin VT_RESIZEX: get rid of field-by-field copyin i2c compat ioctls: move to ->compat_ioctl() sched_rr_get_interval(): move compat to native, get rid of set_fs() mips: switch to {get,put}_compat_sigset() sparc: switch to {get,put}_compat_sigset() s390: switch to {get,put}_compat_sigset() ppc: switch to {get,put}_compat_sigset() parisc: switch to {get,put}_compat_sigset() get_compat_sigset() get rid of {get,put}_compat_itimerspec() io_getevents: Use timespec64 to represent timeouts ...
2017-11-10pi433: sanitize ioctlAl Viro
a) those access_ok() are pointless b) guarding against the ioctl number declaration changes in that way is pointless, especially since we _know_ the size of object we want to copy. [folded braino fixes from Colin Ian King and Dan Carpenter] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-10-18staging: pi433: rf69.c style fix - space before asteriskMarcin Ciupak
This patch fixes the following checkpatch.pl error: ERROR: "(foo*)" should be "(foo *)" in rf69.c file as requested by TODO file. Additionally some style warnings remain valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging: pi433: rf69.c style fix - code indent should use tabsMarcin Ciupak
This patch fixes the following checkpatch.pl error: ERROR: code indent should use tabs where possible in rf69.c file as requested by TODO file. Additionally some style warnings remain valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging: pi433: rf69.c style fix - spaces before/afterMarcin Ciupak
his patch fixes the following checkpatch.pl errors: ERROR: space prohibited after that open parenthesis '(' ERROR: space prohibited before that ',' (ctx:WxV) ERROR: space prohibited before that close parenthesis ')' ERROR: space required after that ',' (ctx:VxV) ERROR: space required before the open parenthesis '(' in rf69.c file as requested by TODO file. Additionally some style warnings remain valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging: pi433: rf69.c style fix - spaces required aroundMarcin Ciupak
This patch fixes the following checkpatch.pl errors: ERROR: spaces required around that '+=' (ctx:WxV) ERROR: spaces required around that '=' (ctx:VxV) ERROR: spaces required around that '<' (ctx:VxV) in rf69.c file as requested by TODO file. Additionally some style warnings remain valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging: pi433: rf69.c style fix - trailing statementsMarcin Ciupak
This patch fixes the following checkpatch.pl error: ERROR: trailing statements should be on next line in rf69.c file as requested by TODO file. Note: ERROR: spaces required around that '=' (ctx:VxV) remains valid here and is going to be fixed by the next patch in set. Additionally some style warnings remain valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18Staging: pi433: Fix the position of brace after ifSrishti Sharma
Fix the position of the brace after if when it is on the next line. Done using the following semantic patch by coccinelle. @r1@ position p1, p2; @@ if(...)@p1 {@p2 ... } @script: python r2@ p1 << r1.p1; p2 << r1.p2; @@ l1 = int (p1[0].line) l2 = int (p2[0].line) c1 = int (p1[0].column_end) c2 = int (p2[0].column) if l1 == l2 and c1+1 == c2: cocci.include_match(False) @r3@ position r1.p1, r1.p2; @@ if(... - )@p1 -{@p2 +) { ... } Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-09Merge 4.14-rc4 into staging-nextGreg Kroah-Hartman
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: pi433: fix grammar issuesKeerthi Reddy
- This commit fixes spelling issues in documentation files. Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18staging: pi433: Move limit check to switch default to kill warningGeert Uytterhoeven
With gcc-4.1.2: drivers/staging/pi433/rf69.c: In function ‘rf69_set_dio_mapping’: drivers/staging/pi433/rf69.c:566: warning: ‘regaddr’ may be used uninitialized in this function drivers/staging/pi433/rf69.c:565: warning: ‘shift’ may be used uninitialized in this function drivers/staging/pi433/rf69.c:564: warning: ‘mask’ may be used uninitialized in this function While this is a false positive, it can easily be fixed by moving the limit check into the "default" case of the switch statement. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18Staging: pi433: Merge assignment with return valueMeghana Madhyastha
Removes the unnecessary assignment of retval preceding the return statement. Detected using the following Coccinelle script: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: pi433: Replace printk() with dev_dbg()Haneen Mohammed
This patch convert printk() to the preferred variant dev_dbg() and remove unnecessary comment line. Issue detected with checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: pi433: Fixes minor typo errorsHarsha Sharma
Fixes checkpatch warning -- "occured" and "succesfully" are misspelled Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-31Staging: Pi433: style fix - tabs and spacesDerek Robson
Fixed checkpatch errors, spaces before tabs. Found using checkpatch. Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-31staging: pi433: fix spelling mistake: "preample" -> "preamble"Colin Ian King
Trivial fix to spelling mistake in dev_dbg message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-28staging: pi433: fix interrupt handler signaturesCihangir Akturk
Remove "struct pt_regs *" parameter from interrupt handlers, since it is no longer passed to interrupt handlers. Also, convert return types to irqreturn_t. Additionally, move DIO_irq_handler variable into the setup_GPIO function, as it's not used outside of this function. Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-20staging: pi433: fixed coding style issuesXiangyang Zhang
space required before the open parenthesis, open brace should be on previous line. Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-18staging: pi433: replace INVALID_PARAM macro with inline codeMarcin Ciupak
The following macro: \#define INVALID_PARAM { \ dev_dbg(&spi->dev, "set: illegal input param"); \ return -EINVAL; \ } affects control flow by having return statement. This is against Linux Kernel Coding Style and should be avoided and therefore this macro is replaced by inline code. Additionally following 3 minor issues: ERROR: code indent should use tabs where possible ERROR: spaces required around that '!=' (ctx:VxV) ERROR: space prohibited before that close parenthesis ')' were fiexed inline. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-18staging: pi433: replace logical not with bitwiseQuentin Swain
sparse reports the following warning "warning: dubious: x & !y". Replaced te logical not with bitwise to resolve the warning Signed-off-by: Quentin Swain <dudebrobro179@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14staging: pi433: rf69.c style fix - spaces open braceMarcin Ciupak
This patch fixes the following checkpatch.pl error: ERROR: space required before the open brace '{' in rf69.c file as requested by TODO file. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14staging: pi433: rf69.c style fix - else close braceMarcin Ciupak
This patch fixes the following checkpatch.pl error: ERROR: else should follow close brace '}' in rf69.c file as requested by TODO file. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14staging: pi433: rf69.c style fix - that open braceMarcin Ciupak
This patch fixes the following checkpatch.pl error: ERROR: that open brace { should be on the previous line in rf69.c file as requested by TODO file. Note: ERROR: else should follow close brace '}' remains valid here and is going to be fixed by the next patch in set. Additionally some style warnings remain valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14staging: pi433: style fix - space after asteriskMarcin Ciupak
This patch is intended to fix coding style issues in order to comply with kernel coding style guide as requested by TODO file. It fixes the following checkpatch.pl error: ERROR: "foo * bar" should be "foo *bar" Note: "WARNING: line over 80 characters" remains valid here and could be fixed by another patch. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14staging: pi433: reduce stack size in tx threadArnd Bergmann
Putting a 900 byte array on the stack is a clearly too much in the kernel, and sometimes results in warnings like: drivers/staging/pi433/pi433_if.c: In function 'pi433_tx_thread': drivers/staging/pi433/pi433_if.c:645:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] This moves the buffer into the dynamically allocated per-device structure. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14staging: pi433: Use matching enum types calling rf69_set_packet_formatElia Geretto
This patch fixes the following four warnings found using sparse: drivers/staging/pi433/pi433_if.c:211:9: warning: mixing different enum types drivers/staging/pi433/pi433_if.c:211:9: int enum optionOnOff versus drivers/staging/pi433/pi433_if.c:211:9: int enum packetFormat drivers/staging/pi433/pi433_if.c:211:9: warning: mixing different enum types drivers/staging/pi433/pi433_if.c:211:9: int enum optionOnOff versus drivers/staging/pi433/pi433_if.c:211:9: int enum packetFormat drivers/staging/pi433/pi433_if.c:268:9: warning: mixing different enum types drivers/staging/pi433/pi433_if.c:268:9: int enum optionOnOff versus drivers/staging/pi433/pi433_if.c:268:9: int enum packetFormat drivers/staging/pi433/pi433_if.c:268:9: warning: mixing different enum types drivers/staging/pi433/pi433_if.c:268:9: int enum optionOnOff versus drivers/staging/pi433/pi433_if.c:268:9: int enum packetFormat This is done calling the rf69_set_packet_format function using the appropriate enum for the packetFormat argument. Signed-off-by: Elia Geretto <elia.f.geretto@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28staging: pi433: use div_u64 for 64-bit divisionArnd Bergmann
I ran into this link error on an ARM OABI build: drivers/staging/pi433/rf69.o: In function `rf69_set_frequency': rf69.c:(.text+0xc9c): undefined reference to `__udivdi3' No idea why I didn't see it with the default EABI configurations, but the right solution here seems to be to use div_u64() to get the external division implementation. Fixes: 874bcba65f9a ("staging: pi433: New driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28staging: pi433: Style fix - align block commentsDerek Robson
Fixed the alignment of block comments Found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28staging: pi433: Make functions rf69_set_bandwidth_intern staticColin Ian King
The function rf69_set_bandwidth_intern is local to the source and do not need to be in global scope, so make it static. Also break overly wide line. Cleans up sparse warning: symbol 'update_share_count' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28Staging: pi433: check error after kthread_run()Joseph Wright
Error should be checked with IS_ERR after calling kthread_run() instead of comparing the returned pointer to an int. Found by sparse warning: incompatible types for operation (<) left side has type struct task_struct *tx_task_struct right side has type int Signed-off-by: Joseph Wright <rjosephwright@gmail.com> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Tested-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28Staging: pi433: declare functions staticJoseph Wright
Declare functions static to fix sparse warnings: warning: symbol 'pi433_receive' was not declared. Should it be static? warning: symbol 'pi433_tx_thread' was not declared. Should it be static? Signed-off-by: Joseph Wright <rjosephwright@gmail.com> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28staging: pi433: depends on SPIRandy Dunlap
The pi433 driver uses SPI interfaces so it should depend on SPI. Also, the "default n" can be removed since that is already the default. Fixes these build errors when SPI is not enabled: drivers/staging/pi433/pi433_if.o: In function `pi433_probe': pi433_if.c:(.text+0x1135): undefined reference to `spi_setup' pi433_if.c:(.text+0x1177): undefined reference to `spi_write_then_read' drivers/staging/pi433/pi433_if.o: In function `pi433_init': pi433_if.c:(.init.text+0xb8): undefined reference to `__spi_register_driver' drivers/staging/pi433/rf69.o: In function `rf69_read_fifo': rf69.c:(.text+0x102): undefined reference to `spi_sync' drivers/staging/pi433/rf69.o: In function `rf69_write_fifo': rf69.c:(.text+0x248): undefined reference to `spi_sync' drivers/staging/pi433/rf69.o: In function `rf69_read_reg': rf69.c:(.text+0x290): undefined reference to `spi_write_then_read' drivers/staging/pi433/rf69.o: In function `rf69_write_reg': rf69.c:(.text+0x523): undefined reference to `spi_sync' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28staging: pi433: return -EFAULT if copy_to_user() failsdan.carpenter@oracle.com
copy_to_user() to user returns the number of bytes that weren't copied, but we should be returning -EFAULT to the user. Fixes: 874bcba65f9a ("staging: pi433: New driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-18staging: pi433: Fix a couple of spelling mistakesColin Ian King
Trivial fix to spelling mistakes in dev_dbg debug messages "wiat" -> "wait" "fonud" -> "found" Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16staging: pi433: New driverMarcus Wolf
Added a driver for the pi433 radio module (see https://www.pi433.de/en.html for details). Signed-off-by: Marcus Wolf <linux@Wolf-Entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>