From owner-freebsd-hackers@FreeBSD.ORG Mon May 2 16:40:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DFE71065672 for ; Mon, 2 May 2011 16:40:20 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id E19258FC08 for ; Mon, 2 May 2011 16:40:19 +0000 (UTC) Received: by vws18 with SMTP id 18so5780671vws.13 for ; Mon, 02 May 2011 09:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=E282lvhnOj25LYWHYovZ7DfytsxdiTbP4SWq1SPvX9U=; b=oq4x/bG6XwjpdyPIFoEhJ2EwwPdtkk4+7CvilKNPOHOiN350zEkJ8++wd6CAFln7zo p1FSsOTIBaZm1pL05/PmKvbPBIhOhV8QRVIO7bQqd/eYK/zadjTbX/iO8F3PA3IhwPnO CmHZTw3Xc2SVIzaxKfatAVmYFSkEzQwp1NcTY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Jnet6XIA96UtAvj7lfoUXY1O6EriCDy4d+ivw9WfzWiFVV4pxEIwZZqzXWVJfQKrJG kAQcxFbNKEo17OQwJACEla6FWDgVN6ic1FOe4ShbsSq4CWfyVVjW29NPHbAlC17N51IF RBwVFWi8qnOJ0aM4W5Fp7gQv5jR0MU7wmzOOo= MIME-Version: 1.0 Received: by 10.52.176.194 with SMTP id ck2mr4910180vdc.248.1304354418927; Mon, 02 May 2011 09:40:18 -0700 (PDT) Received: by 10.220.199.130 with HTTP; Mon, 2 May 2011 09:40:18 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 May 2011 09:40:18 -0700 Message-ID: From: Garrett Cooper To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] draft patch to make usr.bin/kdump WARNS?= 6 clean X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 16:40:20 -0000 On Mon, May 2, 2011 at 9:24 AM, Garrett Cooper wrote: > ---------- Forwarded message ---------- > From: Garrett Cooper > Date: Mon, May 2, 2011 at 9:24 AM > Subject: Re: [PATCH] draft patch to make usr.bin/kdump WARNS?=3D 6 clean > To: Arnaud Lacombe > > > On Mon, May 2, 2011 at 9:21 AM, Arnaud Lacombe wrote= : >> Hi, >> >> On Mon, May 2, 2011 at 12:10 PM, Garrett Cooper wro= te: >>> =A0 =A0I wanted to do something different this weekend, and I picked >>> usr.bin/kdump as a likely 'victim' for converting from WARNS?=3D 0 to >>> WARNS?=3D 6. I'm curious as to whether or not this is on the right >>> track, but here's the reasoning I used: >>> >>> 1. Conditionally include diskmbr.h or diskpc98.h based on whether or >>> not an architecture was non-pc98 or pc98 to avoid duplicate >>> definitions, because the beforementioned headers are mutually >>> exclusive. >>> 2. Move the sockfamilyname declaration to kdump_subr.h as it's used in >>> the generated ioctl.c file. >>> 3. Fix a signed vs unsigned comparison with a simple cast because the >>> size_t value will be sufficiently small that it can be converted to a >>> signed comparison. >>> 4. Fix a cast assignment type source//dest value alignment issue on >>> ia64 assigning a struct sockaddr value to either struct sockaddr_in or >>> struct sockaddr_in6 by using calloc and memcpy. >>> 5. Fix structure alignment issues on arm by marking some structures as = __packed. >>> 6. Fix a shadowed declaration for flags by renaming a locally scoped >>> variable to _flags; add appropriate type to field. >>> 7. Remove unused argument to ktruser_malloc. >>> 8. Add missing declarations for ktruser_malloc and ktruser_rtld. >>> >>> =A0 =A0I've run some basic tests and things seem sane (in particular >>> ktrace'ing ktrace :)... ktrace'ing 'ssh ::1' and ktrace'ing 'ssh >>> localhost', but I was wondering if there was anything I was missing or >>> if someone else who ran arm or ia64 could test this patch out for me. >>> =A0 =A0I've run make universe on amd64, i386, ia64, mips, and pc98, and >>> things seem sane, but I can't play around with those machines to >>> determine whether or not they're functional at runtime with the above >>> changes. >>> Thanks! >>> -Garrett >>> >> I do not see any patch, either inline or attached. >> >> =A0- Arnaud >> >>> PS Oh yeah... no commit bit means that I can't commit this either, but >>> I was curious if my approach was correct before getting to that step >>> :). > > Yeah... I'm stupid for not attaching it. Need to get more sleep. Note to self: should be freeing socket structures after use, and I should apply similar logic to the rest of the socket inspection code. I'll attach another version after I do some more testing. Thanks! -Garrett