From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Riesen Date: Fri, 19 Nov 2004 10:00:40 +0000 Subject: Re: [ANNOUNCE] udev 046 release Message-Id: <81b0412b04111902001c5ea798@mail.gmail.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_Part_2228_10513398.1100858440859" List-Id: References: <20041118224411.GA10876@kroah.com> In-Reply-To: <20041118224411.GA10876@kroah.com> To: linux-hotplug@vger.kernel.org ------=_Part_2228_10513398.1100858440859 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, 19 Nov 2004 10:58:53 +0100, Alex Riesen wrote: > On Thu, 18 Nov 2004 14:44:12 -0800, Greg KH wrote: > > I've released the 046 version of udev. It can be found at: > > kernel.org/pub/linux/utils/kernel/hotplug/udev-046.tar.gz > > I just put const's at some places. It cut down data segments, but > increased code size. > Overall still smaller: > > -rwxr-xr-x 1 user users 50420 Nov 19 10:53 ../udev-046/udev > -rwxr-xr-x 1 user users 49556 Nov 19 10:53 udev > text data bss dec hex filename > 47245 968 22480 70693 11425 ../udev-046/udev > 48089 104 22064 70257 11271 udev > > Also, the instance of utsname in udev_lib.c is used only once. forgot the patch... ------=_Part_2228_10513398.1100858440859 Content-Type: text/x-patch; name="udev-046-const.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="udev-046-const.patch" * utsname used only once * consts help gcc pack the object tighter diff -upr udev-046/udev_lib.c udev-046-1/udev_lib.c --- udev-046/udev_lib.c=092004-11-18 20:39:15.000000000 +0100 +++ udev-046-1/udev_lib.c=092004-11-19 10:33:23.885019143 +0100 @@ -65,12 +65,12 @@ void udev_set_values(struct udevice *ude =20 int kernel_release_satisfactory(int version, int patchlevel, int sublevel) { -=09static struct utsname uts; =09static int kversion =3D 0; =09static int kpatchlevel; =09static int ksublevel; =20 =09if (kversion =3D=3D 0) { +=09=09struct utsname uts; =09=09if (uname(&uts) !=3D 0) =09=09=09return -1; =20 diff -upr udev-046/udev_sysfs.c udev-046-1/udev_sysfs.c --- udev-046/udev_sysfs.c=092004-11-18 20:39:15.000000000 +0100 +++ udev-046-1/udev_sysfs.c=092004-11-19 10:42:08.480223052 +0100 @@ -35,9 +35,9 @@ #include "logging.h" =20 /* list of subsystem specific files, NULL if there is no file to wait for = */ -static struct subsystem_file { -=09char *subsystem; -=09char *file; +static const struct subsystem_file { +=09const char *subsystem; +=09const char *file; } subsystem_files[] =3D { =09{ .subsystem =3D "net",=09=09.file =3D "ifindex" }, =09{ .subsystem =3D "scsi_host",=09.file =3D "unique_id" }, @@ -56,7 +56,7 @@ static struct subsystem_file { =20 int subsystem_expect_no_dev(const char *subsystem) { -=09struct subsystem_file *file; +=09const struct subsystem_file *file; =20 =09for (file =3D subsystem_files; file->subsystem !=3D NULL; file++) =09=09if (strcmp(subsystem, file->subsystem) =3D=3D 0) @@ -66,9 +66,9 @@ int subsystem_expect_no_dev(const char * } =20 /* get subsystem specific files, returns "dev" if no other found */ -static char *get_subsystem_specific_file(const char *subsystem) +static const char *get_subsystem_specific_file(const char *subsystem) { -=09struct subsystem_file *file; +=09const struct subsystem_file *file; =20 =09/* look if we want to look for another file instead of "dev" */ =09for (file =3D subsystem_files; file->subsystem !=3D NULL; file++) @@ -123,9 +123,9 @@ static int class_device_expect_no_device { =09/* list of devices without a "device" symlink to the physical device =09 * if device is set to NULL, no devices in that subsystem has a link */ -=09static struct class_device { -=09=09char *subsystem; -=09=09char *device; +=09static const struct class_device { +=09=09const char *subsystem; +=09=09const char *device; =09} class_device[] =3D { =09=09{ .subsystem =3D "block",=09=09.device =3D "double" }, =09=09{ .subsystem =3D "block",=09=09.device =3D "nb" }, @@ -202,7 +202,7 @@ static int class_device_expect_no_device =09=09{ .subsystem =3D "capi",=09=09.device =3D NULL }, =09=09{ NULL, NULL } =09}; -=09struct class_device *classdevice; +=09const struct class_device *classdevice; =09int len; =20 =09/* the kernel may tell us what to wait for */ @@ -240,13 +240,13 @@ static int class_device_expect_no_device /* skip waiting for the bus of the devices device */ static int class_device_expect_no_bus(struct sysfs_class_device *class_dev= ) { -=09static char *devices_without_bus[] =3D { +=09static const char *devices_without_bus[] =3D { =09=09"scsi_host", =09=09"i2c-adapter", =09=09"i2c-dev", =09=09NULL =09}; -=09char **device; +=09const char **device; =20 =09for (device =3D devices_without_bus; *device !=3D NULL; device++) { =09=09int len =3D strlen(*device); @@ -262,9 +262,9 @@ static int class_device_expect_no_bus(st int wait_for_devices_device(struct sysfs_device *devices_dev, =09=09=09const char **error) { -=09static struct device_file { -=09=09char *bus; -=09=09char *file; +=09static const struct device_file { +=09=09const char *bus; +=09=09const char *file; =09} device_files[] =3D { =09=09{ .bus =3D "scsi",=09.file =3D "vendor" }, =09=09{ .bus =3D "usb",=09=09.file =3D "idVendor" }, @@ -280,7 +280,7 @@ int wait_for_devices_device(struct sysfs =09=09{ .bus =3D "ieee1394",=09.file =3D "address" }, =09=09{ NULL, NULL } =09}; -=09struct device_file *devicefile; +=09const struct device_file *devicefile; =09int loop; =20 =09/* the kernel may tell us what to wait for */ ------=_Part_2228_10513398.1100858440859-- ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ 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