From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTE21-0004k0-0A for qemu-devel@nongnu.org; Tue, 09 Feb 2016 14:33:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTE1w-0006px-SI for qemu-devel@nongnu.org; Tue, 09 Feb 2016 14:33:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTE1w-0006ps-MU for qemu-devel@nongnu.org; Tue, 09 Feb 2016 14:32:56 -0500 References: <56BA1057.6030409@redhat.com> <20160209163119.GB3102@var.bordeaux.inria.fr> From: Thomas Huth Message-ID: <56BA3EE1.6010408@redhat.com> Date: Tue, 9 Feb 2016 20:32:49 +0100 MIME-Version: 1.0 In-Reply-To: <20160209163119.GB3102@var.bordeaux.inria.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault Cc: zhanghailiang , Li Zhijian , Stefan Hajnoczi , Jason Wang , Dave Gilbert , Vasiliy Tolstov , qemu-devel@nongnu.org, Gonglei , Jan Kiszka , Huangpeng , Yang Hongyang , Guillaume Subiron On 09.02.2016 17:31, Samuel Thibault wrote: > Thomas Huth, on Tue 09 Feb 2016 17:14:15 +0100, wrote: >>> + return (a.s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8))) >>> + == (b.s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8))); >> >> checkpatch.pl complains here: >> >> ERROR: return is not a function, parentheses are not required > > This is a false positive, there are no outer parentheses here. Ah, you're right, of course, I haven't looked closely enough, sorry. Maybe checkpatch.pl could also be silenced by putting the "==" at the end of the first line instead? >>> +static void icmp6_send_echoreply(struct mbuf *m, Slirp *slirp, struct ip6 *ip, >>> + struct icmp6 *icmp) >>> +{ >>> + struct mbuf *t = m_get(slirp); >>> + t->m_len = sizeof(struct ip6) + ntohs(ip->ip_pl); >>> + memcpy(t->m_data, m->m_data, t->m_len); >>> + >>> + /* IPv6 Packet */ >>> + struct ip6 *rip = mtod(t, struct ip6 *); >> >> Not sure how strictly this is handled in QEMU, but for proper portable >> C, variables should be declared at the beginning of a scope, as far as I >> know. > > AIUI, qemu requires C99, doesn't it? Ok, you're right again, this is even declared in the HACKING file of QEMU, so this should be fine, I think. Thomas