From patchwork Wed Jan 18 21:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 45521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2585637wrn; Wed, 18 Jan 2023 14:05:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXuG8dcupWtaDoJPhcJPjh/omYazyO/66CpWCeidiaqNvBNHvWdewLYx0TNiUUFlOOCYoWFl X-Received: by 2002:aa7:82c7:0:b0:58d:a409:297f with SMTP id f7-20020aa782c7000000b0058da409297fmr8543095pfn.4.1674079522685; Wed, 18 Jan 2023 14:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674079522; cv=none; d=google.com; s=arc-20160816; b=dWiCqwQbPDNcPwAF5lB3iy1bDRd/M9DkXBAK0oHtHAeVyDNukSKoV/g1NJyGIovoht BXanW9PSBESa432z+/tQiRmPcCDgqrCPK3xz0z4mUm5WyouEE1JlTySYAKDDuGYob20/ f+dyzp7eeFJBBVts+x53ONa6obBSdavHwCEdVnoZmcH5k1bf9PS50FUuVRoLacEK49FY rniOEUD035iN6tiASakpaV49vzs/P2VS15BkhzUtduLb5tkAl8pFm4YXWoOsYGcrR2/i kE0TFBYgbDY9yKHs2w0/NNa/febRkXE9rUOOexlMHd1YrGtQri1qc9R9nXcmlkVg8QX7 LINA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=ImXWQyU4WFGAYv86tZ8Xzi8aUY2vgULsXE686tIBgtA=; b=xeucCltODsLETbdY+iCp2ppTB8NG/ZlHdd1dHav4LOcoSQrBlxH0Im7Z99Qcg7pN1Q /BMbcjz1wKvYoq6Q5XWbCmFWPBx0sjr80unodlNe7yANWWkkWJzi19+LGmI1RueTOAA4 AmcMIBxgzUJiSKq15ov32CjoU8inrcRqpO/2hRTmgoGSVTw/Jk7u9l/wfKP784dWpn6/ vv4551BIDyEhytLqIZ/eBwqw87Z1i1dQrgb7oO84NpQnBA0UH+JjQaHdUrt8BrI7PbBI czrmfmYJHo4S/IMwGODoNNmpPnoT6cG7U0NrDhRRq7nkjqG04DgvLN7fsa0fQGYFoQh0 PSuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="aqBu6/y8"; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a62790a000000b0057674a6a662si35574306pfc.138.2023.01.18.14.05.09; Wed, 18 Jan 2023 14:05:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="aqBu6/y8"; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbjARVvC (ORCPT + 99 others); Wed, 18 Jan 2023 16:51:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbjARVvA (ORCPT ); Wed, 18 Jan 2023 16:51:00 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 353C7630AF; Wed, 18 Jan 2023 13:50:58 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id DCD3F3F824; Wed, 18 Jan 2023 21:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674078656; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ImXWQyU4WFGAYv86tZ8Xzi8aUY2vgULsXE686tIBgtA=; b=aqBu6/y8+eY7NxuH49S2vhQnojNiXzIIFVXUoWwqh4gQTC/EBxdbk9xbSc9VpUYsGxke+H I4j/1Fe8CJ4hNNrv+izPi93x0VR2Nr4YmUAE5duvZK3xnDSsqplfZP/lORSvCITsvISo5b vI0Nrq88LJgj1V/hOg/QWTM0fuXMkpk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674078656; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ImXWQyU4WFGAYv86tZ8Xzi8aUY2vgULsXE686tIBgtA=; b=wshYCj7T4L0m6eOKuX/ezCn2oMy5WSPFrp+Mx2EJgbAw9tG7KVya4xbzPFwcjcUOLPVyRw PrWMvVbalNRogDBA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) by relay2.suse.de (Postfix) with ESMTP id A99192C141; Wed, 18 Jan 2023 21:50:56 +0000 (UTC) From: Michal Suchanek To: "Erhard F." Cc: Michal Suchanek , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , linuxppc-dev@lists.ozlabs.org, Javier Martinez Canillas , open list , Rob Herring , Thomas Zimmermann , Frank Rowand Subject: [PATCH] of: Fix of platform build on powerpc due to bad of disaply code Date: Wed, 18 Jan 2023 22:50:45 +0100 Message-Id: <20230118215045.5551-1-msuchanek@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230118211305.42e50a4a@yea> References: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755399609663748161?= X-GMAIL-MSGID: =?utf-8?q?1755399609663748161?= The commit 2d681d6a23a1 ("of: Make of framebuffer devices unique") breaks build because of wrong argument to snprintf. That certainly avoids the runtime error but is not the intended outcome. Fixes: 2d681d6a23a1 ("of: Make of framebuffer devices unique") Signed-off-by: Michal Suchanek --- drivers/of/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index f2a5d679a324..e9dd7371f27a 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -564,10 +564,10 @@ static int __init of_platform_default_populate_init(void) } for_each_node_by_type(node, "display") { - char *buf[14]; + char buf[14]; if (!of_get_property(node, "linux,opened", NULL) || node == boot_display) continue; - ret = snprintf(buf, "of-display-%d", display_number++); + ret = snprintf(buf, sizeof(buf), "of-display-%d", display_number++); if (ret >= sizeof(buf)) continue; of_platform_device_create(node, buf, NULL);