From patchwork Thu Feb 2 09:32:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 649901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1DFCC636D4 for ; Thu, 2 Feb 2023 09:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231718AbjBBJdr (ORCPT ); Thu, 2 Feb 2023 04:33:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232115AbjBBJdo (ORCPT ); Thu, 2 Feb 2023 04:33:44 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34ED222A1A for ; Thu, 2 Feb 2023 01:33:17 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id m13so1215434plx.13 for ; Thu, 02 Feb 2023 01:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mLvTiqdVeQuNLqX6XetgQClkA62J66I5SMvrcQs0Rf0=; b=2XOHzynzk4U3u6ifO7GFUgwC6BXN9AkvK+e5OfuXdVbvhnG+wzF3a6TXzI2tWS/vB/ yV4yJa5rPXpSAoGrMEOjmxvkwG0Kt8vcXizpyA2l7/E4b5Vci9AgJqg30/cXP9jV5knf 8+VSET+bN0sjj1TKqJIA9k5bupCldlGtEVKqyeO9/a55BZR27crppO3XH2FeQLdQ0lsh EXJfN3wxtP0jNJ5zcZt+HiZDFyc0XsI1vlUTL5tVPIXQrHh13kg7sdxx4VoFcv4O75fH /1wT52Ji2xyxCn2mi7urI2F/fvO1/wQMPJNQw/bTyZJ5LnaTo3RH2kQ5wbnqE4jvHPNP 9fjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mLvTiqdVeQuNLqX6XetgQClkA62J66I5SMvrcQs0Rf0=; b=JFq2EoIjZ+nx5ocHQ1NMw5W00cdxbxfti1zrLKmjEvmc7yYAbjonEqTHuNHZ/A3BBR LlmKkY2tsKPHecHnjydkNb6cxnqXHbXGkqxLPRiAPXsGuYrXqjqOLkXYeTeQsnDqjFhh 62+thR7BrirZIRXnGMl5ccsx3jEWMEAMCqKveSqNXkL6kIQP1m7rreFRB6iJxAatS3i/ qAjLfJwJopCMXTPFPioW9Vs9GC53YCmSYhKUX73kJm1x2zpmqXw6ysYv3m/aXBw5uxCN wIoe/vCuzxhTKFkQ6csJvk4hC+5VaPA7F1Mwj9SqFRnEL2Gl8l2bGjes976lYx0t/Lo6 C3Vg== X-Gm-Message-State: AO0yUKU4awaFVzT+boUbjwc0nvG4eQ6Rqi2M6mc6yEtXig4hDuma7EXP Mip3tIK9QPR98GTNfhDYQ6Fx2w== X-Google-Smtp-Source: AK7set80oPmJ11Kv4uUsseC+fddoDACFnXK/7wdkTVS9L04sA1zk7sOd8C4EQsmVheptDU1mqbvKkw== X-Received: by 2002:a17:902:ecd0:b0:197:8e8e:f15 with SMTP id a16-20020a170902ecd000b001978e8e0f15mr6852515plh.6.1675330396764; Thu, 02 Feb 2023 01:33:16 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id c10-20020a170902848a00b0019254c19697sm13153343plo.289.2023.02.02.01.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:33:16 -0800 (PST) From: Qi Zheng To: gregkh@linuxfoundation.org, rafael@kernel.org, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, vireshk@kernel.org, nm@ti.com, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org, Qi Zheng Subject: [PATCH 1/3] debugfs: update comment of debugfs_rename() Date: Thu, 2 Feb 2023 17:32:54 +0800 Message-Id: <20230202093256.32458-2-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230202093256.32458-1-zhengqi.arch@bytedance.com> References: <20230202093256.32458-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since commit ff9fb72bc077 ("debugfs: return error values, not NULL") changed return value of debugfs_rename() in error cases from %NULL to %ERR_PTR(-ERROR), the comment of debugfs_rename should also be updated so as not to mislead readers. Signed-off-by: Qi Zheng --- fs/debugfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 2e8e112b1993..58a35afb7c5d 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -802,8 +802,8 @@ EXPORT_SYMBOL_GPL(debugfs_lookup_and_remove); * exist for rename to succeed. * * This function will return a pointer to old_dentry (which is updated to - * reflect renaming) if it succeeds. If an error occurs, %NULL will be - * returned. + * reflect renaming) if it succeeds. If an error occurs, %ERR_PTR(-ERROR) + * will be returned. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned. From patchwork Thu Feb 2 09:32:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 649900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32E49C05027 for ; Thu, 2 Feb 2023 09:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230218AbjBBJe5 (ORCPT ); Thu, 2 Feb 2023 04:34:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232512AbjBBJeW (ORCPT ); Thu, 2 Feb 2023 04:34:22 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B805A3250F for ; Thu, 2 Feb 2023 01:33:22 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id r8so1263834pls.2 for ; Thu, 02 Feb 2023 01:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fM2J8wywmFAkpO23AWoNhmUW5UYZgKdN8YXNnF3yVyM=; b=Wo251TnMqE/xUy53nVYNHNixxFzGh7uMlcDfpYQ+hGF2EY+SJzxpkjwBz48HPc7PdI mCFS238qz28Vl58shnx7iHLNFk04lJSx6DBPVu/g0MdME9NBiPwyf8pcdWn948EQ+b1X 3L4mbybXZoI3HB7ZZ11CWlSWrV874N3enXLiqrQs+JVJQpWroJo70oWsm4M3ixY85h6Y 1V3zFiUAuGXxynacB3GnOZ6Fk43JZUw388DSIibs9r7coNVmhMD43BAonOhmqrwmwsyY kIwSbkbWIdAIBN/o2wG9FPcqHZz+60XzLDiKc1sesKImRjuPrXft04vWwuh90EckuM8P +84Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fM2J8wywmFAkpO23AWoNhmUW5UYZgKdN8YXNnF3yVyM=; b=5rxdNbSD9kfyjnWS1ed3N9gCFR9ZcY7p1l7NPW1hY7iRTSZqN+YVv7KIUoRzB7Np3s WihPWjWSBNIWb/Kr6FyEAMLoSruA/KQb3hd9p5ELqwEi2XPqUXsLw0cJbeE0Coxke/fE DKuYY02Zs57K0kDszWG8NPPuGlGGiNmcUDs1B02Z7sXLtVUKZZSX0mX56rYzndNwOyLw FO5rFDTnDFUAwNO7BpVO24qAkQIg0hNEw7OBcUuNVqmIap9HZ3Kt0XrgSdyhqVpTt5St drb8OSb/ISSaBL7l0VZal7ZUwKaSF84hNI/F2Go7w0GbP0qkxVz3Je/CNzTAzB4Rk46v +mtg== X-Gm-Message-State: AO0yUKWzGrlhAVYrwBbMxAuztNX579ur6C3zPxVZ92GWFDQbFsmnaCTR g0OJPq2c4TOezZvWAhhyIXlHPQ== X-Google-Smtp-Source: AK7set+6yxCwb4C8Sjo5cbMP62x/cHWST+OuLy22i2oHl2I2Ffq042rnTbWnJNsZq82jcV0XES36RQ== X-Received: by 2002:a17:902:cecb:b0:196:86c2:ee89 with SMTP id d11-20020a170902cecb00b0019686c2ee89mr6913134plg.3.1675330402292; Thu, 02 Feb 2023 01:33:22 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id c10-20020a170902848a00b0019254c19697sm13153343plo.289.2023.02.02.01.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:33:21 -0800 (PST) From: Qi Zheng To: gregkh@linuxfoundation.org, rafael@kernel.org, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, vireshk@kernel.org, nm@ti.com, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org, Qi Zheng Subject: [PATCH 2/3] bonding: fix error checking in bond_debug_reregister() Date: Thu, 2 Feb 2023 17:32:55 +0800 Message-Id: <20230202093256.32458-3-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230202093256.32458-1-zhengqi.arch@bytedance.com> References: <20230202093256.32458-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since commit ff9fb72bc077 ("debugfs: return error values, not NULL") changed return value of debugfs_rename() in error cases from %NULL to %ERR_PTR(-ERROR), we should also check error values instead of NULL. Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL") Signed-off-by: Qi Zheng Acked-by: Jay Vosburgh --- drivers/net/bonding/bond_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 4f9b4a18c74c..594094526648 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c @@ -76,7 +76,7 @@ void bond_debug_reregister(struct bonding *bond) d = debugfs_rename(bonding_debug_root, bond->debug_dir, bonding_debug_root, bond->dev->name); - if (d) { + if (!IS_ERR(d)) { bond->debug_dir = d; } else { netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n"); From patchwork Thu Feb 2 09:32:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 650840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A785FC05027 for ; Thu, 2 Feb 2023 09:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232204AbjBBJeB (ORCPT ); Thu, 2 Feb 2023 04:34:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231629AbjBBJd4 (ORCPT ); Thu, 2 Feb 2023 04:33:56 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51BF2709A7 for ; Thu, 2 Feb 2023 01:33:27 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id 88so1349422pjo.3 for ; Thu, 02 Feb 2023 01:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DhKNUmgjGpYYrPtJU+3Ape9Wl8mBEWfEIaYMUi/pVTw=; b=mw4TOMdYWXPbI2rHubabkq3zaX7hILal/BRAJXpRh5alnw8qECyGBtcLGv+obKjD7M TDAa1PqkFMIbAQTM7E3QS+pza33y+QOxEIkANbUPWMphCmJugJ+H6DgHZz0POHvEO1EO FeCfum4nwXBXfR/BTyZm1gYGh1JCnqNaEcE2KXiraB0NyS8sBmCoUpDiyuN9XTQQxRV3 0blkEjnjkGS+mJ6QcKU2VZoCMARSEJFdPF7170DXj52ynrqbd2sUat7+/Z7t6Us0i0QL z7U2F3FRliswGu8GJ9ow/VyWXoU4MPk7qQKHnZh3N5RLsmiJng3U+Gt218kHnONnQajG 2SBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DhKNUmgjGpYYrPtJU+3Ape9Wl8mBEWfEIaYMUi/pVTw=; b=tY/ZKCOIwOJikSzOBu2kN4CRUMlgiqVMEFrR7tqmKryDUJjrbiA1p2mtd96ylh+qdT cCXK1ycfWSQl7md+ErxV6v9dDBBRi4HUYl45wxE2kupjM8KQc8zCAWacn8kSOtMdPGFF xkdArcrrXDlGiF6vv82/fLs8u70NEgyXecgFcVrtglBvw9M2jwG2jjiazctnu4UXIcjh +vsK/LU9gZmm+NiunPPr3/QDIOrGXZOjFO6EX6b6Lcmv8sOt6GMITVAg8htPHykHLsBp 4rZdB11MXv/pS25ywbYWOieCYaakw07yu4ffYCOLLXB11+NvadhBwgs6U6AAF7v225Xp aBSw== X-Gm-Message-State: AO0yUKXfxnprg+i2AEnDWJpzGZUdMRXJLd8RYqHfAokD2i5EUxFl4rru zylE77TCf6ieAtzFhhaao8H5HA== X-Google-Smtp-Source: AK7set82oadZE66vGh1Lw/bvcWQLtS/MGSCNOQm/yiGxA4W0wdTs4YkmnY+vs3+lWP+vTSrXn6L4qA== X-Received: by 2002:a17:902:f68f:b0:196:4d17:2f51 with SMTP id l15-20020a170902f68f00b001964d172f51mr6894727plg.5.1675330406890; Thu, 02 Feb 2023 01:33:26 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id c10-20020a170902848a00b0019254c19697sm13153343plo.289.2023.02.02.01.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:33:26 -0800 (PST) From: Qi Zheng To: gregkh@linuxfoundation.org, rafael@kernel.org, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, vireshk@kernel.org, nm@ti.com, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org, Qi Zheng Subject: [PATCH 3/3] PM/OPP: fix error checking in opp_migrate_dentry() Date: Thu, 2 Feb 2023 17:32:56 +0800 Message-Id: <20230202093256.32458-4-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230202093256.32458-1-zhengqi.arch@bytedance.com> References: <20230202093256.32458-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since commit ff9fb72bc077 ("debugfs: return error values, not NULL") changed return value of debugfs_rename() in error cases from %NULL to %ERR_PTR(-ERROR), we should also check error values instead of NULL. Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL") Signed-off-by: Qi Zheng --- drivers/opp/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c index 96a30a032c5f..2c7fb683441e 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -235,7 +235,7 @@ static void opp_migrate_dentry(struct opp_device *opp_dev, dentry = debugfs_rename(rootdir, opp_dev->dentry, rootdir, opp_table->dentry_name); - if (!dentry) { + if (IS_ERR(dentry)) { dev_err(dev, "%s: Failed to rename link from: %s to %s\n", __func__, dev_name(opp_dev->dev), dev_name(dev)); return;