Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3557748rwi; Wed, 12 Oct 2022 03:57:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BYPYGGXo7sfzV6MpsTjWYWU9tCLQVOolMpbLCHnOvKpz7c64JsaJpPes/Xd8BIF/DkKzv X-Received: by 2002:a17:902:da81:b0:178:1d8b:6cb4 with SMTP id j1-20020a170902da8100b001781d8b6cb4mr30051967plx.43.1665572221051; Wed, 12 Oct 2022 03:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665572221; cv=none; d=google.com; s=arc-20160816; b=WEbFJs6R5gWt7f3B2Y6QejSEUF7mJDtIeL2GofvP9dHgG+5SdobE/QwjWUCyswpJy6 p98YOIja008v9BA5J/XGzktVFfxs65iMtZGugq6R/OkY2dnXvt5OtOXC5KD8quShr1WG ol1pu5DPdwo1XXGZ4arb+3MbHQ9IwDprys8xQKcCzdePZpIYZCEBJ2IHIsH3GN6BJWaS HwOL6jE0ZNWf3kJGYWkJHgXzmay1ZeBDruCDwUcF7dEiyFdATFbNZDQO0GLSSaHFnEMF dEMqnh3RRWyCd96KPIz0QMffZ014MNoerhrJvyzpTM92sxmCyikE7GoMEVnAIuRDGe+F gKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=ZRunQ++AeLo++vD4e9q1nEeE5LS5je1YvpyZHwRnIZI=; b=jGX1U3AxbU0/D96Hz7ZR9r+FRxASK8F8ULExB4ynB6Yi4WmNzZFkSDSklFceacGXCB 7f/3SIuAbQpTTc/nG6CMjXPSaODpVMdMc9w8tXNo9QQvNmO4Sw5iFu+C5Rn1SjgwrPSh /TVPq22JDUK/9QEODsXGNoOBnhq4FxciavloRAdRp8UlgQh8aX85efpMMMW036IZ6vFm bVF1YvDr6kQ2nE5mb6gRAlhJcAw2oVDcmHrmDn5aKjkWU7VHPz4T/wgJ/wsj5XgtacTL SbQS2J1gOo7301gDIp/++sbCspfhGBLoa/VBEJCjYeoEL5YoDgOHZNnfmV6nWnHqxdRT NaVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 206-20020a6301d7000000b0045f8411933bsi16813702pgb.866.2022.10.12.03.56.48; Wed, 12 Oct 2022 03:57:01 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbiJLKmn (ORCPT + 99 others); Wed, 12 Oct 2022 06:42:43 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 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) static void init_once(void *foo) { - struct udf_inode_info *ei = (struct udf_inode_info *)foo; + struct udf_inode_info *ei = foo; ei->i_data = 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 = NULL; + struct buffer_head *bh; uint16_t ident; int ret; -- 2.18.2