From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 4 15:20:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD8E18DF for ; Mon, 4 Feb 2013 15:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BEFA71A9 for ; Mon, 4 Feb 2013 15:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r14FK1ML081073 for ; Mon, 4 Feb 2013 15:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r14FK1Lq081069; Mon, 4 Feb 2013 15:20:01 GMT (envelope-from gnats) Date: Mon, 4 Feb 2013 15:20:01 GMT Message-Id: <201302041520.r14FK1Lq081069@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Andrey Simonenko Subject: Re: kern/175759: Correct data types for fields of struct qm_trace{} from X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Andrey Simonenko List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 15:20:01 -0000 The following reply was made to PR kern/175759; it has been noted by GNATS. From: Andrey Simonenko To: Gleb Smirnoff Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/175759: Correct data types for fields of struct qm_trace{} from Date: Mon, 4 Feb 2013 17:12:57 +0200 repost: forgot to send to the group. On Mon, Feb 04, 2013 at 06:14:07PM +0400, Gleb Smirnoff wrote: > Andrey, > > any additional comments for the attached patch. Is it ok from your > viewpoint? > > -- > Totus tuus, Glebius. > Index: queue.h > =================================================================== > --- queue.h (revision 245741) > +++ queue.h (working copy) > @@ -105,13 +105,14 @@ > #ifdef QUEUE_MACRO_DEBUG > /* Store the last 2 places the queue element or head was altered */ > struct qm_trace { > - char * lastfile; > - int lastline; > - char * prevfile; > - int prevline; > + const char * lastfile; > + unsigned long lastline; > + const char * prevfile; > + unsigned long prevline; > }; > > #define TRACEBUF struct qm_trace trace; > +#define TRACEBUF_INITIALIZER { __FILE__, __LINE__, NULL, 0 } , > #define TRASHIT(x) do {(x) = (void *)-1;} while (0) > #define QMD_SAVELINK(name, link) void **name = (void *)&(link) > > @@ -134,6 +135,7 @@ > #define QMD_TRACE_HEAD(head) > #define QMD_SAVELINK(name, link) > #define TRACEBUF > +#define TRACEBUF_INITIALIZER > #define TRASHIT(x) > #endif /* QUEUE_MACRO_DEBUG */ > > @@ -461,7 +463,7 @@ > } > > #define TAILQ_HEAD_INITIALIZER(head) \ > - { NULL, &(head).tqh_first } > + { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } > > #define TAILQ_ENTRY(type) \ > struct { \ Looks correct. What do you think about this idea: http://lists.freebsd.org/pipermail/freebsd-bugs/2013-February/051665.html it has more generic approach for such kind of debugging.