From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [iproute PATCH v3] Use ARRAY_SIZE macro everywhere Date: Sun, 27 Mar 2016 10:42:36 -0700 Message-ID: <20160327104236.0c71be5d@xeon-e3> References: <20160321115905.78a2b3e1@xeon-e3> <1458661973-31210-1-git-send-email-phil@nwl.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: To: Phil Sutter Return-path: Received: from mx0a-000f0801.pphosted.com ([67.231.144.122]:28727 "EHLO mx0a-000f0801.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbcC0RmW convert rfc822-to-8bit (ORCPT ); Sun, 27 Mar 2016 13:42:22 -0400 In-Reply-To: <1458661973-31210-1-git-send-email-phil@nwl.cc> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 22 Mar 2016 16:52:53 +0100 Phil Sutter wrote: > This patch was generated by the following semantic patch (a trimmed d= own > version of what is shipped with Linux sources): >=20 > @@ > type T; > T[] E; > @@ > ( > - (sizeof(E)/sizeof(*E)) > + ARRAY_SIZE(E) > | > - (sizeof(E)/sizeof(E[...])) > + ARRAY_SIZE(E) > | > - (sizeof(E)/sizeof(T)) > + ARRAY_SIZE(E) > ) >=20 > The only manual adjustment was to include utils.h in misc/nstat.c to = make > the macro known there. >=20 > Signed-off-by: Phil Sutter > --- > Changes since v1: > - Rebased onto current master to avoid merge conflicts. >=20 > Changes since v2: > - Patch recreated from scratch. > --- > bridge/link.c | 2 +- > misc/nstat.c | 2 +- > misc/ss.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) You need to test build after coccinelle! nstat.c: In function =E2=80=98useless_number=E2=80=99: nstat.c:98:2: warning: implicit declaration of function =E2=80=98ARRAY_= SIZE=E2=80=99 [-Wimplicit-function-declaration] for (i =3D 0; i < ARRAY_SIZE(useless_numbers); i++) ^ gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarati= ons -Wold-style-definition -Wformat=3D2 -O2 -I../include -DRESOLVE_HOST= NAMES -DLIBDIR=3D\"/usr/lib\" -DCONFDIR=3D\"/etc/iproute2\" -D_GNU_SOUR= CE -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE = -DHAVE_SELINUX -DHAVE_SETNS -c -o ssfilter.o ssfilter.c gcc lnstat.o lnstat_util.o ../lib/libnetlink.a ../lib/libutil.a -lse= linux -o lnstat /tmp/ccoYmLJI.o: In function `useless_number': nstat.c:(.text+0x40): undefined reference to `ARRAY_SIZE' Please fix and resubmit