Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932320AbbFQUKj (ORCPT ); Wed, 17 Jun 2015 16:10:39 -0400 Received: from gproxy10-pub.mail.unifiedlayer.com ([69.89.20.226]:50931 "HELO gproxy10-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751067AbbFQUKc (ORCPT ); Wed, 17 Jun 2015 16:10:32 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Wed, 17 Jun 2015 16:10:32 EDT X-Authority-Analysis: v=2.1 cv=O/iq4nNW c=1 sm=1 tr=0 a=PkLafpyMt2xwRD+PMJrZ3Q==:117 a=PkLafpyMt2xwRD+PMJrZ3Q==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=paxTHTCI3ggA:10 a=IkcTkHD0fZMA:10 a=ptNznvi-AAAA:8 a=fztpppUj2ZoA:10 a=Xwexni91U_8A:10 a=XAFQembCKUMA:10 a=UAZ7-qefps--TAJdueAA:9 a=QEXdDO2ut3YA:10 Date: Wed, 17 Jun 2015 14:03:47 -0600 From: Eddie Kovsky To: David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] Fixes: 9697dffb098d ("drm: Turn off Legacy Context Functions") Message-ID: <20150617200347.GA4343@athena> Mail-Followup-To: Eddie Kovsky , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) X-Identified-User: {1650:box492.bluehost.com:edkovsky:edkovsky.org} {sentby:smtp auth 65.102.196.57 authed with ewk+edkovsky.org} Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3736 Lines: 98 Commit 9697dffb098d ("drm: Turn off Legacy Context Functions") added checks for legacy features to several functions in the drm driver. It is now possible for the void functions changed by this commit to return an int error code. This patch updates the function definitions to return int. This fixes the build warnings: warning: ‘return’ with a value, in function returning void return -EINVAL Signed-off-by: Eddie Kovsky --- drivers/gpu/drm/drm_context.c | 12 +++++++++--- drivers/gpu/drm/drm_legacy.h | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index f3ea657f6574..3c2f4a76f934 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c @@ -51,7 +51,7 @@ struct drm_ctx_list { * in drm_device::ctx_idr, while holding the drm_device::struct_mutex * lock. */ -void drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle) +int drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle) { if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) && drm_core_check_feature(dev, DRIVER_MODESET)) @@ -60,6 +60,8 @@ void drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle) mutex_lock(&dev->struct_mutex); idr_remove(&dev->ctx_idr, ctx_handle); mutex_unlock(&dev->struct_mutex); + + return 0; } /** @@ -107,7 +109,7 @@ int drm_legacy_ctxbitmap_init(struct drm_device * dev) * Free all idr members using drm_ctx_sarea_free helper function * while holding the drm_device::struct_mutex lock. */ -void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev) +int drm_legacy_ctxbitmap_cleanup(struct drm_device * dev) { if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) && drm_core_check_feature(dev, DRIVER_MODESET)) @@ -116,6 +118,8 @@ void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev) mutex_lock(&dev->struct_mutex); idr_destroy(&dev->ctx_idr); mutex_unlock(&dev->struct_mutex); + + return 0; } /** @@ -127,7 +131,7 @@ void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev) * @file. Note that after this call returns, new contexts might be added if * the file is still alive. */ -void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file) +int drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file) { struct drm_ctx_list *pos, *tmp; @@ -150,6 +154,8 @@ void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file) } mutex_unlock(&dev->ctxlist_mutex); + + return 0; } /*@}*/ diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h index c1dc61473db5..26c16220e475 100644 --- a/drivers/gpu/drm/drm_legacy.h +++ b/drivers/gpu/drm/drm_legacy.h @@ -43,9 +43,9 @@ struct drm_file; #define DRM_RESERVED_CONTEXTS 1 int drm_legacy_ctxbitmap_init(struct drm_device *dev); -void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev); -void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle); -void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file); +int drm_legacy_ctxbitmap_cleanup(struct drm_device *dev); +int drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle); +int drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file); int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f); int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f); -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/