2015-12-01 15:35:55

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH] reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER

When CONFIG_RESET_CONTROLLER is not defined (example COMPILE_TEST),
provide a dummy static inline implementation.

Signed-off-by: Nishanth Menon <[email protected]>
---
include/linux/reset-controller.h | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index ce6b962ffed4..4badecb2619e 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -48,7 +48,16 @@ struct reset_controller_dev {
unsigned int nr_resets;
};

+#if IS_ENABLED(CONFIG_RESET_CONTROLLER)
int reset_controller_register(struct reset_controller_dev *rcdev);
void reset_controller_unregister(struct reset_controller_dev *rcdev);
+#else
+static inline int reset_controller_register(struct reset_controller_dev *r)
+{
+ return -EINVAL;
+}

+static inline void reset_controller_unregister(struct reset_controller_dev *r)
+{
+}
#endif
--
2.6.2.402.g2635c2b


2015-12-01 15:57:47

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER

Hi Nishanth,

[auto build test ERROR on v4.4-rc3]
[also build test ERROR on next-20151127]

url: https://github.com/0day-ci/linux/commits/Nishanth-Menon/reset-Introduce-static-inline-dummy-function-when-CONFIG_RESET_CONTROLLER/20151201-233708
config: i386-randconfig-n0-201548 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

In file included from drivers/reset/core.c:18:0:
>> include/linux/reset-controller.h:1:0: error: unterminated #ifndef
#ifndef _LINUX_RESET_CONTROLLER_H_
^

vim +1 include/linux/reset-controller.h

61fc4131 Philipp Zabel 2012-11-19 @1 #ifndef _LINUX_RESET_CONTROLLER_H_
61fc4131 Philipp Zabel 2012-11-19 2 #define _LINUX_RESET_CONTROLLER_H_
61fc4131 Philipp Zabel 2012-11-19 3
61fc4131 Philipp Zabel 2012-11-19 4 #include <linux/list.h>

:::::: The code at line 1 was first introduced by commit
:::::: 61fc41317666be400802ac793f47de816ef7bd57 reset: Add reset controller API

:::::: TO: Philipp Zabel <[email protected]>
:::::: CC: Philipp Zabel <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.26 kB)
.config.gz (19.26 kB)
Download all attachments

2015-12-01 16:07:50

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH] reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER

On 12/01/2015 09:56 AM, kbuild test robot wrote:
> Hi Nishanth,
>
> [auto build test ERROR on v4.4-rc3]
> [also build test ERROR on next-20151127]
>
> url: https://github.com/0day-ci/linux/commits/Nishanth-Menon/reset-Introduce-static-inline-dummy-function-when-CONFIG_RESET_CONTROLLER/20151201-233708
> config: i386-randconfig-n0-201548 (attached as .config)
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
> In file included from drivers/reset/core.c:18:0:
>>> include/linux/reset-controller.h:1:0: error: unterminated #ifndef
> #ifndef _LINUX_RESET_CONTROLLER_H_
> ^

Uggh.. thanks kbot... :).. my bad.. last minute whitespace editscan end
up deleting #endifs :(

While at it, will fix $subject as well.

--
Regards,
Nishanth Menon

2015-12-01 16:39:09

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V2] reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER is not set

When CONFIG_RESET_CONTROLLER is not defined (example COMPILE_TEST),
provide a dummy static inline implementation.

Signed-off-by: Nishanth Menon <[email protected]>
---

V2: Thanks to kbot, I realized i messed up the patch -> hopefully, this revision
has better luck.

V1: https://patchwork.kernel.org/patch/7738191/

include/linux/reset-controller.h | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index ce6b962ffed4..e294565540db 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -48,7 +48,18 @@ struct reset_controller_dev {
unsigned int nr_resets;
};

+#if IS_ENABLED(CONFIG_RESET_CONTROLLER)
int reset_controller_register(struct reset_controller_dev *rcdev);
void reset_controller_unregister(struct reset_controller_dev *rcdev);
+#else
+static inline int reset_controller_register(struct reset_controller_dev *r)
+{
+ return -EINVAL;
+}
+
+static inline void reset_controller_unregister(struct reset_controller_dev *r)
+{
+}
+#endif /* IS_ENABLED(CONFIG_RESET_CONTROLLER) */

#endif
--
2.6.2.402.g2635c2b

2015-12-01 20:19:14

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER

Hi Nishanth,

[auto build test WARNING on: v4.4-rc3]
[also build test WARNING on: next-20151127]

url: https://github.com/0day-ci/linux/commits/Nishanth-Menon/reset-Introduce-static-inline-dummy-function-when-CONFIG_RESET_CONTROLLER/20151201-233708
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> include/linux/reset-controller.h:1:2: sparse: unterminated preprocessor conditional
include/linux/compiler.h:228:8: sparse: attribute 'no_sanitize_address': unknown attribute
In file included from drivers/reset/core.c:18:0:
include/linux/reset-controller.h:1:0: error: unterminated #ifndef
#ifndef _LINUX_RESET_CONTROLLER_H_
^
--
>> include/linux/reset-controller.h:1:2: sparse: unterminated preprocessor conditional
>> include/linux/reset-controller.h:1:2: sparse: unterminated preprocessor conditional
include/linux/compiler.h:228:8: sparse: attribute 'no_sanitize_address': unknown attribute
In file included from drivers/clk/qcom/reset.c:17:0:
include/linux/reset-controller.h:1:0: error: unterminated #ifndef
#ifndef _LINUX_RESET_CONTROLLER_H_
^
In file included from drivers/clk/qcom/reset.h:17:0,
from drivers/clk/qcom/reset.c:20:
include/linux/reset-controller.h:1:0: error: unterminated #ifndef
#ifndef _LINUX_RESET_CONTROLLER_H_
^

vim +1 include/linux/reset-controller.h

61fc4131 Philipp Zabel 2012-11-19 @1 #ifndef _LINUX_RESET_CONTROLLER_H_
61fc4131 Philipp Zabel 2012-11-19 2 #define _LINUX_RESET_CONTROLLER_H_
61fc4131 Philipp Zabel 2012-11-19 3
61fc4131 Philipp Zabel 2012-11-19 4 #include <linux/list.h>
61fc4131 Philipp Zabel 2012-11-19 5
61fc4131 Philipp Zabel 2012-11-19 6 struct reset_controller_dev;
61fc4131 Philipp Zabel 2012-11-19 7
61fc4131 Philipp Zabel 2012-11-19 8 /**
61fc4131 Philipp Zabel 2012-11-19 9 * struct reset_control_ops

:::::: The code at line 1 was first introduced by commit
:::::: 61fc41317666be400802ac793f47de816ef7bd57 reset: Add reset controller API

:::::: TO: Philipp Zabel <[email protected]>
:::::: CC: Philipp Zabel <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation