From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 26 Aug 2004 22:56:40 +0000 Subject: Re: Cleaned up udev-selinux patch Message-Id: <20040826225640.GA13818@kroah.com> List-Id: References: <20040224233859.GA3265@kroah.com> <20040224234652.GA14775@devserv.devel.redhat.com> <403C8AE4.10403@redhat.com> <20040228005300.GA13860@kroah.com> <412DFE7B.6060409@redhat.com> <20040826155716.GA30726@kroah.com> <412E20AF.7000102@redhat.com> <20040826175139.GA12225@kroah.com> <412E34EB.1030909@redhat.com> <20040826225928.GD6058@lkcl.net> In-Reply-To: <20040826225928.GD6058@lkcl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Daniel J Walsh , Bill Nottingham , harald@redhat.com, SELinux , "Fedora SELinux support list for users & developers." , linux-hotplug-devel@lists.sourceforge.net On Thu, Aug 26, 2004 at 11:59:28PM +0100, Luke Kenneth Casson Leighton wrote: > perhaps the style should be that the Makefile adds some code > add_selinux.c based on a configure-time option, > > and that some #ifdefs in a header file call a function which > is a stub in the header if WITH_SELINUX is not defined. > > bizarre_but_likely_quite_good_coding_style_never_encountered_before.h: You've never read Linux kernel code, have you :) > #ifdef WITH_SELINUX > int do_add_selinux_stuff(args) { return 0; } Logic is backwards here. > #else > #define do_add_selinux_stuff the_real_add_selinux_stuff This define is unncessary. Just call the function do_add_selinux_stuff(), and protype it. Actually, inline functions that do nothing if selinux is disabled is better to catch compiler errors with types if things change in the future. thanks, greg k-h ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel