Commit Graph

20 Commits

Author SHA1 Message Date
Marcus Wolf 202fc673c6 staging: pi433: Fixes issue with bit shift in rf69_get_modulation
Fixes issue with bit shift in rf69_get_modulation

Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 15:49:26 +01:00
Marcin Ciupak db8c7f2b64 staging: pi433: rf69.c style fix - space before asterisk
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-18 15:56:32 +02:00
Marcin Ciupak b3fbc42249 staging: pi433: rf69.c style fix - code indent should use tabs
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-18 15:56:32 +02:00
Marcin Ciupak 329822a02f staging: pi433: rf69.c style fix - spaces before/after
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-18 15:56:32 +02:00
Marcin Ciupak 308d32efc4 staging: pi433: rf69.c style fix - spaces required around
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-18 15:56:32 +02:00
Marcin Ciupak 4a74749a50 staging: pi433: rf69.c style fix - trailing statements
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-18 15:56:32 +02:00
Greg Kroah-Hartman 1236d6bb6e Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-09 09:02:35 +02:00
Geert Uytterhoeven b72703e26b staging: pi433: Move limit check to switch default to kill warning
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-18 12:25:31 +02:00
Meghana Madhyastha e2614ef1b2 Staging: pi433: Merge assignment with return value
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-18 12:00:07 +02:00
Colin Ian King 5dcf92266c staging: pi433: fix spelling mistake: "preample" -> "preamble"
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-31 18:28:34 +02:00
Marcin Ciupak e221b2b11b staging: pi433: replace INVALID_PARAM macro with inline code
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-18 15:57:15 -07:00
Quentin Swain f2aee92d18 staging: pi433: replace logical not with bitwise
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-18 15:57:15 -07:00
Marcin Ciupak b4bac77f2a staging: pi433: rf69.c style fix - spaces open brace
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-14 17:55:49 -07:00
Marcin Ciupak 46659ed7f6 staging: pi433: rf69.c style fix - else close brace
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-14 17:55:48 -07:00
Marcin Ciupak 9391cb3160 staging: pi433: rf69.c style fix - that open brace
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-14 17:55:48 -07:00
Marcin Ciupak 35acd78f05 staging: pi433: style fix - space after asterisk
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-14 17:54:26 -07:00
Arnd Bergmann 99859541a9 staging: pi433: use div_u64 for 64-bit division
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: 874bcba65f ("staging: pi433: New driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28 17:03:19 -07:00
Derek Robson 056eeda2f9 staging: pi433: Style fix - align block comments
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-28 17:03:19 -07:00
Colin Ian King 775f6ab013 staging: pi433: Make functions rf69_set_bandwidth_intern static
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-28 16:59:16 -07:00
Marcus Wolf 874bcba65f staging: pi433: New driver
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>
2017-07-16 16:58:13 +02:00