Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1651670rwd; Tue, 16 May 2023 22:25:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sbnb2hAb7LkimSCZhSUiAhjHppQu1HmKCzdHIvHXprJt1ktziYCR1nqoaoY0QunHzyMf0 X-Received: by 2002:a05:6a00:24c4:b0:643:90ee:56f with SMTP id d4-20020a056a0024c400b0064390ee056fmr1791115pfv.1.1684301112779; Tue, 16 May 2023 22:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684301112; cv=none; d=google.com; s=arc-20160816; b=gtDWw5e9msvA6BHqbi6O+LFev9e7M9ZyLPfEcu4V/bpNIMESoIMO7YWtBzjOsFDz+s 6Aivwo/VG5+wUezZ9BrAr2VQ0FGf5+sN+MqgmgqOs5FgTcDmJoX7T9taUXCNTSuy+K9O bUNaqk8ARQIhObyEzgjmLzxoTRlHBy5tEYj1ChJHV2k1z11eWvDCF+qS0rjJu4Q8tUNy pfL7SUymAvjnX4OlFxGTl400k7YZHchlRVzivnb1sIDHIUlf6tUPV+byGD7kRf2USCLi FS2YzKbIhi2aeLpEd04gp81PTA7qncPcWrNbccTRjg1F/tUCPdeouVlSLE+bbbozJFMp qm9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:cc:to:content-language:subject :user-agent:mime-version:date:message-id; bh=TZjVwSeEKzfpI+FRNv5z9D+EiOVlEz/pZ2ICUSoVo1s=; b=mjbfwzO1A6HZlJfOUfDrgOkcESKJp5e6QQXhkOgoF4gunkM+gvQx0gP/juqeREfQhP ieh4NATibaeIyRAyniF04K1bHvuTugL19p+AVXHYzWe/Ac5arHtt3AeAzH6xr5k1DlLr RjpcJtiq6f9g+V2G7UWCMfLg+fTyrHBfAQwn3RHPRdexfrClm5zjamzT6wHMFkiJFX6l Rk4k7tLmYd8Jvg5M1118zDpganT0GZuxERN2PFK3X17YcwcANOJ7lM6CZ21wav8vbfx0 +yqSyGsuCrJ5wutM3xSI9f7XoCwN/Zp51wJ97x6GG/zillJAirgBFfzXIqGIFF6zwTh1 b0Iw== 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 w16-20020a639350000000b0050be067284bsi19642400pgm.556.2023.05.16.22.25.00; Tue, 16 May 2023 22:25:12 -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 S232119AbjEQFOc (ORCPT + 99 others); Wed, 17 May 2023 01:14:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjEQFOb (ORCPT ); Wed, 17 May 2023 01:14:31 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 87D8C35A8; Tue, 16 May 2023 22:14:28 -0700 (PDT) Received: from [172.30.38.111] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 36E23180120DC3; Wed, 17 May 2023 13:14:12 +0800 (CST) Content-Type: multipart/mixed; boundary="------------6RiRB9aWvOzrHmmlk1Za6Ipu" Message-ID: Date: Wed, 17 May 2023 13:14:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH net-next] net: bna: bnad: Remove unnecessary (void*) conversions Content-Language: en-US To: Jakub Kicinski Cc: rmody@marvell.com, skalluru@marvell.com, GR-Linux-NIC-Dev@marvell.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org X-MD-Sfrom: yunchuan@nfschina.com X-MD-SrcIP: 180.167.10.98 From: yunchuan In-Reply-To: <20230516201739.21c37850@kernel.org> X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 This is a multi-part message in MIME format. --------------6RiRB9aWvOzrHmmlk1Za6Ipu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2023/5/17 11:17, Jakub Kicinski 写道: > On Wed, 17 May 2023 10:27:05 +0800 wuych wrote: >> Pointer variables of void * type do not require type cast. > What tool are you using to find these. > How many of such patches will it take to clean up the entire tree? I use the scripts I found on the  kernel Newbies to find these. website: https://kernelnewbies.org/KernelJanitors/Todo/VoidPointerConvs --------------6RiRB9aWvOzrHmmlk1Za6Ipu Content-Type: application/x-perl; name="type-convs.pl" Content-Disposition: attachment; filename="type-convs.pl" Content-Transfer-Encoding: 7bit #!/usr/bin/perl # This scripts goes through the kernel sources and # prints assignments of (void*) functions that # get type-changed: # type *x = (type*) function(). # The first argument is the kernel source directory, additional # arguments override the embedded function name list. $kernel_dir=shift || die "Need a directory argument (kernel sources),\n" . "and optionally function names.\n" . "If none are given, a default list is taken.\n"; # Get source files @ARGV=split(/\0/, `find "$kernel_dir" -type f -iname "*.c" -print0`); die "No sources found.\n" unless @ARGV; # Read whole files, and look for such assignments. $/=undef; while (<>) { $changes=0; # - struct netdev_private *np = (struct netdev_private *)dev->priv; # + struct netdev_private *np = dev->priv; # or just # lp = (struct i596_private *) dev->priv; $changes++ while s{ ( (?: struct \s+ \w+ \s* \* \s*)? \w+ \s+ = ) \s* \( [\w\s\*]+ \* \s* \) \s* ( \w+ \s* -> \s* priv(?:ate)? \s* ; ) }{$1 $2}xgo; if ($changes) { open(DIFF, qq(| diff -up --label "$ARGV" "$ARGV" --label "$ARGV" -)) || die "Cannot start diff program: $!\n"; print DIFF $_; close DIFF; } } --------------6RiRB9aWvOzrHmmlk1Za6Ipu--