Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] macro: multiple evaluation of macro argument _dev
--

commit eeea2acb1fe471c02eee65ef8f991f70efeb7b69
Author: Jean-Philippe Brucker <[email protected]>

misc/arm-cla: Add driver skeleton and documentation

This commit introduces the initial driver skeleton and documentation for
the Arm Core Local Accelerator (CLA). It adds the required Kconfig, Makefile,
register definitions, and a common driver header.

> diff --git a/drivers/misc/arm-cla/arm-cla.h b/drivers/misc/arm-cla/arm-cla.h
> new file mode 100644
> index 0000000000000..1e8ffca28bc6e
> --- /dev/null
> +++ b/drivers/misc/arm-cla/arm-cla.h
[ ... ]
> +struct cla_dev {
> +     unsigned int cpu;
> +     struct device *dev;
> +};
> +
> +#define cla_dbg(_dev, fmt, ...) \
> +     dev_dbg((_dev)->dev, "[%u] " fmt, (_dev)->cpu, ##__VA_ARGS__)
> +#define cla_info(_dev, fmt, ...) \
> +     dev_info((_dev)->dev, "[%u] " fmt, (_dev)->cpu, ##__VA_ARGS__)
> +#define cla_err(_dev, fmt, ...) \
> +     dev_err((_dev)->dev, "[%u] " fmt, (_dev)->cpu, ##__VA_ARGS__)

[Severity: Low]
The _dev macro parameter is evaluated twice here. Could this lead to
unintended duplicate execution if a caller passes an expression with
side-effects, such as get_device(dev++)?

Would it be safer to rewrite these as static inline functions, or use a
statement expression with a local variable to evaluate _dev only once?

> +
> +#endif /* _ARM_CLA_H_ */

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to