Replace env_memset() with memset()
authorWendy Liang <jliang@xilinx.com>
Tue, 31 May 2016 23:00:21 +0000 (16:00 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:41 +0000 (22:01 -0700)
There is memset() in standard C.
There is no need to redefine env_memset()

Signed-off-by: Wendy Liang <jliang@xilinx.com>
apps/matrix_multiply/matrix_multiplyd.c
lib/common/sh_mem.c
lib/remoteproc/elf_loader.c
lib/remoteproc/remoteproc.c
lib/remoteproc/remoteproc_loader.c
lib/rpmsg/remote_device.c
lib/rpmsg/rpmsg_core.c
lib/virtio/virtqueue.c

index bf7e14a993eb6dacba51c282e2949f9f7d0d34d7..039d4e83ced3bd546e1a0a30983fcf117637faec 100644 (file)
@@ -107,7 +107,7 @@ static void Matrix_Multiply(const matrix * m, const matrix * n, matrix * r)
 {
        int i, j, k;
 
-       env_memset(r, 0x0, sizeof(matrix));
+       memset(r, 0x0, sizeof(matrix));
        r->size = m->size;
 
        for (i = 0; i < m->size; ++i) {
index 134654b1599e954f316f71ba869793ee2fc09c8c..8f5b8155cc06a7084c64d91d0c79a9d69ee86c2a 100644 (file)
@@ -42,6 +42,7 @@
  *       it is only being used to manage shared memory.
  *
  **************************************************************************/
+#include <string.h>
 #include "openamp/sh_mem.h"
 
 /**
@@ -87,7 +88,7 @@ struct sh_mem_pool *sh_mem_create_pool(void *start_addr, unsigned int size,
 
        if (mem_pool) {
                /* Initialize pool parameters */
-               env_memset(mem_pool, 0x00, pool_size);
+               memset(mem_pool, 0x00, pool_size);
                metal_mutex_init(&mem_pool->lock);
                mem_pool->start_addr = start_addr;
                mem_pool->buff_size = buff_size;
index dba9e367f56fb72f9bd901f8d15b352e7dfa5d99..c863a612ef0a7d955647b9ce8dc0fff519577d76 100644 (file)
@@ -27,6 +27,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <string.h>
 #include "openamp/elf_loader.h"
 
 /* Local functions. */
@@ -97,7 +98,7 @@ int elf_loader_attach_firmware(struct remoteproc_loader *loader, void *firmware)
        }
 
        /* Clear the ELF decode struct. */
-       env_memset(elf_info, 0, sizeof(struct elf_decode_info));
+       memset(elf_info, 0, sizeof(struct elf_decode_info));
 
        /* Get the essential information to decode the ELF. */
        status = elf_loader_get_decode_info(firmware, elf_info);
index 7e577d578d2977b1cbb8d8c0a4426f052271c447..56fb333cfdb11206ebb113f8a38111e4b1d1a630 100644 (file)
@@ -28,6 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <string.h>
 #include "openamp/remoteproc.h"
 #include "openamp/remoteproc_loader.h"
 #include "openamp/rsc_table_parser.h"
@@ -74,7 +75,7 @@ int remoteproc_resource_init(struct rsc_table_info *rsc_info,
 
        rproc = env_allocate_memory(sizeof(struct remote_proc));
        if (rproc) {
-               env_memset(rproc, 0x00, sizeof(struct remote_proc));
+               memset(rproc, 0x00, sizeof(struct remote_proc));
                /* There can be only one master for remote configuration so use the
                 * rsvd cpu id for creating hil proc */
                rproc->proc = hil_create_proc(HIL_RSVD_CPU_ID);
@@ -200,7 +201,7 @@ int remoteproc_init(char *fw_name, rpmsg_chnl_cb_t channel_created,
 
        rproc = env_allocate_memory(sizeof(struct remote_proc));
        if (rproc) {
-               env_memset((void *)rproc, 0x00, sizeof(struct remote_proc));
+               memset((void *)rproc, 0x00, sizeof(struct remote_proc));
                /* Get CPU ID for the given firmware name */
                cpu_id = hil_get_cpuforfw(fw_name);
                if (cpu_id >= 0) {
index 8bb6967e8cf84bb0652f23c9d62e8ae4b6ef7f16..27365d98eabec0c25f43f8e5215f7b6b69fd0c01 100644 (file)
@@ -27,6 +27,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <string.h>
 #include "openamp/remoteproc_loader.h"
 
 /**
@@ -56,7 +57,7 @@ struct remoteproc_loader *remoteproc_loader_init(enum loader_type type)
        }
 
        /* Clear loader handle. */
-       env_memset(loader, 0, sizeof(struct remoteproc_loader));
+       memset(loader, 0, sizeof(struct remoteproc_loader));
 
        /* Save loader type. */
        loader->type = type;
index 03c1fe4687c619f7002188e6cefd5dc5adb84ff1..5d27df731c4ecdd6b8d4b30299a3fbc10cf05fdb 100644 (file)
@@ -46,6 +46,7 @@
  *
  **************************************************************************/
 
+#include <string.h>
 #include "openamp/rpmsg.h"
 
 /* Macro to initialize vring HW info */
@@ -113,7 +114,7 @@ int rpmsg_rdev_init(struct remote_device **rdev, int dev_id, int role,
                return RPMSG_ERR_NO_MEM;
        }
 
-       env_memset(rdev_loc, 0x00, sizeof(struct remote_device));
+       memset(rdev_loc, 0x00, sizeof(struct remote_device));
        metal_mutex_init(&rdev_loc->lock);
 
        rdev_loc->proc = proc;
@@ -406,9 +407,8 @@ int rpmsg_rdev_create_virtqueues(struct virtio_device *dev, int flags, int nvqs,
                INIT_VRING_ALLOC_INFO(ring_info, vring_table[idx]);
 
                if (rdev->role == RPMSG_REMOTE) {
-                       env_memset((void *)ring_info.phy_addr, 0x00,
-                                  vring_size(vring_table[idx].num_descs,
-                                             vring_table[idx].align));
+                       memset((void *)ring_info.phy_addr, 0x00,
+                              vring_size(vring_table[idx].num_descs, vring_table[idx].align));
                }
 
                status =
@@ -446,7 +446,7 @@ int rpmsg_rdev_create_virtqueues(struct virtio_device *dev, int flags, int nvqs,
                        node.attr = RPMSG_BUFFER_SIZE;
                        node.next = RPMSG_NULL;
 
-                       env_memset(buffer, 0x00, RPMSG_BUFFER_SIZE);
+                       memset(buffer, 0x00, RPMSG_BUFFER_SIZE);
                        status =
                            virtqueue_add_buffer(rdev->rvq, &node, 0, 1,
                                                 buffer);
index 81c2602e6c1be1a717983d58e8e5d01c5df649b9..64501b62e26eee6324bbe1429956406e748a5d7c 100644 (file)
@@ -46,6 +46,7 @@
  *
  *
  **************************************************************************/
+#include <string.h>
 #include "openamp/rpmsg.h"
 
 /* Internal functions */
@@ -155,7 +156,7 @@ struct rpmsg_channel *_rpmsg_create_channel(struct remote_device *rdev,
 
        rp_chnl = env_allocate_memory(sizeof(struct rpmsg_channel));
        if (rp_chnl) {
-               env_memset(rp_chnl, 0x00, sizeof(struct rpmsg_channel));
+               memset(rp_chnl, 0x00, sizeof(struct rpmsg_channel));
                env_strncpy(rp_chnl->name, name, sizeof(rp_chnl->name));
                rp_chnl->src = src;
                rp_chnl->dst = dst;
@@ -230,7 +231,7 @@ struct rpmsg_endpoint *_create_endpoint(struct remote_device *rdev,
        if (!rp_ept) {
                return RPMSG_NULL;
        }
-       env_memset(rp_ept, 0x00, sizeof(struct rpmsg_endpoint));
+       memset(rp_ept, 0x00, sizeof(struct rpmsg_endpoint));
 
        node = env_allocate_memory(sizeof(struct llist));
        if (!node) {
index b9b76de940d20a7c0c62cd60eb26cf3a203569e7..663d1745fd1f9a5078644f1bad8f00f580f24730 100644 (file)
@@ -24,6 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <string.h>
 #include "openamp/virtqueue.h"
 
 /* Prototype for internal functions. */
@@ -80,7 +81,7 @@ int virtqueue_create(struct virtio_device *virt_dev, unsigned short id,
                        return (ERROR_NO_MEM);
                }
 
-               env_memset(vq, 0x00, vq_size);
+               memset(vq, 0x00, vq_size);
 
                vq->vq_dev = virt_dev;
                env_strncpy(vq->vq_name, name, VIRTQUEUE_MAX_NAME_SZ);