Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3603455pxb; Mon, 24 Jan 2022 13:17:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWFu9AaALJiI+2Q87I2J/J3nMlzy1+aLww1S8dLprz316uYKv/DFSGyClPYo9QrXV7UT87 X-Received: by 2002:a17:902:aa8f:b0:149:7898:af96 with SMTP id d15-20020a170902aa8f00b001497898af96mr15837831plr.161.1643059059869; Mon, 24 Jan 2022 13:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059059; cv=none; d=google.com; s=arc-20160816; b=T2Dg9dQpbApJv3cOtEWTG4+1aq159PGSnIJY+2nbi1IcRdzaV/+cUiitLFFSvw4SLq D34frKWqekfqj7dY9Gb1J8rLTBCLNobNpxOLCcvONRZ+MUFkDoGrM0l0G260fCG9G++G sTy4E31vI8bl+Q6avN13d5Lr+4YdnPHwI8j1TjA3PKi99oM7evMcF6q2AztjGfDz96UH FinCMv9XcvsTnMSL9LSM45swl9BhhyogGGsRbQfWvuoW75obUx1ciVJcMnk98MZZ6Jzc I9w1qc0b+F54WAepIvw93W74vX5wfwk7GwlDsEx+M90D3RAlwuH3/DHyxPKjZniqugcz hd9g== 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=6P24+/gkYnyQGYfY7b6KLRCjCWFFxSp7CzuvZIsqqLI=; b=OMScsVt/OqueP0dZK/V63v7LmUREZAo8nJ9A1k6Kwb97ByVySkHwJl7IfGUUmfhtcP JpI+GsPkQ6q9/f0vPXk3rtmHi+q6Z4fcDi26Lk3j+MdifhOVlkLQaLp64BQQYCW5aOeR sf/kGJSIO96X0FqxVaFC5SObSDKCk8HHXhjPW4tLeDorx/inGSHRIIHvZdUxePrUJ8P3 eoyzdOZoZFIsrQWYC4AJRzmw1J8tB9nLVtr3+zNI4gZpC0yvUdOfgckrZpQjlJwXX/I9 UF3lWPt8genszokRHnatQl1FTSpG7YFndY4NTteKiN2fEPvOJ5qBRaWrhHSW1Q7lhkzc mL5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PHRVMFte; 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 a198si3195644pfa.139.2022.01.24.13.17.27; Mon, 24 Jan 2022 13:17:39 -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=PHRVMFte; 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 S1358929AbiAXUxD (ORCPT + 99 others); Mon, 24 Jan 2022 15:53:03 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:36204 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384721AbiAXUa0 (ORCPT ); Mon, 24 Jan 2022 15:30:26 -0500 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 ams.source.kernel.org (Postfix) with ESMTPS id 3C37BB8122D; Mon, 24 Jan 2022 20:30:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EDDFC340E5; Mon, 24 Jan 2022 20:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056224; bh=03Wqyse5WbMn58IU7wn8cQE9JWvTPxZxaYwH/cNb67A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PHRVMFtep2t1qpDp5W8ue1yHw0Y7wm0/ZXOi46+sJRPB9XQkul6vSmacwoPMS5Dbv cJAqgXr64x/D5WMdYfkOyo+xUSqorO4uQBJfaEFUp9EavSKLute+TyOHJvXf1Uo0n+ 4xYrwimmu3nbr5fihXU9bRUhTo9fVPTM6b+tv24o= 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.15 413/846] of: unittest: fix warning on PowerPC frame size warning Date: Mon, 24 Jan 2022 19:38:50 +0100 Message-Id: <20220124184115.216029653@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 5b85a2a3792ae..242381568f13c 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