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=-11.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 6F996C433E2 for ; Fri, 4 Sep 2020 14:12:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F1EE206B8 for ; Fri, 4 Sep 2020 14:12:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kOV+Yx+9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730758AbgIDOMs (ORCPT ); Fri, 4 Sep 2020 10:12:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730585AbgIDNpV (ORCPT ); Fri, 4 Sep 2020 09:45:21 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70C93C061244 for ; Fri, 4 Sep 2020 06:45:16 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id a17so6796393wrn.6 for ; Fri, 04 Sep 2020 06:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ja0cv6hAtfm2BPmP9udAM22wFgJGqBw0cjnTdBQe6SA=; b=kOV+Yx+9Sc5FtuFVEp8toxLSQOEcR61jizOZPgpC6oEI/P6rjRohmmXU6YSUuzM5t0 SOQc/55I50u7YeqifuWFAiG5nMlTIPC+7H2WdXk6nwszP5ZNUoy2Y/HQr/iqBy0cTTNM HjXdsY15vXumtE2/rYRkLu7HVH4Wk2mGTloi8Eg2FqeDsKXOja3psx3WquNRdIHZLma9 Ics1UVi15eUkp9W6dm9xfZMrRnr1BFw2nVqIM80tZ97sHpYFC12Yi6wvn0zKigZ6VP7v vmiUeGg5igOZUJ5NjDmWYwUP0NYffnX9DZ5gyGueKRMqFA7UZGOGRbFNzTAAwjEVa6SY uLtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ja0cv6hAtfm2BPmP9udAM22wFgJGqBw0cjnTdBQe6SA=; b=NHgboOSnHHgd9TPTGqHulagG+rrjFLjmpG/2juhR+7DteVC7cr5C130SPKg6EnBOLP Zya2hmnBxnNyVTZfAXavLby5uBdt8ocFcyAEsCoIP4obM4m7o2XymRCgvD135zfnru3u A0kgiKjt+uPd6BBw85er1yyD0ykcE6225rsusvuN3pzS476/tmyN1JxGVrmo9xbk9N6I ndIPtToBXHoCUPeOoucRJ3aBgda8AvLyRENX03qlJgpnpOhB3AyTjp0dK/0cJjV77tNT +X3hJSoIATgLhs8hHMx7dJ30++/7DghjPbvaEAbjnayz/W0xycW01Tk6nQMs7D7/ClEy TGow== X-Gm-Message-State: AOAM533bSQwFitQNIDD/cYXyBtMVK1wZbXE8nAJYkMN5UylsMxcgcceP 74yISVIolwqbkbviNi/xxR6G2AfLWJM= X-Google-Smtp-Source: ABdhPJwusoKJ6p7hTf1ucocnlo+/EXz/bJcCRScjGI7AM68Nhm1cnZ5PUcIfqo6hBXPdBO4RmiLbGw== X-Received: by 2002:adf:8481:: with SMTP id 1mr7362494wrg.231.1599227113389; Fri, 04 Sep 2020 06:45:13 -0700 (PDT) Received: from [192.168.0.160] ([93.115.133.118]) by smtp.gmail.com with ESMTPSA id u6sm10760010wrn.95.2020.09.04.06.45.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Sep 2020 06:45:12 -0700 (PDT) Subject: [PATCH (2) 11/34] timerfd_create.2: Use sizeof consistently From: Alejandro Colomar To: "Michael Kerrisk (man-pages)" Cc: linux-man@vger.kernel.org, Jakub Wilk References: <806999b7-8947-d350-2125-f04b69846f37@gmail.com> <9fcc512e-a12c-5b28-126f-aaf1854ed290@gmail.com> <2b288808-c840-343f-9e56-8097765e5528@gmail.com> <876dcc97-8151-7160-5eda-19307f0483c1@gmail.com> <462b75ca-bef8-063d-b6ec-d1c845fb1580@gmail.com> <26629635-bf4c-1279-314d-db92f11adbb7@gmail.com> <257c9374-3253-9091-c116-045ee16590c0@gmail.com> <40ba6e68-c2f6-649c-2225-6037e3c0c077@gmail.com> Message-ID: Date: Fri, 4 Sep 2020 15:45:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-man-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org From d347c933a8c253028f8f76c4170b65b85ce7d605 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 3 Sep 2020 21:42:28 +0200 Subject: [PATCH 11/34] timerfd_create.2: Use sizeof consistently Use ``sizeof`` consistently through all the examples in the following way: - Use the name of the variable instead of its type as argument for ``sizeof``. Rationale: https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory Signed-off-by: Alejandro Colomar --- man2/timerfd_create.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man2/timerfd_create.2 b/man2/timerfd_create.2 index 67a13dba3..fd4acf3e9 100644 --- a/man2/timerfd_create.2 +++ b/man2/timerfd_create.2 @@ -700,8 +700,8 @@ main(int argc, char *argv[]) printf("timer started\en"); for (tot_exp = 0; tot_exp < max_exp;) { - s = read(fd, &exp, sizeof(uint64_t)); - if (s != sizeof(uint64_t)) + s = read(fd, &exp, sizeof(exp)); + if (s != sizeof(exp)) handle_error("read"); tot_exp += exp; -- 2.28.0