From nobody Tue Apr 7 06:23:39 2026 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 F2B95C4332F for ; Wed, 12 Oct 2022 10:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbiJLKmo (ORCPT ); Wed, 12 Oct 2022 06:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbiJLKml (ORCPT ); Wed, 12 Oct 2022 06:42:41 -0400 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4D40AB48A7 for ; Wed, 12 Oct 2022 03:42:40 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 431541E80D90; Wed, 12 Oct 2022 18:42:50 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YvdfTgYXwsXf; Wed, 12 Oct 2022 18:42:47 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id A95691E80D32; Wed, 12 Oct 2022 18:42:47 +0800 (CST) From: Li zeming To: jack@suse.com Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] fs: udf: Optimize udf_free_in_core_inode and udf_find_fileset function Date: Wed, 12 Oct 2022 18:42:35 +0800 Message-Id: <20221012104235.3331-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These two functions perform the following optimizations. 1. Delete the type cast of foo pointer. Void * does not need to convert the type. 2. Delete the initialization assignment of bh variable, which is assigned first. Signed-off-by: Li zeming --- fs/udf/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/udf/super.c b/fs/udf/super.c index 4042d9739fb7..06eda8177b5f 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -162,7 +162,7 @@ static void udf_free_in_core_inode(struct inode *inode) =20 static void init_once(void *foo) { - struct udf_inode_info *ei =3D (struct udf_inode_info *)foo; + struct udf_inode_info *ei =3D foo; =20 ei->i_data =3D NULL; inode_init_once(&ei->vfs_inode); @@ -820,7 +820,7 @@ static int udf_find_fileset(struct super_block *sb, struct kernel_lb_addr *fileset, struct kernel_lb_addr *root) { - struct buffer_head *bh =3D NULL; + struct buffer_head *bh; uint16_t ident; int ret; =20 --=20 2.18.2