Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This change removes the hardcoded subsystem list in gen_kobject_list.py
favor of marking the relevant driver API structs with the _subsystem
sentinel.
Signed-off-by: Corey Wharton <coreyw7@fb.com>
The automated process used to remove implicit casts resulted in code
that exceeded the documented line length limits. Break the assignment
into two lines where this happened.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
C++ disallows implicit cast of void pointers to a non-void pointer
type. Presence of implicit casts prevents use of these headers in C++
applications.
Process: Run the following coccinelle script:
@@
identifier V;
identifier TAG =~ "driver_api";
type T;
expression E;
@@
T* V =
+(T *)
E->TAG;
in this command line from $ZEPHYR_BASE:
spatch --sp-file expcast.cocci \
--include-headers --dir include/ --very-quiet \
| sed -e '/^\+/s@\*) @*)@' \
| (cd include/ ; patch -p1)
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.
The inclusion of the generated syscall files is placed outside the
extern "C" block as the generated file has its own extern "C" block.
Background from issue #17997:
Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.
Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.
See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
It is useful that the ptp_clock_get() function can be called from
the userspace. Create also unit test for calling that function
from userspace.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Defines a PTP clock driver that can be implemented in those network
interface drivers that provide gPTP support.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Julien Chevrier <julien.chevrier@intel.com>