From patchwork Mon Dec 21 18:53:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 7897471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 88DD79F349 for ; Mon, 21 Dec 2015 19:02:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B290E205E3 for ; Mon, 21 Dec 2015 19:02:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D8EEB205DC for ; Mon, 21 Dec 2015 19:02:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C7E1F6E0CB; Mon, 21 Dec 2015 11:02:43 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 505 seconds by postgrey-1.34 at gabe; Mon, 21 Dec 2015 11:02:42 PST Received: from mail.skyhub.de (mail.skyhub.de [78.46.96.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FA246E090; Mon, 21 Dec 2015 11:02:42 -0800 (PST) X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1450724054; bh=nQqudMRtRImVtcJ4kiNzCtSrRLD+gRNtFciUTM16u38=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=LBDJ4zBqmjJS6V4YRXmXA7rEDjyfZUiw3Pgdz R6C7IwFf8T5d/NrGRJhinlXW65Ek1iwIwkI6W+8axTvt4QyUmj87/BK/7O65AA0pVCJ /ZQ/VfvUKZrh4QpJeiVc4bnJM2GOK7X6IS8Wv6YKK4WNML4ug29uVC8N/WJsf37z0So = Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id tHdTGbr5kuY2; Mon, 21 Dec 2015 19:54:13 +0100 (CET) Received: from pd.tnic (p54895B28.dip0.t-ipconnect.de [84.137.91.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id A68051DA23E; Mon, 21 Dec 2015 19:54:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1450724053; bh=nQqudMRtRImVtcJ4kiNzCtSrRLD+gRNtFciUTM16u38=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=dviCqs8Gmip0fgaSd6nV3O8CgjGNMjcNXpjcK fJ9qcXffusxxJOaNAxWB6d5MjfS1OFdxCMAWBGt1g/PaQf3SV3axyMQhcXTZtJZSjwD jMDGapvGMGrwVv7D3FBBfog4F2/IaRKsyT+wz1kn6UXNqI3stVZAtL711sszM/o7Fuc = Received: by pd.tnic (Postfix, from userid 1000) id 5512E161630; Mon, 21 Dec 2015 19:53:59 +0100 (CET) From: Borislav Petkov To: LKML Subject: [PATCH] drm, i915: Fix pointer size cast Date: Mon, 21 Dec 2015 19:53:59 +0100 Message-Id: <1450724039-23264-1-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.5 MIME-Version: 1.0 Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Borislav Petkov gcc complains on 32-bit like this: drivers/gpu/drm/i915/intel_display.c: In function ‘intel_plane_obj_offset’: drivers/gpu/drm/i915/intel_display.c:2954:11: warning: cast to pointer from \ integer of different size [-Wint-to-pointer-cast] offset = (unsigned char *)vma->node.start; ^ because vma->node.start is u64 but a pointer on 32-bit is 4 bytes. Do the calculations with an unsigned long directly and save us the casts. Cc: Daniel Vetter Cc: Jani Nikula Cc: David Airlie Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Borislav Petkov --- drivers/gpu/drm/i915/intel_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 62211abe4922..640cb7c9b7f3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2941,7 +2941,7 @@ unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, { const struct i915_ggtt_view *view = &i915_ggtt_view_normal; struct i915_vma *vma; - unsigned char *offset; + unsigned long offset; if (intel_rotation_90_or_270(intel_plane->base.state->rotation)) view = &i915_ggtt_view_rotated; @@ -2951,14 +2951,14 @@ unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, view->type)) return -1; - offset = (unsigned char *)vma->node.start; + offset = vma->node.start; if (plane == 1) { offset += vma->ggtt_view.rotation_info.uv_start_page * PAGE_SIZE; } - return (unsigned long)offset; + return offset; } static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)