Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1381283lqm; Thu, 2 May 2024 13:01:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX76Z57Ab7cQPXJgMsok86honuPf5zNazBUj3R3eFNYgkBLuAVikF/18r+K5Xx/LO9EywjNe2FKvjeQwm7cxVhVVNu786uh4P/0vd2DcA== X-Google-Smtp-Source: AGHT+IFEozwUpFf/EvN6ANWd5ZbNgN6x88siytbtJM3BCiA3BFFPkhaTuuzO7Cy45sINNj3jXK0P X-Received: by 2002:a17:906:f0cd:b0:a59:6e53:e64 with SMTP id dk13-20020a170906f0cd00b00a596e530e64mr276360ejb.12.1714680087381; Thu, 02 May 2024 13:01:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714680087; cv=pass; d=google.com; s=arc-20160816; b=Q1aCjzXAVY1ROP2PmSsHYpHj3wM6dfNDPchdul/tBAo1EqGL5q5wWc4gkEVX2SObX4 tNCrMNhYu8tXUdudmKjOxx43jsU4iNEP2WoBZRLtlciC1ijT+SFlBvkQqWjDrfRGh8TZ qM96xbIXj15xwRcFA14qTa2CSrw6wa0gmyoEoBeBSjk4MLPWLsuxEcmoJT01N2a5cKJW hZ3ZAPczadkvOpuhS8Eg02HaIktqb6mbOE45WWxvX+vOlNKfmYWLdfpYr++FAN0SmTbA ut3kZeDr+xFASa5GUg2Npbzp/sVSHEG+y7z4/PVjJvVAOZL1qUOgxU+1ZyEGk6a+UiLd uBFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=uaz8rW2sq3u4mWnq4w7bNSJ13vyEsIaZonXWAGwzYCs=; fh=qCpGG0+znY9o6//JEkiariERrNGkli2fS/JlEB/I1T0=; b=czf3bg68eD7jg6biBV2/Ra4S6xo8AacYN+7qAFyPOITREoblee86cdJr+T3sV6Q5fK +zdW9i/vqk57kuF5ztIoroqdWfAjxBN1MVG+KX4E5TLXYh9EUgT2gEX27+i7VdASsvFg huAKNSG8KZTK1AiGr4j86fhB56AUhNBAA1LoWUc7Frb2jlDERkTTf6r4CTF1Fv9daBaj yAI2HwVAMDU4RuU+hJdRroCSPC6qkdqf1U6nGxD4LhzGUL3cmkMbWOaiK5ZLS3yK/Qa0 VQEiVBwAJJoLLDQ1u7byCae9kQfxtL1Tj/35DM5QlWXGDTQYKb6y6Lx/zmoCVi5X8/2t BqEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=e95T3MQ+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-166875-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166875-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a23-20020a170906191700b00a55ac7bdf54si556295eje.842.2024.05.02.13.01.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 13:01:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166875-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=e95T3MQ+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-166875-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166875-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2116B1F21F76 for ; Thu, 2 May 2024 20:01:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 134521802C4; Thu, 2 May 2024 20:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e95T3MQ+" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB95442AB6; Thu, 2 May 2024 20:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714680080; cv=none; b=CB8OL6Ko5SoJ5nhyl1iRTUFLK/x4qLCof9mVp0aeiDyAum2wA/+VMiXAkWnAm5XqmJUA8PIajKH38tV/94Ea465nnRRDCSqRpNRT3uYv0lKmJXOEoAxHrbmZ8M+EEZWtEfS5ZYOJkDxAOzaMdHJQOWPt71LY/E3ux+srHkf8G/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714680080; c=relaxed/simple; bh=rTBDgCqzm9I1eNIhz2jjJ+hF2kv0hFIJO1QBgNYCLzQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=fmF/8bQZlZObpKwiJYF75sCMGYas54SexWgfL3HNVBpiiJWxT+CRTwZL2NyzvH4FyRT9jao4Jf7uWhilL/eVnqCJ/rNU8Sq4oghLp0hgw6bzTtD9H6hkFefyxogp8g42Mj2/sQ6u4x6iT24cwuGxbG3glMPNPcz5hzRtwhdtjuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=e95T3MQ+; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1eab16dcfd8so72687255ad.0; Thu, 02 May 2024 13:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714680078; x=1715284878; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=uaz8rW2sq3u4mWnq4w7bNSJ13vyEsIaZonXWAGwzYCs=; b=e95T3MQ+LQ9CYNyuyd/nfwMfPVgORSFWEnzXbiwxX+NUXZAZyqsSejrgiCPXLdJvU7 lWmZ9t4nyg2lWZ830keQ6UzrGOETWzWhUYi/5RbmCfXpgPkkcMnVb4ZtcJTYuCnyEAe5 /ZWA61cV8hY17Cqn7rECASpt2j10qHPBs2iLVpM99EOrU+B+zrCXnYWOnJtOuj5aZLfQ cDVIGvORh0NTR7FSNKizwcBFacdO+3uINRR3fsNHODu8UWTByTD59xfID9c0ff3VKdrQ 7wTukWuiuWl7vmJjV1NR7JA/MmUZJ9JAaRnhFLWzy2VO/AuCwb7WX5ulIjYqYxVmEuIA FUXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714680078; x=1715284878; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uaz8rW2sq3u4mWnq4w7bNSJ13vyEsIaZonXWAGwzYCs=; b=pK7jIJcE/G9wDenNsyONG9HhlNJF2LspQ65kof1g8A1ZFPOqZYKGTSM9c+0byxogRH 1lw8PF+OqSZjDi+OlLqGW0Iw/SM2u7jfDVOsA4jncCLnkPohPoL//xLGf1wvG++yAUq9 gBfxWeZkJ45SpzOm2koW5pMYGN5R4M5mIJQ98anYK4WvKiASvc6JIi9HCfaBUfLtsCIY +1+WwltWCb2TkE9jg2m10yijculxJyElcSoMCHDzIpfceuBfikp5hthSLL0dY8KCNA1P juRukRf91krul0Af5WqfEZ4Ov6cEGBHcIp74rpFQwgkBBNAGUBmcdq4529UvsZcwO4k+ MYEQ== X-Forwarded-Encrypted: i=1; AJvYcCUjOBdk5E4WFvsyxiwXVuJqSJXVvlugOaLrRe62tAw0/EigSzJ9qaNoUs70vNgucwcmYrwzcMvxGLSdSa2ek1iXE5KhpBQQsAy3M5/D X-Gm-Message-State: AOJu0YzZ9ctdXcHEWvZw7kEZYkQ/aXH2fBOZ9DWzGXbC7g7QGP7joKku O+5kVhNLlo2r42cFa4OGzvkCZQTonGcmog6oQN7Vh/nyU+xwaSgVhsyhTBYl X-Received: by 2002:a17:903:246:b0:1e5:d021:cf02 with SMTP id j6-20020a170903024600b001e5d021cf02mr870737plh.36.1714680077654; Thu, 02 May 2024 13:01:17 -0700 (PDT) Received: from localhost ([115.96.207.161]) by smtp.gmail.com with ESMTPSA id i16-20020a170902c95000b001ecc3a62b7esm1732757pla.45.2024.05.02.13.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 13:01:17 -0700 (PDT) Date: Fri, 3 May 2024 01:30:11 +0530 From: Aryabhatta Dey To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: deller@gmx.de, tzimmermann@suse.de, sam@ravnborg.org, christophe.jaillet@wanadoo.fr, javier.carrasco.cruz@gmail.com, skhan@linuxfoundation.org Subject: [PATCH] Remove of_node_put from drivers/video/fbdev/offb.c Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Add __free(device_node) to the declaration of the pointer pointing to the pci parent. This change replaces the manual clean up done by of_node_put() with scope based memory management. Signed-off-by: Aryabhatta Dey Suggested-by: Julia Lawall --- drivers/video/fbdev/offb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index b421b46d88ef..ea38a260774b 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -357,7 +357,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp par->cmap_type = cmap_gxt2000; } else if (of_node_name_prefix(dp, "vga,Display-")) { /* Look for AVIVO initialized by SLOF */ - struct device_node *pciparent = of_get_parent(dp); + struct device_node *pciparent __free(device_node) = of_get_parent(dp); const u32 *vid, *did; vid = of_get_property(pciparent, "vendor-id", NULL); did = of_get_property(pciparent, "device-id", NULL); @@ -369,7 +369,6 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp if (par->cmap_adr) par->cmap_type = cmap_avivo; } - of_node_put(pciparent); } else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) { #ifdef __BIG_ENDIAN const __be32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 }; -- 2.44.0