From patchwork Wed Aug 9 20:31:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9891961 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 7057D602D7 for ; Wed, 9 Aug 2017 20:32:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60C1D28AA2 for ; Wed, 9 Aug 2017 20:32:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5593B28AB2; Wed, 9 Aug 2017 20:32:03 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 DDAD828AA2 for ; Wed, 9 Aug 2017 20:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752039AbdHIUb7 (ORCPT ); Wed, 9 Aug 2017 16:31:59 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38828 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbdHIUbm (ORCPT ); Wed, 9 Aug 2017 16:31:42 -0400 Received: by mail-wm0-f67.google.com with SMTP id y206so737346wmd.5 for ; Wed, 09 Aug 2017 13:31:41 -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=6CW9cbSPkbxj6QGcEXFO8dlQmJhy7KiZQDFaia0Subc=; b=dn+lrQtQp/s0Enbe4Hu+MM7xjXK/gR9vNvEmPhxHnFcr4lhVPYoWVdDOJJWNKEHkQN XwkIFhMkpuccgbDE+PWOjPVhpDcUq58Dn/QldeEg0rTiIt5oDjoKZvnVTZg3MlLf+DVV 534fhTkpHNLeKW0OaWWziGdDCoQt0fswMj9TxsljEnv1cSWWd3Su27ij22tt4BdKynx2 6zVp/HnAQatyBRtqqMl4Pqb9iy1fCkgxDSdhy6Ku+hDJsO9RO6CqcWWqx1jbJwGkjwHs Iann0ESO8XpCf25Iy9Drgcm9BeC8nHrLfsZUd1ukXMDubLZ1vHxuv9xI7JenoCSNRufZ 2ykg== 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=6CW9cbSPkbxj6QGcEXFO8dlQmJhy7KiZQDFaia0Subc=; b=uXivzkwfuL1U6X5pK43Vlhvihv52/P0fgpvWXkYi+JfvuJqu0LYIrUXD8U+JVEnCkt ino3k232zoa7E1f6JCVkAuPsQ/4zvtkHgYa7QIhWNCvZ5BwmBSeCJzGXlwaJZSP5f0ja e/anlcCPxDyFEaA5hhE/cK7JBbv6JYq7tLj38yiM744Q8oSPX79pfOmpxWlPimR/ewaS w3oiR/ZRdgZ2Kgo2Gq35V9BZZ3wVupFh5S4mnqZlZM3SHuuF629cK9SF1hU8MeWW1DKl dwLvUx5o49jBKLFKbW/Tc+fXUcVUUySlefbo1hTORFfsyKvNBUbQASrOls8VhQHzeU0r bpag== X-Gm-Message-State: AHYfb5h/sWvA5R0jrMa5tbpXWxjrHjSjX8CZKl4ABXBRxrQr/ZH67xWa SkgsjgMdpa8+Eyf6 X-Received: by 10.28.28.206 with SMTP id c197mr6615163wmc.93.1502310700609; Wed, 09 Aug 2017 13:31:40 -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 l43sm5819383wrl.33.2017.08.09.13.31.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Aug 2017 13:31:40 -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 v3 09/12] [media] ddbridge: fix impossible condition warning Date: Wed, 9 Aug 2017 22:31:25 +0200 Message-Id: <20170809203128.31476-10-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170809203128.31476-1-d.scheller.oss@gmail.com> References: <20170809203128.31476-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 ba2a2d987430..1ec3782a6c88 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -2992,7 +2992,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;