From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 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,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 95ACFC43461 for ; Fri, 4 Sep 2020 15:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 658462074D for ; Fri, 4 Sep 2020 15:20:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p76FYCN4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730727AbgIDPUG (ORCPT ); Fri, 4 Sep 2020 11:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729942AbgIDPUF (ORCPT ); Fri, 4 Sep 2020 11:20:05 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0308FC061244 for ; Fri, 4 Sep 2020 08:20:05 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id s13so6397750wmh.4 for ; Fri, 04 Sep 2020 08:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4zoE+4eoxo0tq83bX2RzO1lvfyuXOfdgQxhvjxJjaS0=; b=p76FYCN48pozmCh8IypS5xP31Z8BLphMkQal44JYxJGmZV+MqZGAjoSe16+uJVZTsG DAiQhJDVHlqkixw7LBEsWdaedULtqWRX7Dd2f8gUuVvUtx/eon8ki+/CeSZFQfNhdel0 rVvSk6Ljj4xeD39nWMMq2ZXmGojLSNB4ergJlXoF4GXZYpV2zypFtK0Sw1Nb4Sjy7eQQ CDLUQ0dMpCmxfrcad2r8JVd87wQ+PVXWcL7TAhl0jKtYbnL6bZdbwxxPRmEP4uHctEcS gMDiLP4yAmarfiPJZvFijRmgMm6MFCZk3ebB7gNWpswLrBHbkVbwY1EFQOrtovhhAzjo m2fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4zoE+4eoxo0tq83bX2RzO1lvfyuXOfdgQxhvjxJjaS0=; b=bG6cxHsHzdMcxWcavaYNwKTXqdX9Baw+LSLAQO77xvj2laZY2D8qVjWFAlLqJymRGt m8ZiwjdNiUTqCBmybRmqATwqzqxbACP5Pddfkf++tkep8Jfp6Oa8vWnHlBjedtAG5VyI 2ScA9lcFXnhxddnak9ThwCX9AhsGj+ONQowGZwoBQh+KBbdgI9fe56HFpFj9QOdDW7pS xI2aHfIKd2EySKv5/96Ic7FQ8dtQ6OJwBP1+llJpgSGN+jQ1iU/CTYIKdV6jnpQYiPsD fSwm3GqVwSfmXyDmJjt8T8zfTRTc3ppuF2QFAqNKK1Pz0KVDBc/QuhDn7hQi8JYUWqsH Bkjw== X-Gm-Message-State: AOAM531WoVAb+8oM2DtSku66FLEKCY0f2PBJojsaCEzxvg9s/BZj9eUV tfjZS/55tkkVRdVqJ2GaNAg= X-Google-Smtp-Source: ABdhPJyF9duLp5Rwbl9nRD3vN8M0FyADWnpegSs61XrMfP3D0iNh4OFOO9xFJRR8ujgmNwcRyusfVw== X-Received: by 2002:a1c:7911:: with SMTP id l17mr7990481wme.179.1599232803715; Fri, 04 Sep 2020 08:20:03 -0700 (PDT) Received: from ?IPv6:2001:a61:3ab0:7001:e081:d401:3da8:e4bc? ([2001:a61:3ab0:7001:e081:d401:3da8:e4bc]) by smtp.gmail.com with ESMTPSA id h186sm12103328wmf.24.2020.09.04.08.20.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Sep 2020 08:20:03 -0700 (PDT) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, Jakub Wilk Subject: Re: [PATCH (2) 14/34] cmsg.3: Use sizeof consistently To: Alejandro Colomar 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> <8458b842-7d4b-f19b-c596-7f529dd48ba6@gmail.com> <497bc4f4-31f5-91a5-8bc4-469e22b26502@gmail.com> <8160510c-4d9e-7f30-e810-648b0b58a986@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: <8192a9cb-c492-3cb8-8e1f-d161e812833f@gmail.com> Date: Fri, 4 Sep 2020 17:20:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8160510c-4d9e-7f30-e810-648b0b58a986@gmail.com> 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 Hi Alex, On 9/4/20 3:52 PM, Alejandro Colomar wrote: >>>From 374b31bee6762314ab48988e2e78a3a6a2f96834 Mon Sep 17 00:00:00 2001 > From: Alejandro Colomar > Date: Thu, 3 Sep 2020 21:44:54 +0200 > Subject: [PATCH 14/34] cmsg.3: 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 > --- > man3/cmsg.3 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/man3/cmsg.3 b/man3/cmsg.3 > index 3d6288901..8d0ad6666 100644 > --- a/man3/cmsg.3 > +++ b/man3/cmsg.3 > @@ -241,8 +241,8 @@ msg.msg_controllen = sizeof(u.buf); > cmsg = CMSG_FIRSTHDR(&msg); > cmsg\->cmsg_level = SOL_SOCKET; > cmsg\->cmsg_type = SCM_RIGHTS; > -cmsg\->cmsg_len = CMSG_LEN(sizeof(int) * NUM_FD); > -memcpy(CMSG_DATA(cmsg), myfds, sizeof(int) * NUM_FD); > +cmsg\->cmsg_len = CMSG_LEN(sizeof(myfds)); > +memcpy(CMSG_DATA(cmsg), myfds, sizeof(myfds)); > .EE > .in > .SH SEE ALSO Thanks. Patch applied. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/