From patchwork Wed Nov 4 20:25:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 56007 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp13059lbr; Wed, 4 Nov 2015 12:26:03 -0800 (PST) X-Received: by 10.50.142.65 with SMTP id ru1mr5685379igb.88.1446668763706; Wed, 04 Nov 2015 12:26:03 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id t18si20961375igd.1.2015.11.04.12.26.03; Wed, 04 Nov 2015 12:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 838FB6E342; Wed, 4 Nov 2015 12:26:02 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com [209.85.220.174]) by gabe.freedesktop.org (Postfix) with ESMTPS id B5EAD6E342 for ; Wed, 4 Nov 2015 12:26:00 -0800 (PST) Received: by qkct129 with SMTP id t129so24888761qkc.2 for ; Wed, 04 Nov 2015 12:26:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:user-agent:mime-version :content-type; bh=w6gosl62zPHcQHxRP8hD0fkPcEdOkNcrejYY5Vyz9II=; b=wiZYrxX+1PgRJSO+4j6qO+wCu0MzrvXCN6tR14UIZ/YKkiP5zsovWDlzFgYTFB+Abe m6otxV0tpEpCYedund3zNtwd1kCbXBBzwHPgKzUivntdn1CV/Wn4WxmchrmcEJXnty09 Y3UZ3Mg8Q0qD832lh/K4EOLYC6xhH5p0PgSnDZyQYyupcKFqiXbKyJCYQVUVgImsT1S1 9Mw2qwminO9YRxJa6WRMtYg+Ah6Fltnur7+Gv4NdbpSPmsUOtWPL6p/Ioz8gp8JjzKNv UwZJ2wXDOzSwORbs1qrPX0Ps6J/ljk8jaTy2Ke2USbYb7Nny8NQXnZY7dupa7E4G3tMh 8KVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version:content-type; bh=w6gosl62zPHcQHxRP8hD0fkPcEdOkNcrejYY5Vyz9II=; b=YRal37L1ec3DernofR7uDhCA2blBK3uCdZro1VeZ8FVfahPEsVUVabYACGN159cNyp rakJiHTYhy8ZlEbA/WzKyLxfn3yxUhc3lLWAQHzOtHGIcpi/bdG7nr7mb5ND6yig/a/p EYH0ZM6/jEi9NZhsMNj3meMvIOoRnN32RfP5UkFQVOV6SQxw4WMrhRzgeDLK1++FeLAH m0IU1a0LQGZmyZHZZ3/I+yEBfYz4CAo6fENALSeg+hxeWEapZ1gwgXoVJh7sNoNsH50i bBMD+ayqaQ8AxdOc2f6KoOlaql66LIaLX6XAJDfJWsiCcEmBrPFQOBToM4D8G37BDj2e Pl+Q== X-Gm-Message-State: ALoCoQl8xrmjbywXJvIr32n5m6MwHeof8ILHmHBkInbJfgDarWpNJ0MQSiyTHELneRR5VXW/bkfB X-Received: by 10.55.78.143 with SMTP id c137mr3621441qkb.72.1446668759947; Wed, 04 Nov 2015 12:25:59 -0800 (PST) Received: from xanadu.home (modemcable065.157-23-96.mc.videotron.ca. [96.23.157.65]) by smtp.gmail.com with ESMTPSA id h22sm749151qge.43.2015.11.04.12.25.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2015 12:25:59 -0800 (PST) Date: Wed, 4 Nov 2015 15:25:58 -0500 (EST) From: Nicolas Pitre To: David Airlie , Daniel Vetter Subject: [PATCH] drm/mgag200/mgag200_mode.c: fix wrong do_div() usage Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Cc: 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" do_div() is meant to be used with an unsigned dividend. Signed-off-by: Nicolas Pitre diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index c99d3fe128..1d4c480f5c 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1564,7 +1564,7 @@ static uint32_t mga_vga_calculate_mode_bandwidth(struct drm_display_mode *mode, int bits_per_pixel) { uint32_t total_area, divisor; - int64_t active_area, pixels_per_second, bandwidth; + uint64_t active_area, pixels_per_second, bandwidth; uint64_t bytes_per_pixel = (bits_per_pixel + 7) / 8; divisor = 1024;