Use B_DEV_NAME_LENGTH instead of 128, where appropiate.
Kind of a follow up, after 9d432d1b00.
Change-Id: Id8e0c18216ef505a7698044ecd04a69219008a4e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10213
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
708d8e42c3
commit
ed66661307
@@ -430,7 +430,7 @@ embedded_controller_register_child_devices(void* _cookie)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
snprintf(name, sizeof(name), ACPI_EC_BASENAME, pathID);
|
||||
|
||||
return gDeviceManager->publish_device(node, name, ACPI_EC_DEVICE_NAME);
|
||||
|
||||
@@ -132,7 +132,7 @@ i2c_init_bus(device_node *node, void **_bus)
|
||||
|
||||
*_bus = bus;
|
||||
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
snprintf(name, sizeof(name), "bus/i2c/%d/bus_raw", pathID);
|
||||
|
||||
return gDeviceManager->publish_device(node, name, I2C_BUS_RAW_MODULE_NAME);
|
||||
|
||||
@@ -130,7 +130,7 @@ typedef struct ice1712
|
||||
{
|
||||
uint32 irq;
|
||||
pci_info info;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
|
||||
ice1712Midi midiItf[MAX_MIDI_INTERFACE];
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ register_displays(const char *parentName, device_node *node)
|
||||
gDeviceManager->register_node(node, DISPLAY_DEVICE_MODULE_NAME, attrs,
|
||||
NULL, &deviceNode);
|
||||
|
||||
char deviceName[128];
|
||||
char deviceName[B_DEV_NAME_LENGTH];
|
||||
snprintf(deviceName, sizeof(deviceName), "%s/%s", parentName, name);
|
||||
gDeviceManager->publish_device(parent, deviceName,
|
||||
DISPLAY_DEVICE_MODULE_NAME);
|
||||
@@ -288,7 +288,7 @@ displayadapter_register_child_devices(void *_cookie)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
snprintf(name, sizeof(name), DISPLAYADAPTER_BASENAME, path_id);
|
||||
status_t status = gDeviceManager->publish_device(node, name,
|
||||
DISPLAYADAPTER_DEVICE_MODULE_NAME);
|
||||
|
||||
@@ -337,7 +337,7 @@ i2c_elan_register_child_devices(void *cookie)
|
||||
// might have been unplugged. So we just generate names
|
||||
// until we find one that is not currently in use.
|
||||
int32 index = 0;
|
||||
char pathBuffer[128];
|
||||
char pathBuffer[B_DEV_NAME_LENGTH];
|
||||
while (true) {
|
||||
sprintf(pathBuffer, "input/mouse/" DEVICE_PATH_SUFFIX "/%" B_PRId32, index++);
|
||||
if (gDeviceList->FindDevice(pathBuffer) == NULL) {
|
||||
|
||||
@@ -411,7 +411,7 @@ i2c_hid_register_child_devices(void *cookie)
|
||||
// might have been unplugged. So we just generate names
|
||||
// until we find one that is not currently in use.
|
||||
int32 index = 0;
|
||||
char pathBuffer[128];
|
||||
char pathBuffer[B_DEV_NAME_LENGTH];
|
||||
const char *basePath = handler->BasePath();
|
||||
while (true) {
|
||||
sprintf(pathBuffer, "%s%" B_PRId32, basePath, index++);
|
||||
|
||||
@@ -156,7 +156,7 @@ usb_hid_device_added(usb_device device, void **cookie)
|
||||
// might have been unplugged. So we just generate names
|
||||
// until we find one that is not currently in use.
|
||||
int32 index = 0;
|
||||
char pathBuffer[128];
|
||||
char pathBuffer[B_DEV_NAME_LENGTH];
|
||||
const char *basePath = handler->BasePath();
|
||||
while (true) {
|
||||
sprintf(pathBuffer, "%s%" B_PRId32, basePath, index++);
|
||||
|
||||
@@ -248,7 +248,7 @@ acpi_ac_register_child_devices(void *driverCookie)
|
||||
{
|
||||
acpi_ac_device_info *device = (acpi_ac_device_info *)driverCookie;
|
||||
int path_id;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
|
||||
path_id = sDeviceManager->create_id(ACPI_AC_PATHID_GENERATOR);
|
||||
if (path_id < 0) {
|
||||
|
||||
@@ -598,7 +598,7 @@ acpi_battery_register_child_devices(void *cookie)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
snprintf(name, sizeof(name), ACPI_BATTERY_BASENAME, pathID);
|
||||
|
||||
return sDeviceManager->publish_device(device->node, name,
|
||||
|
||||
@@ -294,7 +294,7 @@ acpi_lid_register_child_devices(void *_cookie)
|
||||
{
|
||||
acpi_lid_device_info *device = (acpi_lid_device_info *)_cookie;
|
||||
int path_id;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
|
||||
path_id = sDeviceManager->create_id(ACPI_LID_PATHID_GENERATOR);
|
||||
if (path_id < 0) {
|
||||
|
||||
@@ -319,7 +319,7 @@ acpi_thermal_register_child_devices(void* _cookie)
|
||||
{
|
||||
device_node* node = _cookie;
|
||||
int path_id;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
|
||||
path_id = sDeviceManager->create_id(ACPI_THERMAL_PATHID_GENERATOR);
|
||||
if (path_id < 0) {
|
||||
|
||||
@@ -243,7 +243,7 @@ amd_thermal_register_child_devices(void* _cookie)
|
||||
{
|
||||
device_node* node = (device_node*)_cookie;
|
||||
int path_id;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
|
||||
path_id = sDeviceManager->create_id(AMD_THERMAL_PATHID_GENERATOR);
|
||||
if (path_id < 0) {
|
||||
|
||||
@@ -259,7 +259,7 @@ pch_thermal_register_child_devices(void *_cookie)
|
||||
{
|
||||
device_node *node = (device_node*)_cookie;
|
||||
int path_id;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
|
||||
path_id = sDeviceManager->create_id(PCH_THERMAL_PATHID_GENERATOR);
|
||||
if (path_id < 0) {
|
||||
|
||||
@@ -305,7 +305,7 @@ acpi_als_register_child_devices(void *cookie)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
snprintf(name, sizeof(name), ACPI_ALS_BASENAME, pathID);
|
||||
|
||||
return sDeviceManager->publish_device(device->node, name,
|
||||
|
||||
@@ -23,7 +23,7 @@ char *
|
||||
periph_compose_device_name(device_node *node, const char *prefix)
|
||||
{
|
||||
uint8 pathID, targetID, targetLUN, type;
|
||||
char name[128];
|
||||
char name[B_DEV_NAME_LENGTH];
|
||||
uint32 channel;
|
||||
|
||||
if (gDeviceManager->get_attr_uint8(node, SCSI_BUS_PATH_ID_ITEM, &pathID, true) != B_OK
|
||||
|
||||
Reference in New Issue
Block a user