Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1726690lql; Wed, 13 Mar 2024 06:44:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfY6D9XRmJY7AhwadVMGRikjR8zMWT2aQYHagq32zFwuheN2CHqk80gmDQ9TsnrZxZ/ICvzl2AS2cEFjXhtCvumKqZ03C5Zw4DDiQ5ew== X-Google-Smtp-Source: AGHT+IFXeyTlY0pQB8lvCIP4ax3ngj9FrluEPWOD8zx/KyGW2pQWwaSyDOai0+tf57Me1/Wvznpy X-Received: by 2002:ac8:7dd5:0:b0:42e:bbdf:bcb0 with SMTP id c21-20020ac87dd5000000b0042ebbdfbcb0mr7640366qte.46.1710337451320; Wed, 13 Mar 2024 06:44:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710337451; cv=pass; d=google.com; s=arc-20160816; b=X9Ir+B1idQ0SKU8IM9+ln5PsAmilxxaI0lc8J8o6gXi3n2/LvWHt53IZ1eeEHLfcue HYnIqpCdQa/B/Jl5AU4Sp33jLzyX8nOB8BlmZ+M9TP/DaGPOWFyXUGf3npLhN6rNqZ+g +hMAHynAwvWdJAJb2YgMxZaJ0AcOVi2wesE92jCJNEh8BBY52XDSBCh44BHLEIWcUWN8 ET0h2bNWpvaWrtF/UHRx6NxoE14HEA3H5fJgiRONfG7KPpnRCex5sXCsXtVJhP5Tw4vT 0Vxo6ouyJQRbtpRVm3uqjoxbvd3Tl/qhJWFlkouli7Tnd2v1L6x63rd3IwmNkPDG2lus Z+Uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :references:cc:to:subject; bh=y+4GXlLv9FhvWyx2ErsnMg3rt76VWflpkO5Ik4zEwlI=; fh=9eJavyXf3Al/CceIQHKa8jKbxbq+FguMekgxKtEneLo=; b=v9DdaaBm8xcomidXCjquX4szHxB5iSZ/uNZUfNpPXgkPMwNJLNcVGVgPbc5phztLAN xKe5HQ5UsqJEYQtaoenj+IdbLjCop9wYJtBZwKYJS/mAFUtzdOopKbHtylMoz/ygOI0/ zN2MvcpwOO6aRj6ySEhZndEKThuo5dfBf7ETq+T+U1hB1M06L3yu040oOVdcIeqSDyvp vxPKJb8nY2SQrXpF0U4cq0a5ZvjAILS9lPy1rE/fEoen/vCmrhxatrl00q4r7ymu5BEL SH7bFZSnHz4kxbQVP+Fbmk8rti6vhK1aTbD2la9nLXmG1YgOpkpcq1V3RqCKPrUjJfW6 ZVgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-101552-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101552-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s7-20020a05622a178700b0042ef2fb6a35si9768533qtk.360.2024.03.13.06.44.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 06:44:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101552-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-101552-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101552-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 10BE71C21EEA for ; Wed, 13 Mar 2024 13:44:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1B4F41238; Wed, 13 Mar 2024 13:44:05 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47DA040872 for ; Wed, 13 Mar 2024 13:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710337445; cv=none; b=IXrscjx9x4G+O6NCAeLtxO/GuQA9I5oPYwuPxYflR0DdxE/sFgiDV4ae0+mI8NEDH13XPPIeGGr2vG9CAHnH1pEaxILjSNsstrmMqMeNghM+Qy7UFofe8VzHTmv7enWvbExSVWKKsofZl5ia6gUyXpZW6WOqZKEt9NimkBuaENk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710337445; c=relaxed/simple; bh=k3FXLqgWmUFo8cDlorJgat0uASGMvswchYqV5m9L6fQ=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=HISimtXxcAw21mYAkoo9hi/pjRQ9GaFyrCTVrjQhGk5qYp6H71JMo9CJgakSYcIhXS0FOgtAqRUmOQwBwknJQyzfBzSvAmWRBGLOjIjz4AfcY0nSDJOuObIAYiBJiTqCRJ46uNUr46NJJa5vpGCQhs7VQjlm3X5ylTYmtuzFRnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4TvsDD3nMcz1FMJR; Wed, 13 Mar 2024 21:43:40 +0800 (CST) Received: from kwepemm600013.china.huawei.com (unknown [7.193.23.68]) by mail.maildlp.com (Postfix) with ESMTPS id 580CE1400FD; Wed, 13 Mar 2024 21:43:56 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 13 Mar 2024 21:43:55 +0800 Subject: Re: [PATCH] mtd: ubi: avoid expensive do_div() on 32-bit machines To: Arnd Bergmann , Arnd Bergmann , Richard Weinberger , Miquel Raynal , Vignesh Raghavendra , Daniel Golle CC: , References: <20240313084707.3292300-1-arnd@kernel.org> <4f945f4a-ac29-3ef7-9e15-123962f2a0e9@huawei.com> <1a12c8ed-0cb5-5650-24a2-84b021c444c3@huawei.com> <610231c3-c3ee-e543-1a8a-8e1098ee6a7c@huawei.com> <21cd0f32-c94b-4b2b-8fa6-ebe12756b0c4@app.fastmail.com> From: Zhihao Cheng Message-ID: Date: Wed, 13 Mar 2024 21:43:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <21cd0f32-c94b-4b2b-8fa6-ebe12756b0c4@app.fastmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600013.china.huawei.com (7.193.23.68) 在 2024/3/13 21:39, Arnd Bergmann 写道: >> Thanks for explaination, which means that do_div is used for 64-bit >> division to solve the link failure caused by missed libgcc. Since >> parameter 'from' is u32, there is no need to invoke do_div on a 32-bit >> platform, you just want to stop the wasting behavior on a 32-bit >> platform. Do I understand right? > > Yes, correct. > > Arnd > . > How do you find it? I mean there are so many types and many do_div callers, do you have a static check tool?