From patchwork Mon Jan 19 21:48:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1669 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859397; bh=Ofp/1dD4BEWsYjKzZIWrFq11B+4Nc9UxL5a9+XZsJx4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=SB26Z6c6gP75cObQyaVCcU3SBl64QreLfbqr8QPpIUI6Qyd1vVARuM2iqcU2C9JM4 fjGiEFWbORgMOuMiQnuj4oLQSC+Rj9gT1aoLkHz+VUz/qNe8CWFLbxmS3jnKbKkVv8 nReO5hFWx6VoX0T+01eIiT1a9xzOFULqdjJiK6uYl3lFYMi3sePnbM6DiafSw/Yrpi bIpKGM4r/VpR+iwxXWf/4dI8fc9OBw9rehvEXEzcstfNeCEhByrtuEfI4HHZznTxqc kVOkkHkLgEqb0NUeUAauaLkz3BHZeGs+yBwe5oJXSEuH1NyUzLr8vOntAnaWHcKIJB 9+oURoG8BcevQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B1ADA69535 for ; Mon, 19 Jan 2026 14:49:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GXvJvb1kJ9wS for ; Mon, 19 Jan 2026 14:49:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859397; bh=Ofp/1dD4BEWsYjKzZIWrFq11B+4Nc9UxL5a9+XZsJx4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=SB26Z6c6gP75cObQyaVCcU3SBl64QreLfbqr8QPpIUI6Qyd1vVARuM2iqcU2C9JM4 fjGiEFWbORgMOuMiQnuj4oLQSC+Rj9gT1aoLkHz+VUz/qNe8CWFLbxmS3jnKbKkVv8 nReO5hFWx6VoX0T+01eIiT1a9xzOFULqdjJiK6uYl3lFYMi3sePnbM6DiafSw/Yrpi bIpKGM4r/VpR+iwxXWf/4dI8fc9OBw9rehvEXEzcstfNeCEhByrtuEfI4HHZznTxqc kVOkkHkLgEqb0NUeUAauaLkz3BHZeGs+yBwe5oJXSEuH1NyUzLr8vOntAnaWHcKIJB 9+oURoG8BcevQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9FEBF69525 for ; Mon, 19 Jan 2026 14:49:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859394; bh=LtXgh8qBBrEK05migKKQeb4uZL4FN+alIEj2gwZTN8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aECORFQgy0qP/r9AhmJu8xoHrrgnPdu0a8LCGuHoLZojhFpiJ1tRf93FmHEEyELim KiPaq1JZPx3wHv0Vvh8gg5UG1AAY5P4qnShCq74nZGAtQe4aimHkrGAthvo5VOpKQy WQatrFzWAVeOXOHPjslGwfRqzqRGwdHRsKVgG5pqqSR/s1nWzIq5iqxrtjRVmwvnjA k7dmhmiFwc6WPLiuUof1GpTJ/7JUtxSdTY60NAlP3yO7B5MUoPS94u1JbogH5Mncp1 U/CD2T+o/dPANiFMFSHtUISV2SrqdStRo6GqdChIek7f5MSURaYPjPBAcvYE4MZ75e L4vqY6cQ5i/BQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DCD0669520; Mon, 19 Jan 2026 14:49:54 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Uc31sJJd38t8; Mon, 19 Jan 2026 14:49:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859390; bh=H+c5TDP+Srd+TPSEk7F3uPasblsWGSWdbkIdjT0iECk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sBwoJ7H1lYoOJAznTVRL3P7e+/tsEGM99dkhi0INL4p0UoKtXy69hEeXLsvIopgkH MtOMSrguMx3MQOMchcqWRPDgdFle390XoYvAqdF2N5tXnaZ9RvsfHev6ZW8thEqr02 5JoMXZdlFMsl3FYOEkL5/dYD3U3AVEXiMEEFxxAFa3puEbjLKtbSz4HF2GqFUC3V40 h15owmzgMoopbmR4izPRDvQoUUghKNHOxBhqTway0pZuoAus9eDGTxgRreZ1dJn7jb RP2jVMBNoe6eYrMYmbbJ49IghFC2TAILNUQTZuo+JGy9nCBWt8q0QqFgeOZIphIXyo wB9B8VLwCUfcQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8AC1C6951A; Mon, 19 Jan 2026 14:49:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:37 -0700 Message-ID: <20260119214846.3087611-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3NK3Y5E5TBIWRAHY3K42PXO54QTIP7JM X-Message-ID-Hash: 3NK3Y5E5TBIWRAHY3K42PXO54QTIP7JM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/16] ext4l: Move umin to linux/minmax.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the umin() macro to include/linux/minmax.h and add the matching umax() macro. These return the minimum/maximum of two unsigned values. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 3 +-- include/linux/minmax.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 310d79227b7..b50004bca55 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -699,8 +699,7 @@ struct dx_hash_info { /* indirect.c stubs */ -/* umin - unsigned min (Linux 6.x) */ -#define umin(x, y) ((x) < (y) ? (x) : (y)) +/* umin is in linux/minmax.h */ /* truncate_inode_pages is in linux/pagemap.h */ diff --git a/include/linux/minmax.h b/include/linux/minmax.h index 52ce477459d..38b27c0232f 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -49,4 +49,22 @@ static inline bool in_range32(u32 val, u32 start, u32 len) return (val - start) < len; } +/** + * umin - Return the minimum of two unsigned values + * @x: First value + * @y: Second value + * + * Return: The smaller of @x and @y + */ +#define umin(x, y) ((x) < (y) ? (x) : (y)) + +/** + * umax - Return the maximum of two unsigned values + * @x: First value + * @y: Second value + * + * Return: The larger of @x and @y + */ +#define umax(x, y) ((x) > (y) ? (x) : (y)) + #endif /* _LINUX_MINMAX_H */