From 0a4ada8d40fb687a659161ff7e0d1d0994264402 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 1 Dec 2014 23:55:25 +0100 Subject: Replace `bzero' with `memset' For reference, this patch was created using the following semantic patch, and then manually applying the change in all functions containing nested functions, as those are not supported by Coccinelle. @@ expression A, B; @@ - bzero (A, B) + memset (A, 0, B) * auth/auth.c: Replace `bzero' with `memset'. * boot/boot.c: Likewise. * defpager/defpager.c: Likewise. * exec/exec.c: Likewise. Also, drop `safe_bzero' and just use `hurd_safe_memset' directly. * ext2fs/ext2fs.c: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/pager.c: Likewise. * fatfs/pager.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/netfs.c: Likewise. * isofs/inode.c: Likewise. * isofs/pager.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-statfs.c: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/start-translator.c: Likewise. * libftpconn/create.c: Likewise. * libftpconn/open.c: Likewise. * libftpconn/unix.c: Likewise. * libpipe/pipe.c: Likewise. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libstore/argp.c: Likewise. * libstore/enc.c: Likewise. * libstore/kids.c: Likewise. * libthreads/alpha/thread.c: Likewise. * libtreefs/fsys.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/glue-include/asm/uaccess.h: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/options.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pflocal/io.c: Likewise. * startup/startup.c: Likewise. * storeio/storeio.c: Likewise. * sutils/fstab.c: Likewise. * usermux/usermux.c: Likewise. * utils/fakeauth.c: Likewise. * utils/frobauth.c: Likewise. * utils/login.c: Likewise. * utils/x.c: Likewise. --- mach-defpager/default_pager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mach-defpager') diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 831ed968..9e4b0e76 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -192,7 +192,7 @@ new_partition (const char *name, struct file_direct *fdp, part->going_away= FALSE; part->file = fdp; - bzero((char *)part->bitmap, bmsize); + memset ((char *)part->bitmap, 0, bmsize); if (check_linux_signature < 0) { @@ -428,7 +428,7 @@ create_paging_partition(const char *name, new_list = (partition_t *) kalloc( n * sizeof(partition_t) ); if (new_list == 0) no_paging_space(TRUE); - bzero(new_list, n*sizeof(partition_t)); + memset (new_list, 0, n * sizeof(partition_t)); if (i) { old_list = all_partitions.partition_list; bcopy(old_list, new_list, i*sizeof(partition_t)); @@ -1640,7 +1640,7 @@ default_read(ds, addr, size, offset, out_addr, deallocate, external) * An external object is requesting unswapped data, * zero fill the page and return. */ - bzero((char *) addr, vm_page_size); + memset ((char *)addr, 0, vm_page_size); *out_addr = addr; return (PAGER_SUCCESS); } @@ -2118,7 +2118,7 @@ default_pager_t pager_port_alloc(size) ds = (default_pager_t) kalloc(sizeof *ds); if (ds == DEFAULT_PAGER_NULL) panic("%spager_port_alloc",my_name); - bzero((char *) ds, sizeof *ds); + memset ((char *)ds, 0, sizeof *ds); dstruct_lock_init(ds); -- cgit v1.2.3