From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FB5C433ED for ; Fri, 16 Apr 2021 15:59:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7432D61222 for ; Fri, 16 Apr 2021 15:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237946AbhDPP7f (ORCPT ); Fri, 16 Apr 2021 11:59:35 -0400 Received: from angie.orcam.me.uk ([157.25.102.26]:39020 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236485AbhDPP7e (ORCPT ); Fri, 16 Apr 2021 11:59:34 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 669D492009C; Fri, 16 Apr 2021 17:59:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 5FA6392009B; Fri, 16 Apr 2021 17:59:08 +0200 (CEST) Date: Fri, 16 Apr 2021 17:59:08 +0200 (CEST) From: "Maciej W. Rozycki" To: Huacai Chen cc: Thomas Bogendoerfer , "open list:MIPS" , Jiaxun Yang , Huacai Chen , stable Subject: Re: [PATCH] MIPS: Remove unused and erroneous div64.h In-Reply-To: Message-ID: References: <20210412033451.215379-1-chenhuacai@loongson.cn> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, 15 Apr 2021, Huacai Chen wrote: > > I think this is a weak argument for removal, isn't it? > Yes ,it is weak, but I'm not able to fix it, could you please help me? First of all you need to assign the quotient to `*n' rather than `__n', which is a temporary only. Otherwise it's discarded, so no surprise the piece does not work. Also this piece assumes the quotient will fit in 32 bits (which should be obvious from the name and data type of the relevant temporary if not the asm itself), which is what the initial division of the high part was for before commit c21004cd5b4c and which the `do_div' wrapper does not arrange for. Said commit is really broken indeed as it mustn't have dropped the initial division and instead it should have only amended the asm for the removal of the `h' constraint (easy fix). Maciej