This script allowes to remove the redundant semicolon from
`if`, `switch`, `while`, `for` statements.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Unsigned expressions cannot be less than zero and presence
of such practices very likely indicates a bug.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
This script finds cases of missing locks in the code.
There is some possibilty of false positives in cases
where a particular function is supposed to exit with
the lock held or there is any preceding function call
that releases the lock.
Suggested-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
* Provide a single liner description at top using `///`
comments. This one liner is displayed when using `--verbose`
mode of coccicheck.
* Specify Condidence level property adhering to coccinelle.rst
section "Proposing new semantic patches".
* Add virtual patch rule to handle the patch case when coccicheck
is supplied with `--mode=patch` option.
* Add `depends on !(file in "ext")` to ignore reports from `ext/`
directory.
* Simplify rule to use disjunctions and use "exists" to match any
available control path.
Suggested-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
* Provide a single liner description at top using `///`
comments. This one liner is displayed when using `--verbose`
mode of coccicheck.
* Specify Condidence level property adhering to coccinelle.rst
section "Proposing new semantic patches".
* Add virtual patch rule to handle the patch case when coccicheck
is supplied with `--mode=patch` option.
* Add `depends on !(file in "ext")` to ignore reports from `ext/`
directory.
* Simplify patch rule to reduce effort in reconstruction since
logically we are only *adding* void cast.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
This script finds cases of NULL dereferences where a variable
is dereferenced under a NULL test, even though it is known
to be NULL.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
* Use `expression` metavariable instead of `constant` to catch
missing cases such as:
diff -u -p a/subsys/net/ip/rpl.c b/subsys/net/ip/rpl.c
--- a/subsys/net/ip/rpl.c
+++ b/subsys/net/ip/rpl.c
@@ -686,7 +686,7 @@ static void new_dio_interval(struct net_
{
u32_t time;
- time = 1 << instance->dio_interval_current;
+ time = BIT(instance->dio_interval_current);
* Provide a single liner description at top using `///`
comments. This one liner is displayed when using `--verbose`
mode of coccicheck.
* Specify Condidence level property adhering to coccinelle.rst
section "Proposing new semantic patches".
* Add virtual patch rule to handle the patch case when coccicheck
is supplied with `--mode=patch` option.
* Edit patch rule to remove redundant parentheses in the output.
* Add `depends on !(file in "ext")` to ignore reports from `ext/`
directory.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Add missing directory `scripts/coccinelle/` to the maintainer
list of Coccinelle Infrastructure, which was assigned
recently in commit d88421db37
This directory is used to add new coccinelle scripts.
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Currently, if CONFIG_LOG_PROCESS_THREAD is enabled, log processing
does not start until just before the main() function is called in
the user sample. This means that no real-time logging information
will be sent to the backends while drivers and/or other processes
which are triggered during kernel boot are processing their tasks.
Worse, if they take a longish time to finish, the user is
presented with a blank log backend regardless of the debug levels.
Let's start processing logs earlier to avoid this issue.
NOTE: Since this thread is now triggered specifically rather than
started during static thread init, let's also name it.
Signed-off-by: Michael Scott <mike@foundries.io>
This adds a possibility to unregister GATT SMP service.
Using this function, device can disable Firmware Update
functionality, if not needed.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Issue found using Coccinelle. Semaphore is not required at all
in this application.
Fixes#11150
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Add support for exchanging both minimum and maximum
connection interval values in Connection Parameter Request
Procedure implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove either duplicate settings between arch & board, or just set
HAS_DTS at the arch level since all the boards for a given arch support
DTS now.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Improved RX path to use ring buffer for incoming data instead of single
byte buffer. Improved TX path to use ring buffer. Added support for
asynchronous UART API (interrupts).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The Atmel SAM E70 flash has a 16-byte write block size. Increase the
NVS_BLOCK_SIZE a bit and take some margin. This might also improve the
performances by reducing the calls to the flash driver when moving data
during garbage collection.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
When the write block size is bigger than sizeof(nvs_ate), which is 8
bytes, we should not read or write more than the ATE. The
_nvs_flash_al_wrt() function will take care of padding the write with
0xff up to write_block_size. Of course the addresses should still be
incremented by write_block_size.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
VLA are usually not recommended and are a MISRA C violation. Replace
fs->write_block_size by NVS_BLOCK_SIZE as we now have a check at
initialization that ensures that fs->write_block_size <= NVS_BLOCK_SIZE.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
In case the write block size is bigger than NVS_BLOCK_SIZE, some
functions end up in an endless loop. Detect the unsupported cases
at initialization.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit moves the block of the early return before
the derivation of the stack size, to avoid unnecessary
operations if this is not a user thread.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In user mode a thread stack will include the optional
stack guard area (present if MPU_STACK_GUARD is defined.
The guard area has been originally take out of the thread
stack size calculation. For MPUs with no power-of-two size
requirement, we need to increase the size of the MPU region
for user-mode, to account for the additional guard region.
MPUs with power-of-two size requirement will, anyway, round
up the region size to the next power of two.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This enables the USBHS interface on the Atmel SMART SAM E70 Xplained
Board, by adding an entry to the DTS. It also updates the documentation
and mark usb_device as supported for the tests.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This patch adds a USB device driver for the USBHS device that can be
found on Atmel SAM E70 SoC family. Only the FIFO mode is supported
(as opposed to DMA). It supports LS, FS and HS modes, but defaults to
FS mode as Zephyr does not fully support HS mode yet.
Tested examples on an Atmel SMART SAM E70 Xplained Board:
* usb/cdc_acm
* usb/hid-mouse
* usb/mass
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
When Python3 is not found the build system will warn the user and then
continue. Python3 is required and continuing can only confuse the user
with new off-topic error messages.
This patch denotes Python3 as required to resolve this.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Fallback to L2CAP Connection Parameters Update Request if LL Connection
Update Request was rejected by remote device that has this marked as
supported in features. This can happen if procedure is supported only
by remote controller, but not enabled by host. This is connection
parameters update with iOS devices.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Some places are using the same tag identifier with different types.
This is a MISRA-C violation and makes the code less readable.
MISRA-C rule 5.7
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
According with MISRA-C and unconditional break statement must
terminate every switch-clause.
MISRA-C rule 16.1 and 16.3
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Other ST boards have their openocd.cfg support file updated,
but Nucleo L476RG was still looking for board/st_nucleo_l476rg.cfg
and fails with Zephyr SDK 0.9.5.
Signed-off-by: Kiril Zyapkov <k.zyapkov@allterco.com>
Add support for out-of-tree shields. Out-of-tree shields can now be
stored in out-of-tree board directories.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Application shared memory API uses 'appmem_' prefix for
its functions and macros. This commit updates the respective
documentation to align with the API convention.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Some minor style and typo fixes in
tests/kernel/mem_protect/userspace/src/main.c.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Add clocks property in stm32l4r5 devices.
Replace i2c2 node by i2c3 node in l4.dtsi as i2c3 available
in all stm32l4 SoCs while i2c2 is not available in some parts.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Peripheral drivers are already available but cannot be enabled trough
Kconfig. This allow project to use nrfx drivers.
Signed-off-by: Christopher Métrailler <christopher.metrailler@nordicsemi.no>
The way the code is structured the buffer is always guaranteed to be
large enough, however perform explicit termination anyway to avoid
Coverity warnings.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The code had somehow gotten corrupt (yet in a way that it compiles) so
that an intended if-branch was missing.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
i2c_burst_read can fail during read/write procedure. Therefore,
add a sanity check for its return value.
Fixes#11101
Coverity-CID: 189505
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>