Skip to contentSkip to conversation

MIPS: use inline directive for __in*s functions

PATCH New Gabor Juhos 2 participants 4 messages Jan 16, 2013 – Jan 22, 2013 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 MIPS: use inline directive for __in*s functions

All other IO accessor functions are using the 'inline' directive. Use that also for the __in*s to make it consistent with the other variants.

Cc Daniel Schwierzeck <[email protected]>

---
NOTE: checkpatch.pl throwns an error for the patch:

0001-MIPS-use-inline-directive-for-__in-s-functions.patch:24: ERROR: open brace '{' following function declarations go on the next line
total: 1 errors, 0 warnings, 8 lines checked

However that error is already present if the 'arch/mips/include/asm/io.h' file is checked with checkpatch.pl. The cleanup should be done in a separare patch.

---
 arch/mips/include/asm/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/io.h +1 -1
index 80eab75..50466f2 100644
@@ -268,7 +268,7 @@ __OUT1(s##c_p) __OUT2(m) : : "r" (__ioswab##w(value)), "ir" (port), "r" (mips_io
 	SLOW_DOWN_IO; }
 
 #define __IN1(t,s) \
-extern __inline__ t __in##s(unsigned int port) { t _v;
+extern inline t __in##s(unsigned int port) { t _v;
 
 /*
  * Required nops will be inserted by the assembler
Signature · 1 line
1.7.10
#1 lore raw

PATCH 2/2 MIPS: convert IO port accessor functions to 'static inline'

The currently used 'extern inline' directive causes the following compiler warnings if CONFIG_SWAP_IO_SPACE is defined:

<...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outlc_p' which is not static [enabled by default] <...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outl_p' which is not static [enabled by default] <...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outlc' which is not static [enabled by default] <...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outl' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outwc_p' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outw_p' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outwc' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outw' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inlc_p' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inl_p' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inlc' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inl' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inwc_p' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inw_p' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inwc' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inw' which is not static [enabled by default]

Cc Daniel Schwierzeck <[email protected]>

---
NOTE: checkpatch.pl throwns some errors/warnings for the patch:

0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:42: ERROR: open brace '{' following function declarations go on the next line 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:51: ERROR: open brace '{' following function declarations go on the next line 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: WARNING: line over 80 characters 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: ERROR: "foo * bar" should be "foo *bar" 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: ERROR: open brace '{' following function declarations go on the next line 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: WARNING: line over 80 characters 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: ERROR: "foo * bar" should be "foo *bar" 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: ERROR: open brace '{' following function declarations go on the next line

However those errors are already present if the 'arch/mips/include/asm/io.h' file is checked with checkpatch.pl. The cleanup should be done in a separare patch.

---
 arch/mips/include/asm/io.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/mips/include/asm/io.h +4 -4
index 50466f2..3864c80 100644
@@ -254,7 +254,7 @@ out:
  */
 
 #define __OUT1(s) \
-extern inline void __out##s(unsigned int value, unsigned int port) {
+static inline void __out##s(unsigned int value, unsigned int port) {
 
 #define __OUT2(m) \
 __asm__ __volatile__ ("s" #m "\t%0,%1(%2)"
@@ -268,7 +268,7 @@ __OUT1(s##c_p) __OUT2(m) : : "r" (__ioswab##w(value)), "ir" (port), "r" (mips_io
 	SLOW_DOWN_IO; }
 
 #define __IN1(t,s) \
-extern inline t __in##s(unsigned int port) { t _v;
+static inline t __in##s(unsigned int port) { t _v;
 
 /*
  * Required nops will be inserted by the assembler
@@ -283,7 +283,7 @@ __IN1(t,s##_p) __IN2(m) : "=r" (_v) : "i" (0), "r" (mips_io_port_base+port)); SL
 __IN1(t,s##c_p) __IN2(m) : "=r" (_v) : "ir" (port), "r" (mips_io_port_base)); SLOW_DOWN_IO; return __ioswab##w(_v); }
 
 #define __INS1(s) \
-extern inline void __ins##s(unsigned int port, void * addr, unsigned long count) {
+static inline void __ins##s(unsigned int port, void * addr, unsigned long count) {
 
 #define __INS2(m) \
 if (count) \
@@ -311,7 +311,7 @@ __INS1(s##c) __INS2(m) \
 	: "$1");}
 
 #define __OUTS1(s) \
-extern inline void __outs##s(unsigned int port, const void * addr, unsigned long count) {
+static inline void __outs##s(unsigned int port, const void * addr, unsigned long count) {
 
 #define __OUTS2(m) \
 if (count) \
Signature · 1 line
1.7.10
#3 lore raw

PATCH 1/2 MIPS: use inline directive for __in*s functions

In reply to Gabor Juhos

2013/1/16 Gabor Juhos <[email protected]>:

Quoted 13 lines

All other IO accessor functions are using the 'inline' directive. Use that also for the __in*s to make it consistent with the other variants.

Cc Daniel Schwierzeck <[email protected]>

---
NOTE: checkpatch.pl throwns an error for the patch:

0001-MIPS-use-inline-directive-for-__in-s-functions.patch:24: ERROR: open brace '{' following function declarations go on the next line
total: 1 errors, 0 warnings, 8 lines checked

Quoted 8 lines

However that error is already present if the 'arch/mips/include/asm/io.h' file is checked with checkpatch.pl. The cleanup should be done in a separare patch.

---
 arch/mips/include/asm/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

applied to u-boot-mips/master, thanks

Signature · 2 lines
Best regards,
Daniel
#2 lore raw

PATCH 2/2 MIPS: convert IO port accessor functions to 'static inline'

In reply to Gabor Juhos

2013/1/16 Gabor Juhos <[email protected]>:

Quoted 36 lines

The currently used 'extern inline' directive causes the following compiler warnings if CONFIG_SWAP_IO_SPACE is defined:

<...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outlc_p' which is not static [enabled by default] <...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outl_p' which is not static [enabled by default] <...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outlc' which is not static [enabled by default] <...>/include/asm/io.h:345:1: warning: '__fswab32' is static but used in inline function '__outl' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outwc_p' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outw_p' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outwc' which is not static [enabled by default] <...>/include/asm/io.h:344:1: warning: '__fswab16' is static but used in inline function '__outw' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inlc_p' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inl_p' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inlc' which is not static [enabled by default] <...>/include/asm/io.h:341:1: warning: '__fswab32' is static but used in inline function '__inl' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inwc_p' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inw_p' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inwc' which is not static [enabled by default] <...>/include/asm/io.h:340:1: warning: '__fswab16' is static but used in inline function '__inw' which is not static [enabled by default]

Cc Daniel Schwierzeck <[email protected]>

---
NOTE: checkpatch.pl throwns some errors/warnings for the patch:

0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:42: ERROR: open brace '{' following function declarations go on the next line 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:51: ERROR: open brace '{' following function declarations go on the next line 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: WARNING: line over 80 characters 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: ERROR: "foo * bar" should be "foo *bar" 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: ERROR: open brace '{' following function declarations go on the next line 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: WARNING: line over 80 characters 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: ERROR: "foo * bar" should be "foo *bar" 0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: ERROR: open brace '{' following function declarations go on the next line

Quoted 7 lines

However those errors are already present if the 'arch/mips/include/asm/io.h' file is checked with checkpatch.pl. The cleanup should be done in a separare patch.

---
 arch/mips/include/asm/io.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

applied to u-boot-mips/master, thanks

Signature · 2 lines
Best regards,
Daniel