From patchwork Sun Jul 23 18:16:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9858531 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 5DD8B604D9 for ; Sun, 23 Jul 2017 18:17:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 583A12855D for ; Sun, 23 Jul 2017 18:17:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B71128562; Sun, 23 Jul 2017 18:17:36 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CE0C2854A for ; Sun, 23 Jul 2017 18:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751572AbdGWSRA (ORCPT ); Sun, 23 Jul 2017 14:17:00 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:38287 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751501AbdGWSQq (ORCPT ); Sun, 23 Jul 2017 14:16:46 -0400 Received: by mail-wr0-f195.google.com with SMTP id p12so7847587wrc.5 for ; Sun, 23 Jul 2017 11:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HxD9D1t0v4CZRuipmccz5YEfYspWIrVb0vUzmFwVahI=; b=LanGr+j9lx1Sg3s5wcbF/1dG7LHC+h3PskZY0YalYcdOIbz2SncIIyYhA7iUeMAkfP BXLFOiWej9DC24guXXgm1i37XZh+0jlWxOIUVgP5S1P2xKc9Ds+VvoyDMayXkMa/84H8 Qz9/jPe25DQqknFyuXGgy/88hG4d7HuHperVOeNvWY3HUm8G5pjtnYeaBqv2WvbaSkPY xiK3v2a6nlBxATDAhhqzR+MnobjM/Z8jiIXzhHgs4U0dDrIpwcXRksJX6nhtEfrAorYd aOt0vkvKopK4lS0H6+UHg37pMl6B8AqirD1cQi/2aG888Q/vtEn39nsd9qui5gCwq/Bs VAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HxD9D1t0v4CZRuipmccz5YEfYspWIrVb0vUzmFwVahI=; b=qPzXT5X6eGe9Xe5kelP+YaZm8c/uYaO0AIZb4ItIyOvHFNpjL0wdtqL6HqFF0VhS9X /e0BND4hlQURParSCUNcWg8Qpr4L1zSzf8PpK9YIdY2ihPawVWM2ytYO2oBlqm8CyVeG 4T0x+3U2427RJo3tgboOY62woGCH44IuwmDxF2IXOPQGvurhiUq5Gi7uXZHh1wVYdJUo wqgpkpvj2t9gR/0F1n7R2/Mmk076HAMktFRmETB/pEShs28naHS50mqQvJk/o0SR0aFt 5ST8rcEvMjcgaP8j4aAwcsL/NVmr2nLwLMoIFbNVvi+P9n5eBdLM/Xnjc9+Isizd6KiX AUDA== X-Gm-Message-State: AIVw111QHh0vy8RpIryV8QP+B1BJNTmvu7S0xJ+Gxxr/vaNPkjCJ1VCY /JGRG02l03PVdZKs X-Received: by 10.223.139.21 with SMTP id n21mr4540887wra.116.1500833805573; Sun, 23 Jul 2017 11:16:45 -0700 (PDT) Received: from dvbdev.wuest.de (ip-84-118-193-88.unity-media.net. [84.118.193.88]) by smtp.gmail.com with ESMTPSA id 93sm13247338wra.82.2017.07.23.11.16.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Jul 2017 11:16:45 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: r.scobie@clear.net.nz, jasmin@anw.at, d_spingler@freenet.de, Manfred.Knick@t-online.de, rjkm@metzlerbros.de Subject: [PATCH RESEND 11/14] [media] ddbridge: fix impossible condition warning Date: Sun, 23 Jul 2017 20:16:27 +0200 Message-Id: <20170723181630.19526-12-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170723181630.19526-1-d.scheller.oss@gmail.com> References: <20170723181630.19526-1-d.scheller.oss@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller Smatch and gcc complained: drivers/media/pci/ddbridge/ddbridge-core.c:3491 bpsnr_show() warn: impossible condition '(snr[0] == 255) => ((-128)-127 == 255)' drivers/media/pci/ddbridge/ddbridge-core.c: In function ‘bpsnr_show’: drivers/media/pci/ddbridge/ddbridge-core.c:3491:13: warning: comparison is always false due to limited range of data type [-Wtype-limits] Fix this by changing the type of snr to unsigned char. Cc: Ralph Metzler Signed-off-by: Daniel Scheller Tested-by: Richard Scobie Tested-by: Jasmin Jessich Tested-by: Dietmar Spingler Tested-by: Manfred Knick --- drivers/media/pci/ddbridge/ddbridge-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 2479cb70743e..e3119351b9a1 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -3250,7 +3250,7 @@ static ssize_t bpsnr_show(struct device *device, struct device_attribute *attr, char *buf) { struct ddb *dev = dev_get_drvdata(device); - char snr[32]; + unsigned char snr[32]; if (!dev->i2c_num) return 0;