Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5252682pxj; Wed, 9 Jun 2021 12:53:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLWgM6XRUFs73UI1V9w80wGsjsr2f+8LwcG49nqC38vEWkO+uZkVbOZIMWq9zPQ9mWvUGd X-Received: by 2002:a05:6402:145a:: with SMTP id d26mr1043296edx.151.1623268405642; Wed, 09 Jun 2021 12:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623268405; cv=none; d=google.com; s=arc-20160816; b=M9xhsjjskhcr9OcBzdEgZqRQPe1F8mG2zejp+eW0FTcN6P6QY5iCj+7WM6uRyDHeXG RS9Mub3zRGVUwD+lVQ1QB3J1ZI/iKg6SlVvjKXFBysOjMtvXkmUZFCrcxlKoIQLH1E4q EfZwuvo3y1NXFCZHfbTnK6c/T9vXXaKmV8mJSKrGAuAE6XXxJqbgCvey3g/kJOkgigHA O6kn3Pqdl5GOUJb/J2BPYxBOdWWco/uXJk3ViYrpzCArkrEqL/vZQ0ZEmPSG+eKfIQ8O Zjcf12AqTr8N+FPRKQTAdrtdJl2fTIrbLra3ZwuThI/CwXxiPjWi3tGaw2KHEKaDJIZ8 SVkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=3v/xy1vVOy0p+15gYBu2aWN8fdeRRMYWYLro1y/PuTE=; b=vI4o5MwESHMXjJ7OLCmAqj9Me2m47eFq8+Yw4UXS7Z1GbVm7QEjRAXEP9u/1LEI47W 1AQ8o4YgTi939R6MLTH3io2Ygrta9Zh+WIQR2IUj0WgNmjbAx5PLphMX1jcKBOPbpai7 uIDD498QWdFxt+JdxLFGveAT1Ncg8YCK7NcqkrwTplF71l8PcsYR7sZTFv9Rjlgx93qs oAj5JPTYcaIlvrvIXddhZRPfZbl8AkP0MsR81lixwFBPhEGorFcfUr1HM5GVF5kSL/0I 60LTyQdH9OKcm6Ck7F9kzm0BKqWt/Z1LT0xFxnZCmvvx6s//VimWL203JGrWdwEaraLk r3jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fVnkgjEZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si542238edy.74.2021.06.09.12.52.41; Wed, 09 Jun 2021 12:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fVnkgjEZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbhFITxA (ORCPT + 99 others); Wed, 9 Jun 2021 15:53:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhFITw7 (ORCPT ); Wed, 9 Jun 2021 15:52:59 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC1DCC061574 for ; Wed, 9 Jun 2021 12:51:04 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id j7-20020a258b870000b029052360b1e3e2so32696645ybl.8 for ; Wed, 09 Jun 2021 12:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=3v/xy1vVOy0p+15gYBu2aWN8fdeRRMYWYLro1y/PuTE=; b=fVnkgjEZumr/DFopY/S3A/YevSvqaDXOcTq5g/KTwm7eIQg9gSphvVdkxcVdbpgzLT lJpP9kWAQZbM3LS38aK3nN13YpgseyU1sKlcNjHWTuL2yVl79MNpmIkUr+wZDUN1BzRR 1DINZ1J32lKAgfb9kM32SdHYwehf8Yc72xw4w4C+Z/JrjjA034RBaUHaGfd5ChSRhbCy xazlARv6wyC8/APKaNMGqfSCMUpYvflh4quVANFV2x39pu8s1+bvwyVuwSkrsn+d9KLV 2aHjXFJPk7avyqicaOs967Y8kojFdtx5teRh8qLD7h6MiQMM+n/UbgO16L4eWrN6Ijhc ACCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=3v/xy1vVOy0p+15gYBu2aWN8fdeRRMYWYLro1y/PuTE=; b=s5BGEAbaNWd88TKmXYWwuXJ8EZWpIaf7Jiyx/11NF58FV+f80P7PL2vpOqhw3EsDpr EDDG1ZOuK7qovGM/iCapfva5+HV7+0Lti6hQc1Vc6RhRFOsgR2CQAaRV+z9fR1hayS9K 3GWq00Jsi/W7ABrHMyWfMD5he6WGnFDbQ7U9mU1H2KIJ38e0wb1NCeEgBY8pmA7hg2CP GEORhe3gZu0Ec/JZaTeWjw3NjVGFHbHTIEwW1rfNGT9pQPtSyIiJh7y6E1FxY+XMkF1z 4oAVt0Wf0n0Gl0VPGITY9BrWTrpmpLesLqkz8IzHXrmpk7DB0p0pHuVrBXQjPOosG1mk l/rQ== X-Gm-Message-State: AOAM532zmleSL/3x6acPZ8C6o+G+3YNkzaIgbo5OJ4KfYt/+f0R9F7tc y+ZqZcomKFBPs553AL4W2eP078CyWHqwgQ== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:10:7f:e700:c0a8:b1]) (user=cmllamas job=sendgmr) by 2002:a25:be44:: with SMTP id d4mr2206033ybm.497.1623268264053; Wed, 09 Jun 2021 12:51:04 -0700 (PDT) Date: Wed, 9 Jun 2021 19:50:58 +0000 Message-Id: <20210609195058.3518943-1-cmllamas@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.272.g935e593368-goog Subject: [PATCH] docs: printk-formats: update size-casting examples From: Carlos Llamas To: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Jonathan Corbet Cc: Christoph Hellwig , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 72deb455b5ec ("block: remove CONFIG_LBDAF") sector_t and blkcnt_t types are no longer variable in size, making them unsuitable examples for casting to the largest possible type. This patch replaces such examples with cycles_t and blk_status_t types, whose sizes depend on architecture and config options respectively. Signed-off-by: Carlos Llamas --- Documentation/core-api/printk-formats.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst index f063a384c7c8..385c0cc52f1f 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst @@ -37,14 +37,13 @@ Integer types u64 %llu or %llx -If is dependent on a config option for its size (e.g., sector_t, -blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a -format specifier of its largest possible type and explicitly cast to it. +If is architecture-dependent for its size (e.g., cycles_t, tcflag_t) or +is dependent on a config option for its size (e.g., blk_status_t), use a format +specifier of its largest possible type and explicitly cast to it. Example:: - printk("test: sector number/total blocks: %llu/%llu\n", - (unsigned long long)sector, (unsigned long long)blockcount); + printk("test: latency: %llu cycles\n", (unsigned long long)time); Reminder: sizeof() returns type size_t. -- 2.32.0.272.g935e593368-goog