[powerpc:topic/math-emu 6/9] arch/sh/math-emu/math.c:129:1: warning: ISO C90 forbids mixed declarations and code

kbuild test robot fengguang.wu at intel.com
Wed Feb 10 01:58:03 AEDT 2016


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git topic/math-emu
head:   0d351023a638b7c82abdd8d66ebf5b5b3d6cb169
commit: 3b76bfd2f01f3b9101f040878e2636cdb7f3bbdd [6/9] sh/math-emu: Move sh from math-emu-old to math-emu
config: sh-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 3b76bfd2f01f3b9101f040878e2636cdb7f3bbdd
        # save the attached .config to linux build tree
        make.cross ARCH=sh 

All warnings (new ones prefixed by >>):

   In file included from arch/sh/math-emu/math.c:23:0:
   include/math-emu/single.h:76:21: warning: "__BIG_ENDIAN" is not defined [-Wundef]
   In file included from arch/sh/math-emu/math.c:24:0:
   include/math-emu/double.h:81:22: warning: "__BIG_ENDIAN" is not defined [-Wundef]
   arch/sh/math-emu/math.c:54:0: warning: "WRITE" redefined [enabled by default]
   include/linux/fs.h:199:0: note: this is the location of the previous definition
   arch/sh/math-emu/math.c:55:0: warning: "READ" redefined [enabled by default]
   include/linux/fs.h:198:0: note: this is the location of the previous definition
   arch/sh/math-emu/math.c: In function 'fadd':
>> arch/sh/math-emu/math.c:129:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
>> arch/sh/math-emu/math.c:129:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c: In function 'fsub':
   arch/sh/math-emu/math.c:136:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c:136:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c: In function 'fmac':
   arch/sh/math-emu/math.c:165:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c:165:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c:165:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c:165:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c:165:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c: In function 'ffloat':
   arch/sh/math-emu/math.c:313:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c:315:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   arch/sh/math-emu/math.c: At top level:
   arch/sh/math-emu/math.c:524:12: warning: 'ieee_fpe_handler' defined but not used [-Wunused-function]

