mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
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:
committed by
Compute-Runtime-Automation
parent
ed15408592
commit
f4bd4e603d
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user