From owner-svn-src-head@FreeBSD.ORG Wed Mar 18 04:58:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B7ECAAE; Wed, 18 Mar 2015 04:58:48 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B81EB881; Wed, 18 Mar 2015 04:58:46 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2I4wgai061825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 Mar 2015 07:58:42 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2I4wg5H061824; Wed, 18 Mar 2015 07:58:42 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 Mar 2015 07:58:42 +0300 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r280202 - head/sys/netinet Message-ID: <20150318045842.GW17947@FreeBSD.org> References: <201503180440.t2I4ebML027596@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503180440.t2I4ebML027596@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2015 04:58:48 -0000 Adrian, On Wed, Mar 18, 2015 at 04:40:37AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Wed Mar 18 04:40:36 2015 A> New Revision: 280202 A> URL: https://svnweb.freebsd.org/changeset/base/280202 A> A> Log: A> Correctly const-ify things. Why do you prefer caddr_t over 'char *'? A> Found by: clang 3.6 A> A> Modified: A> head/sys/netinet/in_rss.c A> A> Modified: head/sys/netinet/in_rss.c A> ============================================================================== A> --- head/sys/netinet/in_rss.c Wed Mar 18 02:29:51 2015 (r280201) A> +++ head/sys/netinet/in_rss.c Wed Mar 18 04:40:36 2015 (r280202) A> @@ -283,7 +283,7 @@ rss_mbuf_software_hash_v4(const struct m A> printf("%s: short TCP frame?\n", __func__); A> return (-1); A> } A> - th = (struct tcphdr *)((caddr_t)ip + iphlen); A> + th = (const struct tcphdr *)((c_caddr_t)ip + iphlen); A> return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, A> th->th_sport, A> th->th_dport, A> @@ -293,7 +293,7 @@ rss_mbuf_software_hash_v4(const struct m A> } else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4) && A> (proto == IPPROTO_UDP) && A> (is_frag == 0)) { A> - uh = (struct udphdr *)((caddr_t)ip + iphlen); A> + uh = (const struct udphdr *)((c_caddr_t)ip + iphlen); A> if (m->m_len < iphlen + sizeof(struct udphdr)) { A> printf("%s: short UDP frame?\n", __func__); A> return (-1); A> -- Totus tuus, Glebius.