RE: [PATCH] mips/include/asm/mipsregs.h: s/u16/unsigned short/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: David Daney [mailto:ddaney.cavm@xxxxxxxxx]
> Sent: 06 December 2013 16:32
> To: Qais Yousef
> Cc: linux-mips@xxxxxxxxxxxxxx
> Subject: Re: [PATCH] mips/include/asm/mipsregs.h: s/u16/unsigned short/
> 
> On 12/06/2013 01:20 AM, Qais Yousef wrote:
> > I was getting this error when including this header in my driver:
> >
> >    arch/mips/include/asm/mipsregs.h:644:33: error: unknown type name ‘u16’
> >
> > since the use of u16 is not really necessary, convert it to unsigned short.
> >
> > Signed-off-by: Qais Yousef <qais.yousef@xxxxxxxxxx>
> > Reviewed-by: Steven J. Hill <Steven.Hill@xxxxxxxxxx>
> 
> NAK.
> 
> Just #include <linux/types.h> at the top of asm/mipsregs.h instead.

Funnily that was my first solution before I changed it to this :)

I'll resend but can you please give some explanation why changing u16 to unsigned short is bad?

Thanks,
Qais

> 
> David Daney
> 
> 
> > ---
> >   arch/mips/include/asm/mipsregs.h |    4 ++--
> >   1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/mips/include/asm/mipsregs.h
> b/arch/mips/include/asm/mipsregs.h
> > index e033141..0a2d6ef 100644
> > --- a/arch/mips/include/asm/mipsregs.h
> > +++ b/arch/mips/include/asm/mipsregs.h
> > @@ -641,9 +641,9 @@
> >    * microMIPS instructions can be 16-bit or 32-bit in length. This
> >    * returns a 1 if the instruction is 16-bit and a 0 if 32-bit.
> >    */
> > -static inline int mm_insn_16bit(u16 insn)
> > +static inline int mm_insn_16bit(unsigned short insn)
> >   {
> > -	u16 opcode = (insn >> 10) & 0x7;
> > +	unsigned short opcode = (insn >> 10) & 0x7;
> >
> >   	return (opcode >= 1 && opcode <= 3) ? 1 : 0;
> >   }
> >


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux