Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3702621pxb; Mon, 24 Jan 2022 15:48:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw055BbP7aVTF2/dfnGPe5h7tFPnipt8vybezHf6hdKFvIS76Yn2SEDhbd+6xkcoYltmzBQ X-Received: by 2002:a17:902:b105:b0:14a:b4c8:2ac7 with SMTP id q5-20020a170902b10500b0014ab4c82ac7mr16110725plr.148.1643068132372; Mon, 24 Jan 2022 15:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068132; cv=none; d=google.com; s=arc-20160816; b=LqGEUL/+jUieN7+O+OHzPI1EcOosijpxz3NS+jiIVwQ4TrCd+tdyisEYgnD2yEbCsi z7J6NvRivGfXne/4u6MfHTPr6VJAfwK0WFK3ykDqOJP7LGyNXfeb6zaIt+6znCAcdQ/h vDUf55jIyLV4YO0MempKYt3VCleSKjL0zvyjvN7hvFNQH/YdxUcrfSiwW8FKvfC8RL9+ pk0JpBgXPklfXBVrsG662Q+DkTOTrrSPqjkw75LL1r5aQHBvzvf1lu1xY1mASDsNbxr8 dm5H/YIAYotgIlaTFiAVGnWyNX9n3ogz94gHMz7/L4OeHlYYtvYErnzXM+LOQ5uVhrOH jQeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aFEMvSxwTl3WOyRcRZms/GCFIrHKnvmY0aGw5p3P+H4=; b=GFLJXlEt5+l3FXABPoWqfLJSXkD4BumhzahDg1Jvj4GeOsiNCCBCXGCmBNbE97ECHg 5w9Z4j7tsfWfRAZpxXHOyuhPj+6l8J7R48uymO4aA2JHcZYe+cSAjDHogvELc/8fX8Ah Dz08aA35Lw6XV1H0PSDxfKU5j17nlk/n7xLOaAR8H9vR9pjw4GL3Rz+NwtNEVj/BMOXo dAVs1SncCk8fKOEEBmMay017+gdUHlk4JOWvqdKgi8Q9ad1P5sKbnLIsL3t2eWIrbQ8Z TwMW/d2D9YiK22giHaRnYTQ7F82QMf5FgjJqp+YJTUSGNPj6JxL349nqdKyErqXVsHsr Sdjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vn3F6ntY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si396364plg.520.2022.01.24.15.48.40; Mon, 24 Jan 2022 15:48:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vn3F6ntY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2362770AbiAXXmx (ORCPT + 99 others); Mon, 24 Jan 2022 18:42:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1844102AbiAXXHv (ORCPT ); Mon, 24 Jan 2022 18:07:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1185FC09F48C; Mon, 24 Jan 2022 13:17:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A3ACB614B4; Mon, 24 Jan 2022 21:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B9ECC340E4; Mon, 24 Jan 2022 21:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059045; bh=Qv3AXBJypUQEhcu/HM/kLS35NH/SfK+kss7qkpXJK+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vn3F6ntYNT0iAziCVwH0js4Me2P7G+0rRVtFUm4T1/8kSJAv2x8aIxfOgPIzoUKjn pzxgRPU98DbENNHdsfB8Zvm1uV51ZB0s+DX3izIXIWUDQ8yEDuSxSsl6auA2nzRNYP p4mKtcqWNFewsXRpW9sIp+qkSKxSSJFdWyIqeQsA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Jim Quinlan , Christoph Hellwig , Frank Rowand , Florian Fainelli , Rob Herring , Sasha Levin Subject: [PATCH 5.16 0487/1039] of: unittest: fix warning on PowerPC frame size warning Date: Mon, 24 Jan 2022 19:37:56 +0100 Message-Id: <20220124184141.643180859@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jim Quinlan [ Upstream commit a8d61a9112ad0c9216ab45d050991e07bc4f3408 ] The struct device variable "dev_bogus" was triggering this warning on a PowerPC build: drivers/of/unittest.c: In function 'of_unittest_dma_ranges_one.constprop': [...] >> The frame size of 1424 bytes is larger than 1024 bytes [-Wframe-larger-than=] This variable is now dynamically allocated. Fixes: e0d072782c734 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") Reported-by: kernel test robot Signed-off-by: Jim Quinlan Reviewed-by: Christoph Hellwig Reviewed-by: Frank Rowand Reviewed-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211210184636.7273-2-jim2101024@gmail.com Signed-off-by: Sasha Levin --- drivers/of/unittest.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 481ba8682ebf4..02c5cd06ad19c 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -911,11 +911,18 @@ static void __init of_unittest_dma_ranges_one(const char *path, if (!rc) { phys_addr_t paddr; dma_addr_t dma_addr; - struct device dev_bogus; + struct device *dev_bogus; - dev_bogus.dma_range_map = map; - paddr = dma_to_phys(&dev_bogus, expect_dma_addr); - dma_addr = phys_to_dma(&dev_bogus, expect_paddr); + dev_bogus = kzalloc(sizeof(struct device), GFP_KERNEL); + if (!dev_bogus) { + unittest(0, "kzalloc() failed\n"); + kfree(map); + return; + } + + dev_bogus->dma_range_map = map; + paddr = dma_to_phys(dev_bogus, expect_dma_addr); + dma_addr = phys_to_dma(dev_bogus, expect_paddr); unittest(paddr == expect_paddr, "of_dma_get_range: wrong phys addr %pap (expecting %llx) on node %pOF\n", @@ -925,6 +932,7 @@ static void __init of_unittest_dma_ranges_one(const char *path, &dma_addr, expect_dma_addr, np); kfree(map); + kfree(dev_bogus); } of_node_put(np); #endif -- 2.34.1