/* If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeIntnToInt8(IN INTN Operand, OUT INT8 *Result)
/* If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeIntnToInt8(IN INTN Operand, OUT INT8 *Result)
{
  RETURN_STATUS  Status;
  if (Result == NULL) {
    return RETURN_INVALID_PARAMETER;
  }
  if ((Operand >= MIN_INT8) && (Operand <= MAX_INT8)) {
    *Result = (INT8)Operand;
    Status  = RETURN_SUCCESS;
  } else {
    *Result = INT8_ERROR;
    Status  = RETURN_BUFFER_TOO_SMALL;
  }
  return Status;
}