summaryrefslogtreecommitdiff
path: root/drivers/staging/pi433/pi433_if.c
AgeCommit message (Collapse)Author
2018-01-09staging: pi433: align function parameters with open parenthesisValentin Vidic
Fixes checkpatch warnings: CHECK: Alignment should match open parenthesis Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09staging: pi433: replace shifting with BIT macroValentin Vidic
Fixes checkpatch warnings: CHECK: Prefer using the BIT macro Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08Staging: pi433 - fix ccheckpatch issue, updated include line.Derek Robson
Updated the include of compat.h to fix checkpatch error Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08staging: pi433: fix CamelCase for payload identifiersValentin Vidic
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <payloadLength> CHECK: Avoid CamelCase: <payloadReady> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21staging: pi433: pi433_write fixed the return valueOliver Graute
The pi433_write function should return the number of processed bytes Reported-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Oliver Graute <oliver.graute@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: pi433: replace printk calls with dev_dbgValentin Vidic
Fixes checkpatch warning: WARNING: printk() should include KERN_<LEVEL> facility level Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: pi433: avoid logging ENOMEM messagesValentin Vidic
Fixes checkpatch warning: WARNING: Possible unnecessary 'out of memory' message Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: pi433: replace unsigned with unsigned intValentin Vidic
Fixes checkpatch warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: pi433: collapse else block after return statementValentin Vidic
Fixes checkpatch warning: WARNING: else is not generally useful after a break or return Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19Staging: Pi433: Bugfix for wrong argument for sizeof() in TX threadMarcus Wolf
sizeof(array) != sizeof(pointer to array) Fixes: "staging: pi433: reduce stack size in tx thread" Fixes: 62f39d49d168 ("staging: pi433: reduce stack size in tx thread") Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: pi433: remove multiple blank linesValentin Vidic
Fixes checkpatch warning for multiple blank lines in source. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: remove comparison with trueValentin Vidic
Fixes checkpatch warning for error prone comparison. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: remove comparison with falseValentin Vidic
Fixes checkpatch warning for error prone comparison. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: add blank line after functionValentin Vidic
Fixes checkpatch warning for blank line after function/struct/union/enum declarations. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: rewrite comparison with NULLValentin Vidic
Fixes checkpatch warning for comparing value with NULL. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: remove return from a void functionValentin Vidic
Fixes checkpatch warning for void function return statements. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: remove spaces before tabsValentin Vidic
Fixes checkpatch warning for hidden spaces before tabs. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: move trailing statements to next lineValentin Vidic
Fixes checkpatch error for trailing if statements. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: use tabs for code indentValentin Vidic
Fixes checkpatch error for whitespace idents. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: use consistent brace styleValentin Vidic
Fixes checkpatch error for open/close braces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: remove space inside parenthesisValentin Vidic
Fixes checkpatch error for prohibited spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: add space around operatorsValentin Vidic
Fixes checkpatch error for missing spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: add space after commaValentin Vidic
Fixes checkpatch error for missing spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: pi433: add space before open parenthesisValentin Vidic
Fixes checkpatch error for missing spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-08staging: pi433: pi433_if.c remove SET_CHECKED macroNguyen Phan Quang Minh
The macro calls its argument -a function- twice, makes the calling function return prematurely -skipping resource cleanup code- and hurts understandability. Signed-off-by: Nguyen Phan Quang Minh <minhnpq16@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Remove SET_CHECKED usage from pi433_probeSimon Sandström
SET_CHECKED returns from the function on failure and in pi433_probe it is necessary to free the GPIOs and the device on failure. Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Combine all rf69_set_amplifier_x()Simon Sandström
Replaces the functions rf69_set_amplifier_1, _2, _3 with two functions: rf69_enable_amplifier(dev, amp_mask) and rf69_disable_amplifier(dev, amp_mask). Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Remove enum data_modeSimon Sandström
Call rf69_set_data_mode with DATAMODUL_MODE value directly. Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Split rf69_set_sync_enabled into two functionsSimon Sandström
Splits rf69_set_sync_enabled(dev, enabled) into rf69_enable_sync(dev) and rf69_disable_sync(dev). Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Split rf69_set_crc_enabled into two functionsSimon Sandström
Splits rf69_set_crc_enabled(dev, enabled) into rf69_enable_crc(dev) and rf69_disable_crc(dev). Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Rename enum modShaping in rf69_enum.hSimon Sandström
Renames enum modShaping and its values to get rid of checkpatch.pl warnings: "Avoid CamelCase: <modShaping>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Rename enum optionOnOff in rf69_enum.hSimon Sandström
Renames the enum optionOnOff and its values optionOn, optionOff to enum option_on_off and OPTION_ON, OPTION_OFF. Fixes checkpatch.pl warnings: "Avoid CamelCase: <optionOnOff>, <optionOn>, <optionOff>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Rename variable in struct pi433_rx_cfgSimon Sandström
Renames variable thresholdDecrement in struct pi433_rx_cfg to threshold_decrement to get rid of checkpatch.pl warning "Avoid CamelCase: <thresholdDecrement>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06staging: pi433: Capitalize constant definitionsSimon Sandström
Fixes checkpatch.pl warnings "Avoid CamelCase <DIO_x>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: pi433: pi433_if.c codestyle fixOliver Graute
This patch fixes the following checkpatch.pl error: ERROR: spaces required around that '>=' (ctx:VxV) #930: FILE: pi433_if.c:930: + for (i--; i>=0; i--) ERROR: spaces required around that '=' (ctx:VxV) #970: FILE: pi433_if.c:970: + for (i=0; i<NUM_DIO; i++) Signed-off-by: Oliver Graute <oliver.graute@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: pi433: pi433_if.c fix codestyle on two long linesOliver Graute
This patch fixes the following checkpatch.pl warning: WARNING: line over 80 characters #1233: FILE: pi433_if.c:1233: + unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name); WARNING: line over 80 characters #1240: FILE: pi433_if.c:1240: + unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name); Signed-off-by: Oliver Graute <oliver.graute@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: pi433: fix naming when more than one radio is usedMarcin Ciupak
When using more than one hardware radio module pi433_probe fails as the same name is used for all modules. Create unique name by adding minor number to the device name. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: pi433: fix (NULL device *) in log messageMarcin Ciupak
(NULL device *) is printed in log message in pi433_probe and pi433_get_minor functions due to device->dev being used prior to call to device_create function. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: pi433: fixed signedness of 4th argument to kfifo_from_userStefano Manni
sparse warning: incorrect type in initializer (different signedness) expected unsigned int *__copied, got int *<noident> Signed-off-by: Stefano Manni <stefano.manni@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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: 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-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-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-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: 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: 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>