From patchwork Thu Nov 1 09:38:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1684181 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 6325EE003B for ; Thu, 1 Nov 2012 09:51:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 634079EFC5 for ; Thu, 1 Nov 2012 02:51:16 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [95.142.166.194]) by gabe.freedesktop.org (Postfix) with ESMTP id AACEEA0EDF for ; Thu, 1 Nov 2012 02:37:52 -0700 (PDT) Received: from localhost.localdomain (unknown [91.224.175.20]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 18D79359DB; Thu, 1 Nov 2012 10:37:51 +0100 (CET) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH] kms: Return a negative error code in kms_bo_create() Date: Thu, 1 Nov 2012 10:38:42 +0100 Message-Id: <1351762722-8012-1-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org The function returns returns 0 on success or a negative value in case of an error, except when given invalid attributes in which case it returns the positive EINVAL value. Replace that with -EINVAL to allow the caller to detect errors with a < 0 check. Signed-off-by: Laurent Pinchart Reviewed-by: Jakob Bornecrantz --- libkms/api.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libkms/api.c b/libkms/api.c index 4a05f3d..5befaa0 100644 --- a/libkms/api.c +++ b/libkms/api.c @@ -80,7 +80,7 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo ** type = value; break; default: - return EINVAL; + return -EINVAL; } }