Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2195838rda; Tue, 24 Oct 2023 15:54:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiSqyQrqhqNDUUUCHjdFgYRKtd++sqC9qppk+GUEXuufDgZPnzT/yjJUtpLK/S4K8goT1e X-Received: by 2002:a17:90a:f0c6:b0:27d:75e2:488a with SMTP id fa6-20020a17090af0c600b0027d75e2488amr12347753pjb.35.1698188045166; Tue, 24 Oct 2023 15:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698188045; cv=none; d=google.com; s=arc-20160816; b=GqyhXUu5WaXfXWpoM7EPOkw7O8prDuozTqkHN5q6qSOMNltJkhCvsA0rvvlZWopC3Z tTY16dsiJQQJtDYEW5GEcSzs9hcK/VB2iMeHbxfxQk3e5mwRvLp3jjoAuA/O3PHH31zf wyivtbkOzpVpKlei0tzPTcAQDSTLujR2qJxjy5SKiKL9C6ULGRl4IXxcHYL/0WLlA40+ UnP2FPvf1NdQN9DlYiSKpLefhdl5yU+uFoY1JOm9rcMU2ee1f9Icuwfv2ycvWHVGzIvJ GNFBxRzeKTqee9Z0Tm5X6FZJIqEXXqLlgikT6ImLiao3tnV97TjI6RZVDyuaydNPJvbc q96w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aAens+Ipl64zEiOYHIFXDI/wJ7R3A+fEEheNo8jpcMc=; fh=wY/hVXvK09YvsQ24qqzO3ZFSIlF+rNTpi9xoNEfHjFk=; b=IoRwTXES0vrBZAZFPw6EAw3Q9Yr0Z4yoSMCNE9qeMFg4lG2m64UZnDckMKcg//dgBm nLYobtMkmX4oHeWSwCTNCwwKR7HwmnmzLvH34mh4XMvP+I/35wjAZSdhZG4w2WanfT3V r5zdUdhdWfvizxc1tRYQhwXKxLU7UdH/4RmTv2+glfFgSJHSBZ3yZQdbqT/r/d3kRH4Y ygSLHuDfJNWwuMRtpF/iQcQ20wKmGoSIPZ/ML5ncXBVdzo/GkQPFt151wInekCAkEi9z Iuok7vi1Zi4ohItq0tH/EJGIXysxaB4FcleSIs6sjdxexIVjmJXRKlP9Nw3XnvOoF2OP 75zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=NzEkeMaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id v22-20020a17090abb9600b0027d54b9f379si8678338pjr.123.2023.10.24.15.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 15:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=NzEkeMaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 05B9D801DCD7; Tue, 24 Oct 2023 15:54:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344466AbjJXWx2 (ORCPT + 99 others); Tue, 24 Oct 2023 18:53:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344502AbjJXWx1 (ORCPT ); Tue, 24 Oct 2023 18:53:27 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4051B10CB for ; Tue, 24 Oct 2023 15:53:24 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9be3b66f254so707519966b.3 for ; Tue, 24 Oct 2023 15:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1698188002; x=1698792802; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aAens+Ipl64zEiOYHIFXDI/wJ7R3A+fEEheNo8jpcMc=; b=NzEkeMaKiLmbLn9PMEF4bvMbrpKwVWYVts9Ii4dCapO/SX4TQYjt5E9pLrVHvf6ziG xsSck+ZHZ1bSLXob+fAzIf0fNKsreZyZjpy5PC+AzEDxCaW2nIqBzpblUnUZumJwAyy2 d5IqPrX5agixJAcvO4bgtcsgcEj6/EzFUPa68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698188002; x=1698792802; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aAens+Ipl64zEiOYHIFXDI/wJ7R3A+fEEheNo8jpcMc=; b=k6teTwJsLmEKO78E8aUyPNIlqPBpfVWIoMAIuOfmStikzgtERHP1i/Xwwu4pi1rZ60 CmG3WHmzVW5PxmxQlrAPygZXSAzeQXTL8v+8Dtrbj0N36cY044gOc0RDOlhpQyiLSLJY ZHB7rZ1mXfbi8nh3gyuXE9WNY/Kcg3nfKV0Ivc7mqbarYkHA/LHJ3xxqBId9XK1MbNyM nQuBPgQWYpHR49kyifVx9nTx7Fb3MmST6ajU9/Fu1w3gMHQVjog2ukaBJ2D5ulHb6MmX zAy1zOOThRl9a0vVj3d6jLJWr/ABIXtyoZ1Y+IfvchQKUQTeFQC5XaF/kOVTGpxhdqoz UU/g== X-Gm-Message-State: AOJu0Yz8Bc4CrrTcGU9xN5gW6qbZz0Mdew5ptXIosajNtGseIzpo/dTP RJkXfeTnuuk3qcwFVA2xFT0jpDv/vMSYQKgbWvSOVQnQ X-Received: by 2002:a17:907:d29:b0:9bd:f902:9a61 with SMTP id gn41-20020a1709070d2900b009bdf9029a61mr12088527ejc.18.1698188002150; Tue, 24 Oct 2023 15:53:22 -0700 (PDT) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com. [209.85.218.54]) by smtp.gmail.com with ESMTPSA id f20-20020a17090660d400b009a1c05bd672sm8729816ejk.127.2023.10.24.15.53.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Oct 2023 15:53:21 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-9be3b66f254so707517966b.3 for ; Tue, 24 Oct 2023 15:53:21 -0700 (PDT) X-Received: by 2002:a17:906:7956:b0:9be:e153:3b82 with SMTP id l22-20020a170906795600b009bee1533b82mr10560167ejo.17.1698188000824; Tue, 24 Oct 2023 15:53:20 -0700 (PDT) MIME-Version: 1.0 References: <20231024161931.78567-1-sebastian.reichel@collabora.com> <20231024161931.78567-2-sebastian.reichel@collabora.com> In-Reply-To: From: Linus Torvalds Date: Tue, 24 Oct 2023 12:53:03 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/3] math.h: add DIV_ROUND_UP_NO_OVERFLOW To: Sebastian Reichel Cc: Andy Shevchenko , Michael Turquette , Stephen Boyd , David Laight , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Vasily Gorbik , Niklas Schnelle , kernel@collabora.com Content-Type: multipart/mixed; boundary="0000000000008d36ec06087e3461" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 15:54:02 -0700 (PDT) --0000000000008d36ec06087e3461 Content-Type: text/plain; charset="UTF-8" On Tue, 24 Oct 2023 at 09:32, Linus Torvalds wrote: > > I would really prefer to just make our regular DIV_ROUND_UP() DTRT. But: > > - people do use it with complex first arguments (ie function calls > etc) that we don't want to evaluate twice > > - we can't make it an inline function, because the types aren't fixed > > - we can't even use a statement expression and __auto_type, because > these things are used in type definitions etc and need to be constant > expressions Ok. I have a potential beginning of a solution. It is unbelievably disgustingly complicated. But it might approach being correct. And by that "it might approach being correct" I obviously mean "this is untested, but builds at least some kernel code". I'm almost certain it will fail on more complex cases, because I already found a lot of questionable stuff that was simply hidden by the old macro just silently doing the C arithmetic type conversions, and this thing does type handling manually. I'm hoping that somebody will go "Linus, you're just being *completely* silly, it's much easier to do XYZ". Linus --0000000000008d36ec06087e3461 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Introduce-complicated-non-overflowing-DIV_ROUND_UP.patch" Content-Disposition: attachment; filename="0001-Introduce-complicated-non-overflowing-DIV_ROUND_UP.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lo4x9kjn0 RnJvbSA3MTJjOWVhY2RlZDViNzE3Y2JiODhkYjFkZjVlNDMwMzQyMDEyMjY5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IFR1ZSwgMjQgT2N0IDIwMjMgMTI6NTE6MDYgLTEwMDAKU3ViamVjdDog W1BBVENIXSBJbnRyb2R1Y2UgKGNvbXBsaWNhdGVkKSBub24tb3Z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