Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2187254pxb; Wed, 9 Feb 2022 12:45:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhmoS8hINu4vsfYZAmk6ws1VRbNfrTITfmqoQIrSYxH5j72wkevIpiRlVtThvMIn6asq3U X-Received: by 2002:a05:6a00:c94:: with SMTP id a20mr4167374pfv.41.1644439531665; Wed, 09 Feb 2022 12:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644439531; cv=none; d=google.com; s=arc-20160816; b=d7AUSg7dzApB4nLV6ye13E9MYdFAfCJJetYIXcbvkiu+HnKx6IgorGMHhvTwJR6Uy6 jPxlazrVZwMBwhtYoglnXHwiNNGHep7bwVTbrftqdZNyKS1duA3oIBnJIvHlfI6NNfkq 3f0J8eO5RB+/tFG9m2CsaLpXIGJ325+aJlOQDdT5FV8I7rymK7KHjtO+uEe1TR/MhA6n 3/Z9Ksu1AKL7fnJQfKU6q+vV3HbEbraxoDa30WhGGa7bObDQQXT8lkhnBgenCCoXb73U cGv5X5A5TBgnwcr2UDaoG06ldgYkLVuKNzRNiKjmz7YCpkKVgB5SruwUOl2T1DPrT++V 4itw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=MIFEaw03zBaKT4LdsOEOtL6CNETMahXdbAs9eQdJcOA=; b=R5a8NwUo0m5O/Wezezn2FE8sX6rSN95XHeqMHVb2FUR1rQVz14qYuSvxlBadgpmHL/ TR553nUMtD1zI91fxzgbcuG3W7p6ecK3vCGQeRVzT6VvU3gRxFEJ+4qap4orB+MHSnCw IHtk/7AWOnQI1v5PNPQSSnuvwDLVoac+z8c7Q0Ji3I4WRi2PoZOdwg7oIGDvPIyzZLVk AE5mixN/QtWbMiw/f0Uaka/29EoT+36CV0+7vVIOPxbPMJYoRGr+AZnNm4pcGoUnh5wm M320PZEEWJXQzFGpR5Xbrpa0SpDFLGyrDPjFmXAn6JeUo3RFhOAQXPy5WVYCqLAwMF4p S9lQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q8si14397446plh.191.2022.02.09.12.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 12:45:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0700FE0910FA; Wed, 9 Feb 2022 12:11:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235817AbiBITbm (ORCPT + 99 others); Wed, 9 Feb 2022 14:31:42 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:36506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235550AbiBITbQ (ORCPT ); Wed, 9 Feb 2022 14:31:16 -0500 Received: from smtp.smtpout.orange.fr (smtp10.smtpout.orange.fr [80.12.242.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C6037C0219A3 for ; Wed, 9 Feb 2022 11:22:57 -0800 (PST) Received: from [192.168.1.18] ([90.126.236.122]) by smtp.orange.fr with ESMTPA id HsQsnZO3wbnFGHsQtncXNY; Wed, 09 Feb 2022 20:15:16 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Wed, 09 Feb 2022 20:15:16 +0100 X-ME-IP: 90.126.236.122 Message-ID: <9c563d78-f883-65ee-9e7b-cf44e3b238e8@wanadoo.fr> Date: Wed, 9 Feb 2022 20:15:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] staging: pi433: using div64_u64() instead of do_div() Content-Language: en-GB To: David Laight , 'Jiapeng Chong' , "gregkh@linuxfoundation.org" Cc: "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" , Abaci Robot References: <20220121114955.96979-1-jiapeng.chong@linux.alibaba.com> <03591933cc384d7e91ede82f0cdd76a8@AcuMS.aculab.com> From: Christophe JAILLET In-Reply-To: <03591933cc384d7e91ede82f0cdd76a8@AcuMS.aculab.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 21/01/2022 à 14:34, David Laight a écrit : > From: Jiapeng Chong >> Sent: 21 January 2022 11:50 >> Subject: [PATCH] staging: pi433: using div64_u64() instead of do_div() >> >> Clean the following coccicheck warning: >> >> ./drivers/staging/pi433/rf69.c:286:1-7: WARNING: do_div() does a >> 64-by-32 division, please consider using div64_u64 instead. > > That is one of patchcheck's worse warnings. > > You need to check the domain of the divisor, not its type. > > do_div() exists to avoid expensive 64bit divides when the > divisor is small. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) > > Moreover, the patch is broken by itself. See [1] were it was already reported that do_div() and div64_u64() don't have the same calling convention. Looks that div64_u64() and div64_ul() works the same way. CJ [1]: https://lore.kernel.org/linux-kernel/20211117112559.jix3hmx7uwqmuryg@pengutronix.de/