Re: [PATCH] Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element.

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

 



> >
> > diff --git a/arch/s390/tools/gen_opcode_table.c b/arch/s390/tools/gen_opcode_table.c
> > index a1bc02b29c81..468b70c85f62 100644
> > --- a/arch/s390/tools/gen_opcode_table.c
> > +++ b/arch/s390/tools/gen_opcode_table.c
> > @@ -138,7 +138,7 @@ static struct insn_type *insn_format_to_type(char *format)
> >       strcpy(tmp, format);
> >       base_format = tmp;
> >       base_format = strsep(&base_format, "_");
> > -     for (i = 0; i < sizeof(insn_type_table) / sizeof(insn_type_table[0]); i++) {
> > +     for (i = 0; i < ARRAY_SIZE(insn_type_table); i++) {
>
> This does not compile.
>
   Surprising. I try it out again.

Thanks.

-- 
       - Allen



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux