refactor: Use else if instead of nested else-if conditions

Replaces nested else-if with else if for consistency and readability.
No functional changes.

Signed-off-by: Vysochyn, Illia <illia.vysochyn@intel.com>
This commit is contained in:
Vysochyn, Illia
2025-09-11 13:43:40 +00:00
committed by Compute-Runtime-Automation
parent ed15408592
commit f4bd4e603d
18 changed files with 71 additions and 113 deletions

View File

@@ -546,13 +546,11 @@ cl_int Image::validatePlanarYUV(Context *context,
if (!memoryProperties.flags.hostNoAccess) {
errorCode = CL_INVALID_VALUE;
break;
} else {
if (imageDesc->image_height % 4 ||
imageDesc->image_width % 4 ||
imageDesc->image_type != CL_MEM_OBJECT_IMAGE2D) {
errorCode = CL_INVALID_IMAGE_DESCRIPTOR;
break;
}
} else if (imageDesc->image_height % 4 ||
imageDesc->image_width % 4 ||
imageDesc->image_type != CL_MEM_OBJECT_IMAGE2D) {
errorCode = CL_INVALID_IMAGE_DESCRIPTOR;
break;
}
pClDevice->getCap<CL_DEVICE_PLANAR_YUV_MAX_WIDTH_INTEL>(reinterpret_cast<const void *&>(maxWidth), srcSize, retSize);
@@ -572,12 +570,10 @@ cl_int Image::validatePackedYUV(const MemoryProperties &memoryProperties, const
if (!memoryProperties.flags.readOnly) {
errorCode = CL_INVALID_VALUE;
break;
} else {
if (imageDesc->image_width % 2 != 0 ||
imageDesc->image_type != CL_MEM_OBJECT_IMAGE2D) {
errorCode = CL_INVALID_IMAGE_DESCRIPTOR;
break;
}
} else if (imageDesc->image_width % 2 != 0 ||
imageDesc->image_type != CL_MEM_OBJECT_IMAGE2D) {
errorCode = CL_INVALID_IMAGE_DESCRIPTOR;
break;
}
break;
}