mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
s390/cio: use while (i--) pattern to clean up
Use more natural while (i--) pattern to clean up allocated resources. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com> Link: https://lore.kernel.org/r/20240222134501.236871-1-andriy.shevchenko@linux.intel.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
69460c5e6b
commit
481ec3b376
|
|
@ -240,7 +240,7 @@ static int __ccwgroup_create_symlinks(struct ccwgroup_device *gdev)
|
|||
rc = sysfs_create_link(&gdev->cdev[i]->dev.kobj,
|
||||
&gdev->dev.kobj, "group_device");
|
||||
if (rc) {
|
||||
for (--i; i >= 0; i--)
|
||||
while (i--)
|
||||
sysfs_remove_link(&gdev->cdev[i]->dev.kobj,
|
||||
"group_device");
|
||||
return rc;
|
||||
|
|
@ -251,7 +251,7 @@ static int __ccwgroup_create_symlinks(struct ccwgroup_device *gdev)
|
|||
rc = sysfs_create_link(&gdev->dev.kobj,
|
||||
&gdev->cdev[i]->dev.kobj, str);
|
||||
if (rc) {
|
||||
for (--i; i >= 0; i--) {
|
||||
while (i--) {
|
||||
sprintf(str, "cdev%d", i);
|
||||
sysfs_remove_link(&gdev->dev.kobj, str);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ chsc_add_cmg_attr(struct channel_subsystem *css)
|
|||
}
|
||||
return ret;
|
||||
cleanup:
|
||||
for (--i; i >= 0; i--) {
|
||||
while (i--) {
|
||||
if (!css->chps[i])
|
||||
continue;
|
||||
chp_remove_cmg_attr(css->chps[i]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user