Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'firewire-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire updates from Takashi Sakamoto:
"Small changes to string processing in device attribute"

* tag 'firewire-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
firewire: core: fix build failure due to the caller of fw_csr_string()
firewire: Convert snprintf/sprintf to sysfs_emit
firewire: Kill unnecessary buf check in device_attribute.show

+5 -13
+5 -13
drivers/firewire/core-device.c
··· 322 322 if (value < 0) 323 323 return -ENOENT; 324 324 325 - return snprintf(buf, buf ? PAGE_SIZE : 0, "0x%06x\n", value); 325 + return sysfs_emit(buf, "0x%06x\n", value); 326 326 } 327 327 328 328 #define IMMEDIATE_ATTR(name, key) \ ··· 334 334 struct config_rom_attribute *attr = 335 335 container_of(dattr, struct config_rom_attribute, attr); 336 336 const u32 *directories[] = {NULL, NULL}; 337 - size_t bufsize; 338 - char dummy_buf[2]; 339 337 int i, ret = -ENOENT; 340 338 341 339 down_read(&fw_device_rwsem); ··· 355 357 } 356 358 } 357 359 358 - if (buf) { 359 - bufsize = PAGE_SIZE - 1; 360 - } else { 361 - buf = dummy_buf; 362 - bufsize = 1; 363 - } 364 - 365 360 for (i = 0; i < ARRAY_SIZE(directories) && !!directories[i]; ++i) { 366 - int result = fw_csr_string(directories[i], attr->key, buf, bufsize); 361 + int result = fw_csr_string(directories[i], attr->key, buf, 362 + PAGE_SIZE - 1); 367 363 // Detected. 368 364 if (result >= 0) { 369 365 ret = result; ··· 366 374 // in the root directory follows to the directory entry for vendor ID 367 375 // instead of the immediate value for vendor ID. 368 376 result = fw_csr_string(directories[i], CSR_DIRECTORY | attr->key, buf, 369 - bufsize); 377 + PAGE_SIZE - 1); 370 378 if (result >= 0) 371 379 ret = result; 372 380 } ··· 482 490 { 483 491 struct fw_device *device = fw_device(dev); 484 492 485 - return sprintf(buf, "%u\n", device->is_local); 493 + return sysfs_emit(buf, "%u\n", device->is_local); 486 494 } 487 495 488 496 static int units_sprintf(char *buf, const u32 *directory)