From patchwork Thu Apr 12 19:33:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Malaterre X-Patchwork-Id: 10339591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60B55600D0 for ; Fri, 13 Apr 2018 07:03:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DBBD28691 for ; Fri, 13 Apr 2018 07:03:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F8A8286D4; Fri, 13 Apr 2018 07:03:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C66D728691 for ; Fri, 13 Apr 2018 07:03:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 580D56E5A2; Fri, 13 Apr 2018 07:03:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D74F6E185; Thu, 12 Apr 2018 19:33:46 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id b127so444009wmf.5; Thu, 12 Apr 2018 12:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HvJkAZsfkj4saSoMI9f3QV8CwG4ES/ilS/cT7FVq7Bc=; b=bYYaOq9+c1YdRpnFuMgsN6+VcwKJtWgxJfyoux37oe2e671JJs6HBuV10aGpPPH1BC dHcv+g6DN/juPkSIel3+Ohv8JkXKQu31e+o8Vq/TVbH+RPXzbin2BEglgc17Ew28ciX/ 0kuYP5zZR96Pa8S7uTeOmops8ZdP/CmoPRkTLksy1Vm8bdEW92KvL6ar5Xiv4zdv4P9P dg+4fH9Y0B7+wtyHqr0UHZ8zWYlkqOU18CJNr8nM5WQ25cO9MJwjk08JqL2D5ps2prih i85eZb0uQpf3gn914btFnEdlcVmWWW1xwmTFduQbQdzCXYb3LQ02R+bLR1au63NsDxD/ BW/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=HvJkAZsfkj4saSoMI9f3QV8CwG4ES/ilS/cT7FVq7Bc=; b=RWDf0lJSdpZIvO3w8xEZzmcB6qo69vDlelHzUmKF46sl7sm6BCS3xH2MNE+Fu92NK0 dg5eyBqhG0+oneHRi/YFDGyaafo8QmadP/8aCK3gumrGgqqST2pjHOAFVGaAoADCiW2L R+tIyHLIHzHh4p47vH2bH+4Neq76LWSJBuVg5J7pO+i5hpIpM5v8p3AcYqKPg5hZEo3H n7zWjs/M0h0se4Y+tnW4qVXJ55mmnzAEZbzvcIamAY539QdSlJXPR4Fhn4ejZW5Mgkdh qjAl6X2L7AkWpyKaivw4mfRkedoXweCvbd9Ivf0+XiR6QO3s2Sez/bGNf7pRrsHEbO8e hpww== X-Gm-Message-State: ALQs6tBg2NWduSYHdF8Hjad7xn7HbbvavzzUfl3vsv5LaWDpvA+zQot4 bU4SoyeXi24Pl8hP2MJ8sFI= X-Google-Smtp-Source: AIpwx49odxNJkmyeXTs53XmkuK7hXRzIBW132iEzsV13Pe2unyVST2l0Q+aEVbU55FXQu47WUhqNXw== X-Received: by 10.28.114.15 with SMTP id n15mr1740606wmc.88.1523561624829; Thu, 12 Apr 2018 12:33:44 -0700 (PDT) Received: from macbookpro.malat.net (bru31-1-78-225-226-121.fbx.proxad.net. [78.225.226.121]) by smtp.gmail.com with ESMTPSA id q138sm174436wmd.1.2018.04.12.12.33.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 12:33:44 -0700 (PDT) Received: by macbookpro.malat.net (Postfix, from userid 1000) id 2494610C03DF; Thu, 12 Apr 2018 21:33:43 +0200 (CEST) From: Mathieu Malaterre To: Alex Deucher Subject: [PATCH] drm/radeon: change function signature to pass full range Date: Thu, 12 Apr 2018 21:33:33 +0200 Message-Id: <20180412193333.4951-1-malat@debian.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 13 Apr 2018 07:03:53 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Malaterre , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , amd-gfx@lists.freedesktop.org, =?UTF-8?q?Christian=20K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against 255 is done. Since it is always false, change the signature of this function to use an `int` instead, which match the type used in caller: `radeon_atom_hw_i2c_xfer`. Fix the following warning triggered with W=1: CC [M] drivers/gpu/drm/radeon/atombios_i2c.o drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’: drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (num > ATOM_MAX_HW_I2C_READ) { ^ Signed-off-by: Mathieu Malaterre Reviewed-by: Huang Rui Reviewed-by: Huang Rui <ray.huang@amd.com>
--- drivers/gpu/drm/radeon/atombios_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c index 4157780585a0..9022e9af11a0 100644 --- a/drivers/gpu/drm/radeon/atombios_i2c.c +++ b/drivers/gpu/drm/radeon/atombios_i2c.c @@ -35,7 +35,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, u8 slave_addr, u8 flags, - u8 *buf, u8 num) + u8 *buf, int num) { struct drm_device *dev = chan->dev; struct radeon_device *rdev = dev->dev_private;