Date: Mon, 2 May 2011 09:24:58 -0700 From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-hackers@freebsd.org Subject: Fwd: [PATCH] draft patch to make usr.bin/kdump WARNS?= 6 clean Message-ID: <BANLkTikHBVWkRDPBjSCkXLm-%2BUd-KisZgw@mail.gmail.com> In-Reply-To: <BANLkTimAZ3E6BNT606z_AN0uYGuVrN9N3A@mail.gmail.com> References: <BANLkTinR1qXERz9QJfneM4aKXhdLdz3ZtQ@mail.gmail.com> <BANLkTiniKkdQYs7vyWmoeYDjJMH%2B0oAFRg@mail.gmail.com> <BANLkTimAZ3E6BNT606z_AN0uYGuVrN9N3A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--90e6ba53a7b4f1faaa04a24d763b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ---------- Forwarded message ---------- From: Garrett Cooper <yanegomi@gmail.com> 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 <lacombar@gmail.com> On Mon, May 2, 2011 at 9:21 AM, Arnaud Lacombe <lacombar@gmail.com> wrote: > Hi, > > On Mon, May 2, 2011 at 12:10 PM, Garrett Cooper <yanegomi@gmail.com> wrot= e: >> =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. -Garrett --90e6ba53a7b4f1faaa04a24d763b Content-Type: text/x-patch; charset=US-ASCII; name="usr-bin-kdump-WARNS-6-clean.patch" Content-Disposition: attachment; filename="usr-bin-kdump-WARNS-6-clean.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gn7md5980 SW5kZXg6IHVzci5iaW4va2R1bXAva2R1bXAuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB1c3IuYmluL2tkdW1w L2tkdW1wLmMJKHJldmlzaW9uIDIyMTIxOSkKKysrIHVzci5iaW4va2R1bXAva2R1bXAuYwkod29y a2luZyBjb3B5KQpAQCAtOTksOCArOTksOSBAQAogdm9pZCBrdHJzb2NrYWRkcihzdHJ1Y3Qgc29j a2FkZHIgKik7CiB2b2lkIGt0cnN0YXQoc3RydWN0IHN0YXQgKik7CiB2b2lkIGt0cnN0cnVjdChj aGFyICosIHNpemVfdCk7Cit2b2lkIGt0cnVzZXJfbWFsbG9jKHVuc2lnbmVkIGNoYXIgKnApOw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GUKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLmJp bi9rZHVtcC9NYWtlZmlsZQkocmV2aXNpb24gMjIxMjE5KQorKysgdXNyLmJpbi9rZHVtcC9NYWtl ZmlsZQkod29ya2luZyBjb3B5KQpAQCAtMTUsNyArMTUsNyBAQAogU1JDUys9CQlsaW51eF9zeXNj YWxscy5jCiAuZW5kaWYKIAotV0FSTlM/PQkJMAorV0FSTlM/PQkJNgogCiBDTEVBTkZJTEVTPQlp b2N0bC5jIGtkdW1wX3N1YnIuYyBsaW51eF9zeXNjYWxscy5jCiAK --90e6ba53a7b4f1faaa04a24d763b--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTikHBVWkRDPBjSCkXLm-%2BUd-KisZgw>