Received: by 2002:a05:7208:2202:b0:86:316c:7444 with SMTP id s2csp2380143rbb; Tue, 4 Jun 2024 03:52:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyqVRzfqOIRNhhginwIkTMJ3ycwGkRuznd9A7XW93K7eYIQupQPJhCa2lYfcaXNrweVPZF8dZDZ6aqs7YIOSAhopgIjcfTBc7t7N0xtQ== X-Google-Smtp-Source: AGHT+IEbuya6gAI3lGN42gRHmIKYV4/nSe83y4kOcezpAYc8MNEXOx1Nvpt7M+yCS8EFW6SXV4VU X-Received: by 2002:a17:906:b20a:b0:a68:ab53:50e7 with SMTP id a640c23a62f3a-a68ab53545bmr466833866b.69.1717498340900; Tue, 04 Jun 2024 03:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717498340; cv=pass; d=google.com; s=arc-20160816; b=C7tHEmbPuIn39W6+vsv9HDhAujDonHNHfk52oN/l2KqaDvZCMy6iUrNm2KtWcrxK1d nxSAVPuqJ8G3x/hrUTmhBZKSUbgPnPLpZOVd5YMZzr/D2rA0AusMYr1cDP5R0+P8Egj0 DZUrTySceI8HShi1jnm2w9hNngaCBlj83fItoziwYl5qzjnkt2Y+6Ldmupi6YNIHfipd eulq5mUUSVKsN/WsW8Kpluz/6ktWUfFEz2WTwAIpMdaPcZZOLg+1NlRYZJe44yGBo3YS 5fI0CHdE0nmoigRGVLN5WZa7TH4lLqprE9bScAe3NsbkbLZlU4S+YIgRA46u5dJWR/TQ wWVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BYFA+37pk1fG/ZKarRHnqpVvX/8BGXWnojqY8CdQTlc=; fh=PYhPtJizUziO7kI1DDHFDLKr1GlCShX/P6vnfU5QQeA=; b=jehB/eLhb9vq7DLOgXo47dhlHVxnLTPT5fSCYaNTFl+mFEcAs4qz5hAe4wAu2uAGZ2 mh8HVI6yXqPBGyaap1UD/hzOtz4nVVBkTq82kRlN6tBe7h87dEVmjFP/pR+1EV0qbHwo jTd73i7J9SJw6noq0he7yrEHTZLUG8hyQTz+PwPtPjGMad8nQY20KN+57eTKS1tcpPz3 6WfkrK3rrWYwo3Ogt8bNUzXRSCifVBjN8AlGVG7C0g4LFi+fwri73wCUs9jCo8pbPH7x tVaUoRai1WyoX4F39WEcbmI32BS0Mje0oCDZXTAYJhmU5YFxzk97aiHAu7lcb/MEm9zh 5f3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=J1OsLLm5; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-200468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68c75780c6si323370566b.507.2024.06.04.03.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 03:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=J1OsLLm5; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-200468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 am.mirrors.kernel.org (Postfix) with ESMTPS id A50301F21EBF for ; Tue, 4 Jun 2024 10:52:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC89A145343; Tue, 4 Jun 2024 10:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="J1OsLLm5" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 49F63144D0B; Tue, 4 Jun 2024 10:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717498318; cv=none; b=Ifd0PHq/r8/u+D81Mc+BE6tf3DQrAZ3pzOVYWrdkeIQa4NmiB2ArqbPDbIbOavAdDXo0aVl59iXB4F2DAyG5V35GE4zB4R3oaGI8rC+PP16eV175nDlavUv//FK0+2wMNz1W347g5LBeJUjAqL3g0L80/9yAQjmf/A56V9PHTnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717498318; c=relaxed/simple; bh=FuA1WcnBPszbIPbLmTvMS8kdJafvCN4L5VjRSOgRtFM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LDVwLFT7b+OtzPcz98jLrSKaYZEAKzpyKXIBwzd5n0dxh6efa0TjFHEsutaETwVFwsJ48plnZVmulrX3j+80U+mu5cJAfuugIQsDDrtFNp6/U6Z/4zf4TZp8kHfkjgRIfW9uNEGg184RZB3lTS1SP6WkfcYSwcCKkDHyNdKE0xU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=J1OsLLm5; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 454AplfQ085785; Tue, 4 Jun 2024 05:51:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717498307; bh=BYFA+37pk1fG/ZKarRHnqpVvX/8BGXWnojqY8CdQTlc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=J1OsLLm5R5Mh9c/ZEyB477JB7M3Pyd7lbTjxaktAXK7NWCaTqU4ohPbv5T6Ky/Xsw TasjEA+vg9ELqvon9Z8EMbE3+1NMtZdyNR+cNEYcIkCRzvwWezPTaVEB9N+5G3VaTE hkV2kcLbIpOUST2mmxTFpkHOP59nDA600N0WrS3Q= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 454Apl8P117893 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Jun 2024 05:51:47 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 4 Jun 2024 05:51:46 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 4 Jun 2024 05:51:46 -0500 Received: from localhost (ti.dhcp.ti.com [172.24.227.95] (may be forged)) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 454ApkXt073514; Tue, 4 Jun 2024 05:51:46 -0500 From: Devarsh Thakkar To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v12 08/13] math.h: Use kernel-doc syntax for divison macros Date: Tue, 4 Jun 2024 16:21:45 +0530 Message-ID: <20240604105145.2254442-1-devarsht@ti.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240604104001.2235082-1-devarsht@ti.com> References: <20240604104001.2235082-1-devarsht@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Enable rEST documentation for divison macros DIV_ROUND_CLOSEST and DIV_ROUND_CLOSEST_ULL by using kernel-doc markup and syntax for documenting them. Signed-off-by: Devarsh Thakkar --- V1->V12 : No change (Patch introduced in V12) --- include/linux/math.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/include/linux/math.h b/include/linux/math.h index 79e3dfda77fc..2ab9489bba81 100644 --- a/include/linux/math.h +++ b/include/linux/math.h @@ -140,9 +140,14 @@ */ #define roundclosest(x, y) rounddown((x) + (y) / 2, (y)) -/* - * Divide positive or negative dividend by positive or negative divisor - * and round to closest integer. Result is undefined for negative +/** + * DIV_ROUND_CLOSEST - Divide positive or negative dividend by positive or + * negative divisor and round to closest value + * @x: dividend value + * @divisor: divisor value + * + * Divide positive or negative dividend value @x by positive or negative + * @divisor value and round to closest integer. Result is undefined for negative * divisors if the dividend variable type is unsigned and for negative * dividends if the divisor variable type is unsigned. */ @@ -157,9 +162,15 @@ (((__x) - ((__d) / 2)) / (__d)); \ } \ ) -/* - * Same as above but for u64 dividends. divisor must be a 32-bit - * number. + +/** + * DIV_ROUND_CLOSEST_ULL - Divide 64-bit unsigned dividend by 32-bit divisor and + * round to closest value + * @x: unsigned 64-bit dividend + * @divisor: 32-bit divisor + * + * Divide unsigned 64-bit dividend value @x by 32-bit @divisor value + * and round to closest integer. Result is undefined for negative divisors. */ #define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ { \ -- 2.39.1