From nobody Fri Mar 11 11:09:47 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 AF4A61A1D6B4; Fri, 11 Mar 2022 11:10:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KFNWD3vlQz4r5Z; Fri, 11 Mar 2022 11:10:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 41447260352; Fri, 11 Mar 2022 12:09:59 +0100 (CET) Message-ID: Date: Fri, 11 Mar 2022 12:09:47 +0100 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: git: 419822b372f5 - main - libgeom(3): Use calloc instead of malloc and bzero. Content-Language: en-US To: Mateusz Piotrowski <0mp@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202203110942.22B9guNt032463@gitrepo.freebsd.org> <4eaba9f4-7cd6-5af3-d745-97932501a2fc@FreeBSD.org> From: Hans Petter Selasky In-Reply-To: <4eaba9f4-7cd6-5af3-d745-97932501a2fc@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KFNWD3vlQz4r5Z X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N 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. I don't see any issues converting malloc, memset/bzero sequences, as long as they zero the full memory area allocated. Maybe in contributed code, you need to push changes upstream first. --HPS