Skip to contentSkip to conversation

reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER

PATCH Superseded Nishanth Menon 3 participants 5 messages Dec 1, 2015 Reset controller framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 include/linux/reset-controller.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/linux/reset-controller.h +9 -0
index ce6b962ffed4..4badecb2619e 100644
@@ -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
Signature · 1 line
2.6.2.402.g2635c2b
#1 lore raw
reproduce:

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 19727 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151201/b8cfedd7/attachment-0001.obj>

#2 lore raw
Quoted 11 lines · kbuild test robot

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 
Quoted 6 lines

All errors (new ones prefixed by >>):

In file included from drivers/reset/core.c:18:0:

Quoted 1 line
Quoted 1 line

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.

Signature · 2 lines
Regards,
Nishanth Menon
#3 lore raw

PATCH v2 1/1 reset: Introduce static inline dummy function when CONFIG_RESET_CONTROLLER is not set

In reply to Nishanth Menon

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

---

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(+)
include/linux/reset-controller.h +11 -0
index ce6b962ffed4..e294565540db 100644
@@ -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
Signature · 1 line
2.6.2.402.g2635c2b
#4 lore raw
In reply to Nishanth Menon
url: https://github.com/0day-ci/linux/commits/Nishanth-Menon/reset-Introduce-static-inline-dummy-function-when-CONFIG_RESET_CONTROLLER/20151201-233708 reproduce:

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