From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 11:00:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7186E106564A; Wed, 9 Nov 2011 11:00:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48BEF8FC16; Wed, 9 Nov 2011 11:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9B0U1k079838; Wed, 9 Nov 2011 11:00:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9B0UDx079834; Wed, 9 Nov 2011 11:00:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111091100.pA9B0UDx079834@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Nov 2011 11:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227384 - in head/sys: kern sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 09 Nov 2011 11:00:30 -0000 Author: ed Date: Wed Nov 9 11:00:29 2011 New Revision: 227384 URL: http://svn.freebsd.org/changeset/base/227384 Log: Simplify the code emitted by makeobjops.awk slightly. Just place the default kobj_method inside the kobjop_desc structure. There's no need to give these kobj_methods their own symbol. This shaves off 10 KB of a GENERIC kernel binary. Modified: head/sys/kern/subr_kobj.c head/sys/sys/kobj.h head/sys/tools/makeobjops.awk Modified: head/sys/kern/subr_kobj.c ============================================================================== --- head/sys/kern/subr_kobj.c Wed Nov 9 09:15:57 2011 (r227383) +++ head/sys/kern/subr_kobj.c Wed Nov 9 11:00:29 2011 (r227384) @@ -251,7 +251,7 @@ kobj_lookup_method(kobj_class_t cls, ce = kobj_lookup_method_mi(cls, desc); if (!ce) - ce = desc->deflt; + ce = &desc->deflt; *cep = ce; return ce; } Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Wed Nov 9 09:15:57 2011 (r227383) +++ head/sys/sys/kobj.h Wed Nov 9 11:00:29 2011 (r227384) @@ -86,7 +86,7 @@ struct kobj_ops { struct kobjop_desc { unsigned int id; /* unique ID */ - kobj_method_t *deflt; /* default implementation */ + kobj_method_t deflt; /* default implementation */ }; /* Modified: head/sys/tools/makeobjops.awk ============================================================================== --- head/sys/tools/makeobjops.awk Wed Nov 9 09:15:57 2011 (r227383) +++ head/sys/tools/makeobjops.awk Wed Nov 9 11:00:29 2011 (r227384) @@ -306,13 +306,8 @@ function handle_method (static, doc) printh(format_line(prototype argument_list ");", line_width, length(prototype))); - # Print out the method desc - printc("static const struct kobj_method " mname "_method_default = {"); - printc("\t&" mname "_desc, (kobjop_t) " default_function); - printc("};\n"); - printc("struct kobjop_desc " mname "_desc = {"); - printc("\t0, &" mname "_method_default"); + printc("\t0, { &" mname "_desc, (kobjop_t)" default_function " }"); printc("};\n"); # Print out the method itself