From patchwork Wed Sep 2 16:10:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11751231 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CAF514E3 for ; Wed, 2 Sep 2020 16:18:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 548C320829 for ; Wed, 2 Sep 2020 16:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599063517; bh=5Br08z5EHU347ymKSVPsmlv2b1oAPGH5xsj10Ivzd+8=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=KBJcSRarzCwYxbhKeKxQzMghFCUmflsmXSZbRYNBJEWEfTWVBwQHRALqSgiW4Dpho pmvPnGAh170gYeaC0zCJjj+9c5w+/c8jXZVk9v6ns99o+YVOL3Zby4sDcx3hmryGJK /X/+PjIuTn6uQ4sBoPLjCMMT+QSdPcD2cO2+A8As= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728896AbgIBQSI (ORCPT ); Wed, 2 Sep 2020 12:18:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:53872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbgIBQKs (ORCPT ); Wed, 2 Sep 2020 12:10:48 -0400 Received: from mail.kernel.org (ip5f5ad5c3.dynamic.kabel-deutschland.de [95.90.213.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD2D8214F1; Wed, 2 Sep 2020 16:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599063046; bh=5Br08z5EHU347ymKSVPsmlv2b1oAPGH5xsj10Ivzd+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pdpEcpknJFkU98IyHqqtNNK8vHKCDK0nq3a+OkyxFNbyCbTCQyyGL5Ajo3M8HPjgz 2g1iOTnZcQzciGbRcyzqKXOPHvz9khZunuLBu0QXWgSZogk89TsPpXZalTCXReJtNY Q/xKMs1oqd2OMMfJZX6q+NDBemfgpYi57uGkYCFI= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kDVLP-000t9p-Nq; Wed, 02 Sep 2020 18:10:43 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/38] media: av7110_v4l: avoid a typecast Date: Wed, 2 Sep 2020 18:10:07 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org While smatch reports an issue there: drivers/media/pci/ttpci/av7110_v4l.c:163 ves1820_set_tv_freq() warn: unsigned 'freq' is never less than zero. drivers/media/pci/ttpci/av7110_v4l.c:165 ves1820_set_tv_freq() warn: unsigned 'freq' is never less than zero. The logic is actually fine. Yet, removing the typecast shuts up smatch and makes the code more readable. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/ttpci/av7110_v4l.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/ttpci/av7110_v4l.c b/drivers/media/pci/ttpci/av7110_v4l.c index cabe006658dd..6d9c908be713 100644 --- a/drivers/media/pci/ttpci/av7110_v4l.c +++ b/drivers/media/pci/ttpci/av7110_v4l.c @@ -160,9 +160,9 @@ static int ves1820_set_tv_freq(struct saa7146_dev *dev, u32 freq) buf[1] = div & 0xff; buf[2] = 0x8e; - if (freq < (u32) (16 * 168.25)) + if (freq < 16U * 168.25) config = 0xa0; - else if (freq < (u32) (16 * 447.25)) + else if (freq < 16U * 447.25) config = 0x90; else config = 0x30;