Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1966874lqp; Tue, 16 Apr 2024 03:28:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEcy8Mzfb5ikRiKMSAEtPPjDY7px8FEm2MEFKZLbTGwLcAfr0z5Detd4FA/CHhJ0+5E7yEQjaMAOFDnca2eZ8toQZpAwSxXYbLJMU5tA== X-Google-Smtp-Source: AGHT+IHEQHu04wl3t/CZ7uVfv8tJvCVE3Hdnn5yZ5499ModV30C1073skiRvlJbGAMTXCAgajAKD X-Received: by 2002:a05:6a00:114c:b0:6ed:e1c:102e with SMTP id b12-20020a056a00114c00b006ed0e1c102emr15664948pfm.24.1713263326887; Tue, 16 Apr 2024 03:28:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713263326; cv=pass; d=google.com; s=arc-20160816; b=B1R7rcql74D1T4CUEcRHI0DKCvdInXHnj9R5Mstise+ldI77GKADDClHN7SJyY87yL y64aXXzUmcKANyduP8Wh3fDtX2FK6f8EQ83ZmaGvT+krWIiSHY04fwf1wKWusBUviOn+ a584ZuxGzh57QYE7Itu7n+gAYr6srvirJv9p4oPTsyHoSa/wjvoFRkgAkKi1kDCiSIb3 EM/JzF9wIjR66+gVn0xo+dcXDevWAescGELVmMXdMfkOH1RFfxgwDqbKiyj0o4osDagD gcMoXagyTpapmJzSlcCDnMe+jHgFu+nN+c82v5f5Pz37Dh6oiFZO+OfsFNACORybkB6t HB9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zm6MGDUL0CYtN0eVBnWYXSq+qBMUlxWdujWqgjIPSpk=; fh=31PxMxNzOLPmwf/HngZBDiKmMGoe56EIIAXibICFQ0o=; b=iAwTNEhm9q8qTS6uiwUN/m2fMw/4ZIhgQEqxDL8qSHwZ3JFiOz4QV3Hos1lbEgMtEI ov4X2yKepjHRVSxr5mZhoIhfRtzgDPETIEwSX1yLTnjFb/RDv/ZEIEG2PTJLTlqLiYua HINWdxnFjq4q+8lRigln8OJZFvxskAuNH1RXtVSbKUGOZtzBAFtdDl0RTQVVAJV3CnXY ZhUxIl2ppk/urWdVBiIL1DBQrSoEQVgxo2180oe5A9zng4429n3Fr5Ru1DLy6yn/yKOY rTppL01C3NmI9DqDlqBifFYOOrgx3NP3ZsKun60HmPmUiaA9kXq1Tr5Ekqm0c57H4YfR j3TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yzh9EJN5; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-146623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e6-20020a635006000000b005e2707e975asi9680590pgb.174.2024.04.16.03.28.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 03:28:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yzh9EJN5; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-146623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C7C7EB22286 for ; Tue, 16 Apr 2024 10:28:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE28D128396; Tue, 16 Apr 2024 10:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Yzh9EJN5" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24833128398 for ; Tue, 16 Apr 2024 10:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263268; cv=none; b=TrnvFtbYxCJDOa4sZqsNHoQFPOIQM2njIXF5JLNb5e3QT5f1H1b/DIJ6r/eIyb7mDuQiTniLw3VDY21cRk+9PMUwbW0lazmGDeDDigH1cymsLHVaf/ve9VXoeSWFYrrrIyUhEQZOVz/+e72cnm9+fELa0T1hAzlaKFZsX1VbQd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263268; c=relaxed/simple; bh=Xw6yRzMKNze2bIDoDLlDeJwYR+bZxJqXOk9lJPUakYM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R8EkZhFCyzg7sSURpx7UQwqLMfvDqlkMw5dxhTWcqWIHwsHjSEQdveeykgMkDcflC3B34YlYIToYB0So5sfcuMCn0GD/UdU2uE2B4/g0jANAYgLSHSa7cpQArVygY9tZ+TcJIYOvn3b13lyoE5Me5Mpaz2GgDeXxuKbCGTw2Z0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Yzh9EJN5; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a52aa665747so232593666b.2 for ; Tue, 16 Apr 2024 03:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713263265; x=1713868065; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zm6MGDUL0CYtN0eVBnWYXSq+qBMUlxWdujWqgjIPSpk=; b=Yzh9EJN5N5f5AQ3pUSGzjpgz52Nxfyoa6pzhxfX7RlPoulAKXnLX/jJasWZn0bkfdh rWsBAi5ARGExNVrI4z/5bdHYaYjTBNxPzM6T1FkfpCSKJW65BY0MGMdkwqm0Vkfh1YE4 Eglpj2GCQ+ePDj3j024w/PtV9f0Uhn/LcnN8NhLI5HdRc0DwpKiULqMkcALSuCD9lj/S 1PZUlXVBBoS/d7osQDEHeRAaWS1vV1pZ8r6MhFWRwn7FC21X3AnLvPlKw4iarlurpOBW dR1FWNXhB+DY54YTTZiUFshGfLxQO14H6XExXJ7ABDJQ/FtX1XrwlKNq3S8V7qzCk4+t 1wxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713263265; x=1713868065; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zm6MGDUL0CYtN0eVBnWYXSq+qBMUlxWdujWqgjIPSpk=; b=ULYLScZHdRYSh7Sjahv1Z+x5n4L2OmjUt4AmIBICy4OzVYVUBRzyxxM1qr977bV8F8 c2VeX5YwellElMG61+77d0mrP7wVxtfFa6wCHMvSfXVWOH5oX//+vYda+GDCKZTqhbPE exrdsRGM/dIow3h++PxxbYzxKcXcKyW9zlDeV4JywMAdg2DFKMOox884w+ixW4e6WlGk oHanlT/aK5WJpxM6IH/Bi/FR05YpW2rOin2VluHYJvzltusc2jo4cEre9nJumKUwL/Tj es3rO29U4SgdboQcXGXcFx7Kf+RK6dngngfv1ADRPQTYO67AlEBOFdVQkN7EKuYkYDsc FLAQ== X-Forwarded-Encrypted: i=1; AJvYcCXPKmOupc/TPozfhOZ+vgvdpz9rzky7L35UqRuCCktBJVflMj20Cmm8hDFGuS7voAf//dNQem70tQWLbaqAWNtAV98d0OZ/j+VnD4dv X-Gm-Message-State: AOJu0YxAy1akDbK2CZ9OtuwyP+lVmikC6Fgzu8iRggiMUBJ0c5fL681a /9vrBw9SJw8tdMIpK7dYZlSJwUFcCUEPueFn3GpnbHlfm52dYe7cDRXLymDJUpE= X-Received: by 2002:a17:907:7d91:b0:a54:1c55:7123 with SMTP id oz17-20020a1709077d9100b00a541c557123mr3390435ejc.73.1713263265187; Tue, 16 Apr 2024 03:27:45 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id bz2-20020a1709070aa200b00a51a9eccf2asm6665593ejc.125.2024.04.16.03.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 03:27:44 -0700 (PDT) Date: Tue, 16 Apr 2024 13:27:41 +0300 From: Dan Carpenter To: Ricardo Ribalda Cc: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sakari Ailus , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Sergey Kozlov , Abylay Ospan , Ezequiel Garcia , Dmitry Osipenko , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Niklas =?iso-8859-1?Q?S=F6derlund?= , Pavel Machek , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 23/35] media: dvb-frontends: tda10048: Use the right div Message-ID: <7a8d403b-8baf-4eff-8f9c-69cdcb8b2180@moroto.mountain> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> <20240415-fix-cocci-v1-23-477afb23728b@chromium.org> <97f51ae8-6672-4bd4-b55b-f02114e3d8d0@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <97f51ae8-6672-4bd4-b55b-f02114e3d8d0@moroto.mountain> I have created a Smatch check to warn about code like this: drivers/media/dvb-frontends/tda10048.c:345 tda10048_set_wref() warn: unnecessary div64_u64(): divisor = '0-u32max' regards, dan carpenter /* * Copyright 2024 Linaro Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt */ #include "smatch.h" #include "smatch_extra.h" static int my_id; static const sval_t uint_max = { .type = &uint_ctype, .value = UINT_MAX }; static void match_div64_u64(struct expression *expr) { struct range_list *rl; get_real_absolute_rl(expr, &rl); if (sval_cmp(rl_max(rl), uint_max) > 0) return; sm_warning("unnecessary div64_u64(): divisor = '%s'", show_rl(rl)); } void check_unnecessary_div64_u64(int id) { my_id = id; if (option_project != PROJ_KERNEL) return; add_param_key_expr_hook("div64_u64", match_div64_u64, 1, "$", NULL); }