From patchwork Sun Jan 12 19:06:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1221849 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=OiWxipoH; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47wmWG4Y9lz9s4Y for ; Mon, 13 Jan 2020 06:10:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC31281810; Sun, 12 Jan 2020 20:07:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OiWxipoH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D5CE817E4; Sun, 12 Jan 2020 20:07:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 12E0E804C1 for ; Sun, 12 Jan 2020 20:07:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id c4so6057489ilo.7 for ; Sun, 12 Jan 2020 11:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6EYaTjAE64w8mvdR0XfFCfDMwmj6XX69/XbntLh64fc=; b=OiWxipoH0N8qIKENnB5McNxYoAlG0PjFT1qmLA4aCUWW/Tv9G1xODxesuqPy+e7QCX LiSp0KAFdkAyBSL1l1J6ersIQoaF1NAkJPAD85OvNiTS5LRMnvd2az+h+h2pub72ArQ4 NmaTcKDA8gp4H1MQUgchzvCoNB5RaHknSFwDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6EYaTjAE64w8mvdR0XfFCfDMwmj6XX69/XbntLh64fc=; b=gwRevxUWBHRU2If4oVpa+O7xb1C2KCA1yOdlsmrQce2ge+CxN3CEgw77k6983LS+WZ BhkZmZefU72B7vFIYmOuCkM6OegnXkmnUzZRBNVrqGyDfIL5aSOcI2BpM8d+RFOS0kK/ m/7pjpuDZsKTjlzJBuxKtGJ87ZkzG63MOmEr5VPlEsBEUGv6vu2xvgFoe9LUyHeZ/6zO GIun31xRX8zR72lUOwF2pbULBBq33bB8hfD9dNFdF29vra56mkC0EsQotROIYey+C7P+ vgkN7hWwMmzOjB3RyACGSitkxTp/8zyGtkcbaouhv0otsm6YBFSDKquBx45fgrjC5Jdc QEJA== X-Gm-Message-State: APjAAAXiATHvTjVSND99nKXJOiiTXzTAfXoUcDHd2g9iIlIlLJSeKTfE /eaiZM7E9gYBs9CsO+iBEEKl4g1UeAM= X-Google-Smtp-Source: APXvYqyHOsWnIFTbnaqTN0ZT7Kx1iYWXU1kjkM9/296q8xinyhGz0bJFzIsnPVsJzrXi47bbor22Pw== X-Received: by 2002:a92:2804:: with SMTP id l4mr11717667ilf.136.1578856039865; Sun, 12 Jan 2020 11:07:19 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id r22sm3039219ilb.25.2020.01.12.11.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 11:07:19 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 17/33] sandbox: Drop os_realloc() Date: Sun, 12 Jan 2020 12:06:08 -0700 Message-Id: <20200112120216.17.Id99b268986b5d9470d1932ae752c857d52c9b123@changeid> X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog In-Reply-To: <20200112190624.79077-1-sjg@chromium.org> References: <20200112190624.79077-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heinrich Schuchardt Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Due to recent changes this function is no-longer used. Drop it. Signed-off-by: Simon Glass --- arch/sandbox/cpu/os.c | 23 ----------------------- include/os.h | 22 +--------------------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index d5e5b561b6..60011f7abc 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -238,29 +238,6 @@ void os_free(void *ptr) } } -void *os_realloc(void *ptr, size_t length) -{ - int page_size = getpagesize(); - struct os_mem_hdr *hdr; - void *buf = NULL; - - if (length) { - buf = os_malloc(length); - if (!buf) - return buf; - if (ptr) { - hdr = ptr - page_size; - if (length > hdr->length) - length = hdr->length; - memcpy(buf, ptr, length); - } - } - if (ptr) - os_free(ptr); - - return buf; -} - void os_usleep(unsigned long usec) { usleep(usec); diff --git a/include/os.h b/include/os.h index 7a4f78b9b1..1874ae674f 100644 --- a/include/os.h +++ b/include/os.h @@ -119,7 +119,7 @@ void os_fd_restore(void); void *os_malloc(size_t length); /** - * Free memory previous allocated with os_malloc()/os_realloc() + * Free memory previous allocated with os_malloc() * * This returns the memory to the OS. * @@ -127,26 +127,6 @@ void *os_malloc(size_t length); */ void os_free(void *ptr); -/** - * Reallocate previously-allocated memory to increase/decrease space - * - * This works in a similar way to the C library realloc() function. If - * length is 0, then ptr is freed. Otherwise the space used by ptr is - * expanded or reduced depending on whether length is larger or smaller - * than before. - * - * If ptr is NULL, then this is similar to calling os_malloc(). - * - * This function may need to move the memory block to make room for any - * extra space, in which case the new pointer is returned. - * - * \param ptr Pointer to memory block to reallocate - * \param length New length for memory block - * \return pointer to new memory block, or NULL on failure or if length - * is 0. - */ -void *os_realloc(void *ptr, size_t length); - /** * Access to the usleep function of the os *