From nobody Fri Mar 11 14:15:42 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7961E19FBB90 for ; Fri, 11 Mar 2022 14:16:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com [IPv6:2607:f8b0:4864:20::e2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KFSdr2dt4z3l6v for ; Fri, 11 Mar 2022 14:16:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe2b.google.com with SMTP id 189so9613721vsi.7 for ; Fri, 11 Mar 2022 06:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DblM9VjYj7ExqataXSAJPRYKlE8/WhPTEoe0TdvwA+s=; b=vfvTTpclNuHCV262OC/0HxyVxfxGp7y/kDeCrADPxpwgAY0LJ8IFMNiijLA5FLiJJd WPIKI+x7VfWcJI1cIlyBY0P4CRoB0RRJBHqV4qymc2+yf9ZBMwti3JJbu41xjfXc7E/Y nIwImQXQq/FZ5fOUwFHl/z08QZL7Nr7Aj7CG6zLSrbvyXQOfabfAjWhFh0FkZl4dZvvn vD9Xn2fZomOUyM254+ADbUWFxkx/3fFU1vkfvVn78g+JSLxuoBNj+79lL8D57gdJNJst Nez56xwiu/yVgnP61rt00289Tjt5nfGutEzWM2qFkkYI7plnBoPSiIqlh9tULSMzG8NN XJkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DblM9VjYj7ExqataXSAJPRYKlE8/WhPTEoe0TdvwA+s=; b=w7tZYl68awuR+xZHFxrbcFKTiodmOL8DZwHBzFdXLsgPSiYhVHcSi4BHSlkx+on0nz BZCu2dk8EE25GuOzoYzm6Lp4lvW1OhAVnfoMOqKnkc/atFgea4oqmyIDGaNJjL+qNCas Druo0UGojdDDGwV+EcNQYpn7NTGQQKohuboLLGOejZM9AFGAwDMM7f5+TrgEDWjtVCrk iGhGMtuavnOTqhqs1Olc5v4t/8aOT3t3Thg7e8H4V3u2kIGDpWKk1Tf6NwiIk552GOS7 UoICqiLbnS7Cbn7+HWL7XWSWnmHgSwQBY87Uk4Fqh70MSiI34SIH1pv5qeLtW5esaEcf 46WQ== X-Gm-Message-State: AOAM530OEW0UQeixpN/8jae542tTLOA3gzOfsBDMynumTCyGg3b6Ylzb iQAvXvNOR+YjcMWlMq7YTHpWwBftdhFqMHuuLSF1cw== X-Google-Smtp-Source: ABdhPJyldF0xc4YffA5Q7LOep27UeVL1bwEeM+ocN32FzyM2oWGP5dg7Qj9P2rey2w1FphSMngVQcnQP6QDk+1lO7Zw= X-Received: by 2002:a05:6102:2139:b0:320:cf2a:4f3c with SMTP id f25-20020a056102213900b00320cf2a4f3cmr5060959vsg.13.1647008153606; Fri, 11 Mar 2022 06:15:53 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202203110942.22B9guNt032463@gitrepo.freebsd.org> <4eaba9f4-7cd6-5af3-d745-97932501a2fc@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Fri, 11 Mar 2022 07:15:42 -0700 Message-ID: Subject: Re: git: 419822b372f5 - main - libgeom(3): Use calloc instead of malloc and bzero. To: Hans Petter Selasky Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f0366d05d9f1f7ad" X-Rspamd-Queue-Id: 4KFSdr2dt4z3l6v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000f0366d05d9f1f7ad Content-Type: text/plain; charset="UTF-8" On Fri, Mar 11, 2022, 4:10 AM Hans Petter Selasky wrote: > On 3/11/22 11:57, Mateusz Piotrowski wrote: > > Hi, > > > > I grepped out tree and there are many other places, which could be > > converted to using calloc. Is there anything to watch out for when > > converting malloc and memset call pairs to calloc? > > > > Hi, > > If you have a tool for it combined with a review, should be pretty > straight forward. > You likely can use coccinelle to find these. It works better than grep. I don't see any issues converting malloc, memset/bzero sequences, as > long as they zero the full memory area allocated. > I'd break the commits up one per directory in case one needs to be reverted... Maybe in contributed code, you need to push changes upstream first. > Definitely. Warner > --HPS > > --000000000000f0366d05d9f1f7ad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Mar 11, 2022, 4:10 AM Hans Petter Selasky <= hps@selasky.org> wrote:
=
On 3/11/22 11:57, Mateusz Piotrowski wrote:<= br> > Hi,
>
> I grepped out tree and there are many other places, which could be > converted to using calloc. Is there anything to watch out for when > converting malloc and memset call pairs to calloc?
>

Hi,

If you have a tool for it combined with a review, should be pretty
straight forward.

<= div dir=3D"auto">You likely can use coccinelle to find these. It works bett= er than grep.

I don't see any issues converting malloc, memset/bzero sequences, as long as they zero the full memory area allocated.

I'd break the commits = up one per directory in case one needs to be reverted...

Maybe in contributed code, you need to push changes upstream first.

Definite= ly.=C2=A0

Warner=C2=A0
--HPS

--000000000000f0366d05d9f1f7ad--