vim +129 arch/sh/math-emu/math.c

    17	#include <asm/uaccess.h>
    18	#include <asm/processor.h>
    19	#include <asm/io.h>
    20	
    21	#include "sfp-util.h"
    22	#include <math-emu/soft-fp.h>
  > 23	#include <math-emu/single.h>
    24	#include <math-emu/double.h>
    25	
    26	#define	FPUL		(fregs->fpul)
    27	#define FPSCR		(fregs->fpscr)
    28	#define FPSCR_RM	(FPSCR&3)
    29	#define FPSCR_DN	((FPSCR>>18)&1)
    30	#define FPSCR_PR	((FPSCR>>19)&1)
    31	#define FPSCR_SZ	((FPSCR>>20)&1)
    32	#define FPSCR_FR	((FPSCR>>21)&1)
    33	#define FPSCR_MASK	0x003fffffUL
    34	
    35	#define BANK(n)	(n^(FPSCR_FR?16:0))
    36	#define FR	((unsigned long*)(fregs->fp_regs))
    37	#define FR0	(FR[BANK(0)])
    38	#define FRn	(FR[BANK(n)])
    39	#define FRm	(FR[BANK(m)])
    40	#define DR	((unsigned long long*)(fregs->fp_regs))
    41	#define DRn	(DR[BANK(n)/2])
    42	#define DRm	(DR[BANK(m)/2])
    43	
    44	#define XREG(n)	(n^16)
    45	#define XFn	(FR[BANK(XREG(n))])
    46	#define XFm	(FR[BANK(XREG(m))])
    47	#define XDn	(DR[BANK(XREG(n))/2])
    48	#define XDm	(DR[BANK(XREG(m))/2])
    49	
    50	#define R0	(regs->regs[0])
    51	#define Rn	(regs->regs[n])
    52	#define Rm	(regs->regs[m])
    53	
    54	#define WRITE(d,a)	({if(put_user(d, (typeof (d)*)a)) return -EFAULT;})
    55	#define READ(d,a)	({if(get_user(d, (typeof (d)*)a)) return -EFAULT;})
    56	
    57	#define PACK_S(r,f)	FP_PACK_SP(&r,f)
    58	#define PACK_SEMIRAW_S(r,f)	FP_PACK_SEMIRAW_SP(&r,f)
    59	#define PACK_RAW_S(r,f)	FP_PACK_RAW_SP(&r,f)
    60	#define UNPACK_S(f,r)	FP_UNPACK_SP(f,&r)
    61	#define UNPACK_SEMIRAW_S(f,r)	FP_UNPACK_SEMIRAW_SP(f,&r)
    62	#define UNPACK_RAW_S(f,r)	FP_UNPACK_RAW_SP(f,&r)
    63	#define PACK_D(r,f) \
    64		{u32 t[2]; FP_PACK_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
    65	#define PACK_SEMIRAW_D(r,f) \
    66		{u32 t[2]; FP_PACK_SEMIRAW_DP(t,f); ((u32*)&r)[0]=t[1]; \
    67			((u32*)&r)[1]=t[0];}
    68	#define PACK_RAW_D(r,f) \
    69		{u32 t[2]; FP_PACK_RAW_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
    70	#define UNPACK_D(f,r) \
    71		{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; FP_UNPACK_DP(f,t);}
    72	#define UNPACK_SEMIRAW_D(f,r) \
    73		{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
    74			FP_UNPACK_SEMIRAW_DP(f,t);}
    75	#define UNPACK_RAW_D(f,r) \
    76		{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
    77			FP_UNPACK_RAW_DP(f,t);}
    78	
    79	// 2 args instructions.
    80	#define BOTH_PRmn(op,x) \
    81		FP_DECL_EX; if(FPSCR_PR) op(D,x,DRm,DRn); else op(S,x,FRm,FRn);
    82	
    83	#define CMP_X(SZ,R,M,N) do{ \
    84		FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
    85		UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
    86		FP_CMP_##SZ(R, Fn, Fm, 2, 0); }while(0)
    87	#define EQ_X(SZ,R,M,N) do{ \
    88		FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
    89		UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
    90		FP_CMP_EQ_##SZ(R, Fn, Fm, 0); }while(0)
    91	#define CMP(OP) ({ int r; BOTH_PRmn(OP##_X,r); r; })
    92	
    93	static int
    94	fcmp_gt(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
    95	{
    96		if (CMP(CMP) > 0)
    97			regs->sr |= 1;
    98		else
    99			regs->sr &= ~1;
   100	
   101		return 0;
   102	}
   103	
   104	static int
   105	fcmp_eq(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
   106	{
   107		if (CMP(CMP /*EQ*/) == 0)
   108			regs->sr |= 1;
   109		else
   110			regs->sr &= ~1;
   111		return 0;
   112	}
   113	
   114	#define ARITH_X(SZ,OP,M,N) do{ \
   115		FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); FP_DECL_##SZ(Fr); \
   116		UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
   117		FP_##OP##_##SZ(Fr, Fn, Fm); \
   118		PACK_##SZ(N, Fr); }while(0)
   119	
   120	#define ARITH_SEMIRAW_X(SZ,OP,M,N) do{ \
   121		FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); FP_DECL_##SZ(Fr); \
   122		UNPACK_SEMIRAW_##SZ(Fm, M); UNPACK_SEMIRAW_##SZ(Fn, N); \
   123		FP_##OP##_##SZ(Fr, Fn, Fm); \
   124		PACK_SEMIRAW_##SZ(N, Fr); }while(0)
   125	
   126	static int
   127	fadd(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
   128	{
 > 129		BOTH_PRmn(ARITH_SEMIRAW_X, ADD);
   130		return 0;
   131	}
   132	

---
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: 38571 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20160209/c18ce9ec/attachment-0001.obj>


More information about the Linuxppc-dev mailing list