More 3.4 compilation fixes
Subsystems (4)
Hi,
GCC now converts sprintf (a,"%s",b) to strcpy. This lose on kernel as strcpy is not inlined and not present in library, so one gets linker failure. It seems to make sense to apply this optimization by hand.
Honza
fs/reiserfs/prints.c renamed from fs/reiserfs.old/prints.c +1 -1
@@ -110,7 +110,7 @@ static void sprintf_de_head( char *buf,static void sprintf_item_head (char * buf,struct item_head * ih) {if (ih) { -sprintf (buf,"%s" , (ih_version (ih) ==KEY_FORMAT_3_6 ) ?"*3.6* " :"*3.5*" ); +strcpy (buf, (ih_version (ih) ==KEY_FORMAT_3_6 ) ?"*3.6* " :"*3.5*" );sprintf_le_key (buf +strlen (buf), &(ih->ih_key)); sprintf (buf + strlen (buf), ", item_len %d, item_location %d, " "free_space(entry_count) %d",
drivers/net/e100/e100_main.c renamed from drivers/net.old/e100/e100_main.c +1 -2
@@ -3940,8 +3940,7 @@ static int e100_ethtool_gstrings(structmemset (strings,0 , info.len *ETH_GSTRING_LEN );for (i =0 ; i < info.len; i++) { -sprintf (strings + i *ETH_GSTRING_LEN ,"%s" , - test_strings[i]); +strcpy (strings + i *ETH_GSTRING_LEN , test_strings[i]); }if (copy_to_user (ifr->ifr_data, &info,sizeof (info))) ret = -EFAULT ;
drivers/acpi/ac.c renamed from drivers/acpi.old/ac.c +2 -2
@@ -246,8 +246,8 @@ acpi_ac_add (memset (ac,0 ,sizeof (struct acpi_ac )); ac->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_AC_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_AC_CLASS ); +strcpy (acpi_device_name (device),ACPI_AC_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_AC_CLASS );acpi_driver_data (device) = ac; result =acpi_ac_get_state (ac);
drivers/acpi/asus_acpi.c renamed from drivers/acpi.old/asus_acpi.c +2 -2
@@ -869,8 +869,8 @@ static int __init asus_hotk_add(struct amemset (hotk,0 ,sizeof (struct asus_hotk )); hotk->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_HOTK_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_HOTK_CLASS ); +strcpy (acpi_device_name (device),ACPI_HOTK_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_HOTK_CLASS );acpi_driver_data (device) = hotk; hotk->device = device;
drivers/acpi/battery.c renamed from drivers/acpi.old/battery.c +2 -2
@@ -735,8 +735,8 @@ acpi_battery_add (memset (battery,0 ,sizeof (struct acpi_battery )); battery->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_BATTERY_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_BATTERY_CLASS ); +strcpy (acpi_device_name (device),ACPI_BATTERY_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_BATTERY_CLASS );acpi_driver_data (device) = battery; result =acpi_battery_check (battery);
drivers/acpi/bus.c renamed from drivers/acpi.old/bus.c +2 -2
@@ -296,8 +296,8 @@ acpi_bus_generate_event (if (!event)return_VALUE (-ENOMEM ); -sprintf (event->device_class,"%s" , device->pnp.device_class); -sprintf (event->bus_id,"%s" , device->pnp.bus_id); +strcpy (event->device_class, device->pnp.device_class); +strcpy (event->bus_id, device->pnp.bus_id); event->type = type; event->data = data;
drivers/acpi/button.c renamed from drivers/acpi.old/button.c +5 -5
@@ -316,35 +316,35 @@ acpi_button_add (*/ if (!strcmp (acpi_device_hid (device),ACPI_BUTTON_HID_POWER )) { button->type =ACPI_BUTTON_TYPE_POWER ; -sprintf (acpi_device_name (device),"%s" , +strcpy (acpi_device_name (device),ACPI_BUTTON_DEVICE_NAME_POWER );sprintf (acpi_device_class (device),"%s/%s" ,ACPI_BUTTON_CLASS ,ACPI_BUTTON_SUBCLASS_POWER ); }else if (!strcmp (acpi_device_hid (device),ACPI_BUTTON_HID_POWERF )) { button->type =ACPI_BUTTON_TYPE_POWERF ; -sprintf (acpi_device_name (device),"%s" , +strcpy (acpi_device_name (device),ACPI_BUTTON_DEVICE_NAME_POWERF );sprintf (acpi_device_class (device),"%s/%s" ,ACPI_BUTTON_CLASS ,ACPI_BUTTON_SUBCLASS_POWER ); }else if (!strcmp (acpi_device_hid (device),ACPI_BUTTON_HID_SLEEP )) { button->type =ACPI_BUTTON_TYPE_SLEEP ; -sprintf (acpi_device_name (device),"%s" , +strcpy (acpi_device_name (device),ACPI_BUTTON_DEVICE_NAME_SLEEP );sprintf (acpi_device_class (device),"%s/%s" ,ACPI_BUTTON_CLASS ,ACPI_BUTTON_SUBCLASS_SLEEP ); }else if (!strcmp (acpi_device_hid (device),ACPI_BUTTON_HID_SLEEPF )) { button->type =ACPI_BUTTON_TYPE_SLEEPF ; -sprintf (acpi_device_name (device),"%s" , +strcpy (acpi_device_name (device),ACPI_BUTTON_DEVICE_NAME_SLEEPF );sprintf (acpi_device_class (device),"%s/%s" ,ACPI_BUTTON_CLASS ,ACPI_BUTTON_SUBCLASS_SLEEP ); }else if (!strcmp (acpi_device_hid (device),ACPI_BUTTON_HID_LID )) { button->type =ACPI_BUTTON_TYPE_LID ; -sprintf (acpi_device_name (device),"%s" , +strcpy (acpi_device_name (device),ACPI_BUTTON_DEVICE_NAME_LID );sprintf (acpi_device_class (device),"%s/%s" ,ACPI_BUTTON_CLASS ,ACPI_BUTTON_SUBCLASS_LID );
drivers/acpi/ec.c renamed from drivers/acpi.old/ec.c +2 -2
@@ -578,8 +578,8 @@ acpi_ec_add ( ec->handle = device->handle; ec->uid =-1 ; ec->lock =SPIN_LOCK_UNLOCKED ; -sprintf (acpi_device_name (device),"%s" ,ACPI_EC_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_EC_CLASS ); +strcpy (acpi_device_name (device),ACPI_EC_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_EC_CLASS );acpi_driver_data (device) = ec;/* Use the global lock for all EC transactions? */
drivers/acpi/fan.c renamed from drivers/acpi.old/fan.c +2 -2
@@ -214,8 +214,8 @@ acpi_fan_add (memset (fan,0 ,sizeof (struct acpi_fan )); fan->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_FAN_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_FAN_CLASS ); +strcpy (acpi_device_name (device),ACPI_FAN_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_FAN_CLASS );acpi_driver_data (device) = fan; result =acpi_bus_get_power (fan->handle, &state);
drivers/acpi/pci_link.c renamed from drivers/acpi.old/pci_link.c +2 -2
@@ -599,8 +599,8 @@ acpi_pci_link_add ( link->device = device; link->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_PCI_LINK_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_PCI_LINK_CLASS ); +strcpy (acpi_device_name (device),ACPI_PCI_LINK_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_PCI_LINK_CLASS );acpi_driver_data (device) = link; result =acpi_pci_link_get_possible (link);
drivers/acpi/pci_root.c renamed from drivers/acpi.old/pci_root.c +2 -2
@@ -227,8 +227,8 @@ acpi_pci_root_add (memset (root,0 ,sizeof (struct acpi_pci_root )); root->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_PCI_ROOT_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_PCI_ROOT_CLASS ); +strcpy (acpi_device_name (device),ACPI_PCI_ROOT_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_PCI_ROOT_CLASS );acpi_driver_data (device) = root;/*
drivers/acpi/power.c renamed from drivers/acpi.old/power.c +3 -3
@@ -503,9 +503,9 @@ acpi_power_add (memset (resource,0 ,sizeof (struct acpi_power_resource )); resource->handle = device->handle; -sprintf (resource->name,"%s" , device->pnp.bus_id); -sprintf (acpi_device_name (device),"%s" ,ACPI_POWER_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_POWER_CLASS ); +strcpy (resource->name, device->pnp.bus_id); +strcpy (acpi_device_name (device),ACPI_POWER_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_POWER_CLASS );acpi_driver_data (device) = resource;/* Evalute the object to get the system level and resource order. */
drivers/acpi/processor.c renamed from drivers/acpi.old/processor.c +2 -2
@@ -1705,8 +1705,8 @@ acpi_processor_add (memset (pr,0 ,sizeof (struct acpi_processor )); pr->handle = device->handle; -sprintf (acpi_device_name (device),"%s" ,ACPI_PROCESSOR_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_PROCESSOR_CLASS ); +strcpy (acpi_device_name (device),ACPI_PROCESSOR_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_PROCESSOR_CLASS );acpi_driver_data (device) = pr; result =acpi_processor_get_info (pr);
drivers/acpi/scan.c renamed from drivers/acpi.old/scan.c +8 -8
@@ -483,13 +483,13 @@ static void acpi_device_get_busid(struct*/ switch (type) {case ACPI_BUS_TYPE_SYSTEM : -sprintf (device->pnp.bus_id,"%s" ,"ACPI" ); +strcpy (device->pnp.bus_id,"ACPI" );break ;case ACPI_BUS_TYPE_POWER_BUTTON : -sprintf (device->pnp.bus_id,"%s" ,"PWRF" ); +strcpy (device->pnp.bus_id,"PWRF" );break ;case ACPI_BUS_TYPE_SLEEP_BUTTON : -sprintf (device->pnp.bus_id,"%s" ,"SLPF" ); +strcpy (device->pnp.bus_id,"SLPF" );break ;default :acpi_get_name (handle,ACPI_SINGLE_NAME , &buffer);
@@ -500,7 +500,7 @@ static void acpi_device_get_busid(structelse break ; } -sprintf (device->pnp.bus_id,"%s" , bus_id); +strcpy (device->pnp.bus_id, bus_id);break ; } }
@@ -562,16 +562,16 @@ static void acpi_device_set_id(struct ac*/ if ((parent ==ACPI_ROOT_OBJECT ) && (type ==ACPI_BUS_TYPE_DEVICE )) { hid =ACPI_BUS_HID ; -sprintf (device->pnp.device_name,"%s" ,ACPI_BUS_DEVICE_NAME ); -sprintf (device->pnp.device_class,"%s" ,ACPI_BUS_CLASS ); +strcpy (device->pnp.device_name,ACPI_BUS_DEVICE_NAME ); +strcpy (device->pnp.device_class,ACPI_BUS_CLASS ); }if (hid) { -sprintf (device->pnp.hardware_id,"%s" , hid); +strcpy (device->pnp.hardware_id, hid); device->flags.hardware_id =1 ; }if (uid) { -sprintf (device->pnp.unique_id,"%s" , uid); +strcpy (device->pnp.unique_id, uid); device->flags.unique_id =1 ; }if (cid_list) {
drivers/acpi/thermal.c renamed from drivers/acpi.old/thermal.c +3 -3
@@ -1245,9 +1245,9 @@ acpi_thermal_add (memset (tz,0 ,sizeof (struct acpi_thermal )); tz->handle = device->handle; -sprintf (tz->name,"%s" , device->pnp.bus_id); -sprintf (acpi_device_name (device),"%s" ,ACPI_THERMAL_DEVICE_NAME ); -sprintf (acpi_device_class (device),"%s" ,ACPI_THERMAL_CLASS ); +strcpy (tz->name, device->pnp.bus_id); +strcpy (acpi_device_name (device),ACPI_THERMAL_DEVICE_NAME ); +strcpy (acpi_device_class (device),ACPI_THERMAL_CLASS );acpi_driver_data (device) = tz; result =acpi_thermal_get_info (tz);