From owner-svn-src-all@freebsd.org Mon May 23 03:29:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C72FB46225; Mon, 23 May 2016 03:29:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3FC91366; Mon, 23 May 2016 03:29:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N3ThrQ043998; Mon, 23 May 2016 03:29:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N3ThxB043997; Mon, 23 May 2016 03:29:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230329.u4N3ThxB043997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 03:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300443 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 03:29:45 -0000 Author: adrian Date: Mon May 23 03:29:43 2016 New Revision: 300443 URL: https://svnweb.freebsd.org/changeset/base/300443 Log: [bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support. This diff updates DEFINE_CLASS_2/_3 to support the specification of class name separately from the class variable name, bringing them into sync with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1. Nothing in the tree currently uses the _2/_3 variants, and I can't find any references to the API outside of commits to the kobj.h header itself; given the limitation that currently exists, I'd be surprised if they've ever been used. Submitted by: Landon Fuller Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6491 Modified: head/sys/sys/kobj.h Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Mon May 23 01:01:23 2016 (r300442) +++ head/sys/sys/kobj.h Mon May 23 03:29:43 2016 (r300443) @@ -146,13 +146,13 @@ struct kobj_class classvar = { \ * DEFINE_CLASS_2(foo, foo_class, foo_methods, sizeof(foo_softc), * bar, baz); */ -#define DEFINE_CLASS_2(name, methods, size, \ +#define DEFINE_CLASS_2(name, classvar, methods, size, \ base1, base2) \ \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ &base2, NULL }; \ -struct kobj_class name ## _class = { \ +struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } @@ -162,14 +162,14 @@ struct kobj_class name ## _class = { \ * DEFINE_CLASS_3(foo, foo_class, foo_methods, sizeof(foo_softc), * bar, baz, foobar); */ -#define DEFINE_CLASS_3(name, methods, size, \ +#define DEFINE_CLASS_3(name, classvar, methods, size, \ base1, base2, base3) \ \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ &base2, \ &base3, NULL }; \ -struct kobj_class name ## _class = { \ +struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ }