From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1340AFA372C for ; Fri, 8 Nov 2019 13:12:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C22D12178F for ; Fri, 8 Nov 2019 13:12:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TtoqcO5j"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="RkUIYnXt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C22D12178F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vBp68pmjfKGpkV8QmbI7cxz9OrdM0+ZSRJ0aXdQle+M=; b=TtoqcO5jOYCwGk RQkauhIEiGrGO3rmwLdGWRmvlLNlr7bXqxDNo856PX6dMyIckNG5+zYVlGdRAyP1EKRJVU2XdQRZs z2GdKx8otr2HlnyHd/oZ5aLOYhwBUR3llAWgYD/S8eWrG9sc/I/ThEKaXtglPG+F/ELavTg3IyL9+ ceOTCLDuoz6SCOZ6EGUFqRZRqYDSe9VeB+Zo5uw0NDTCjB6AuAh2BKpBRKQ8aFrfTkdwGqTV4yaJ0 uMj3VJlLHbNc/sVVdPZFRD4nLdNDQLibIm1kJ8zKPdv487ee1OEOMOLx/NNTbSi9ASo++KCo+/v6i ibNa84nWZjPB27/87dOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT44E-0007fw-UW; Fri, 08 Nov 2019 13:12:46 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT3u3-0004nu-B5 for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2019 13:02:17 +0000 Received: by mail-lf1-x142.google.com with SMTP id j14so4394981lfb.8 for ; Fri, 08 Nov 2019 05:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hiVnbA+aLQJgHhafT97yYdRXOf2rz2/qkrRHHeVl/y0=; b=RkUIYnXtYtHoaluers5poWFKyA9z83YZFiREEHR69eo9ytnTPqRk666oOcDh796rt5 W1SjnIiqgz5KNK11xLTj256um9u/k4+/5+8GSUUNS1JotuxHOPV7fZbIa/ZjkUpQA3ac P0TDnhp2ooUva3vHkfByfLzAZyZAhhEcqhIuE= 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=hiVnbA+aLQJgHhafT97yYdRXOf2rz2/qkrRHHeVl/y0=; b=Wn9tEDjssDVL5jjUxRqtZtlkxi8PhZufOY9nwT2smgSEicM4/mVA1K3sBMfWEZfRXP y5XmSvLKPHxg9RMxVEanls7l1E41vJ5OTW/8cSwjSLK6Yyx9xcXoAirAEekHQqcOnnXb jmKXrlRp0pD/qQbhwt3MUssNHOJGDQFxdwAwemIjDVFLC2RrSn1URn1Fd2wUjeAvir0b fhorCppTLx4CaxYtWgIOk97fqUrQX7V0KR1/gEbNi7XiQRkvtdo8a5aOr/wVRb68Xo/7 ZYqvygKYZ3EvtIIxtpsUwl7YwvpX+//w+W+v8rWT/tIdqobey5RbfHoSLbZYEUI+LlpI 4LWg== X-Gm-Message-State: APjAAAXWy2FnTwWMEcGWBbeJbG50+ByoiIpUwQLifh2vNh7x5Qmp0ES6 u6HAbnbvDlhVgQ+o/GLrdo3Lhw== X-Google-Smtp-Source: APXvYqyY1XtYAXaxuUxr5OqGf/UpqCH4S0tKcnokVcpJWs4tNPMtCmYKxFMQ4t+72vh1UpmamXg+gA== X-Received: by 2002:ac2:5635:: with SMTP id b21mr6601913lff.89.1573218133640; Fri, 08 Nov 2019 05:02:13 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id d28sm2454725lfn.33.2019.11.08.05.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 05:02:13 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Subject: [PATCH v4 36/47] soc: fsl: qe: make cpm_muram_free() ignore a negative offset Date: Fri, 8 Nov 2019 14:01:12 +0100 Message-Id: <20191108130123.6839-37-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108130123.6839-1-linux@rasmusvillemoes.dk> References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191108_050215_472711_42C1D85B X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Scott Wood , Rasmus Villemoes , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org This allows one to simplify callers since they can store a negative value as a sentinel to indicate "this was never allocated" (or store the -ENOMEM from an allocation failure) and then call cpm_muram_free() unconditionally. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c index ea9bef1d2c77..4437f4e14d2c 100644 --- a/drivers/soc/fsl/qe/qe_common.c +++ b/drivers/soc/fsl/qe/qe_common.c @@ -176,6 +176,9 @@ void cpm_muram_free(s32 offset) int size; struct muram_block *tmp; + if (offset < 0) + return; + size = 0; spin_lock_irqsave(&cpm_muram_lock, flags); list_for_each_entry(tmp, &muram_block_list, head) { -- 2.23.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel