Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp226500rwi; Wed, 12 Oct 2022 19:10:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GasaZtzQg/6ECuMZesIjG+YbW7k4J7B6Y+HfMzk7Jnny1c6EoOs1rVuIX1ruuyAk81fFB X-Received: by 2002:a17:906:fd84:b0:730:acee:d067 with SMTP id xa4-20020a170906fd8400b00730aceed067mr25138415ejb.206.1665627002950; Wed, 12 Oct 2022 19:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665627002; cv=none; d=google.com; s=arc-20160816; b=zMisOyW10nUzt0h9iUd5bTr1zE9svvueZ3S6cEh7LlVfup3xknAVHuBX+6bFTGfzjd Lk1+22hZ2W73FcrR79IUwok5Z5JHqGyXN6LbAcFQq/nUs1P6vfucze90OEELIl63eNFo /CnfIr2KmJ/4XBKCWIcMpuUAzy/fzuTqq+K3iSvUY2x8MK2/jwv7piL1Li8n67fqnVa3 SJ6p6bFaS08iU9MVDQyFEw59RHNbEPJPiGGvDrUYM5b58khx2ygZLJ0F32BLT+xp7I0d fPd2MFy8O/+qmbnZPkiEQczCnZIUFFmeRDV+P/aSj8Wj+uOpCL3ZsmaaQ6mGaa5rOuA+ sBwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from; bh=A5x8wdhAsf4AedPyKcPV7W2zsdmZRjimIVzXyMAW1Ng=; b=jOe6UNJHUebmx2ulrnLoeDjhjEzIFaN7f8dwNfLxBZ9RZAigtZ+aAZQKK9+iD+kt+H y4X9Zx+77rf9v7xRGZSgpv7mtbfAvJd8/gqaCFNUxXUdC0a19S84AkvWHNiQuNrt9Hqf 5s2Q0bzH6HyxfrGZdjDZfIOQapp9aCV8hmSTjjdje0zfANTRzeVHyvNb+0W6oWkJsZP2 hPbX+aVLqvCHiRiG5fRNv5fz0VBNERfZYxmaDKrU6jtE036qsxLHZeW9nLGQFYn94Be9 UFoWGfQYr6Onq/EbnAKHZij0LwLPJgM/fc7o4zaXb+BTukABCrjfIhpRcZdgmtNKX2Hn 3wbA== 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 kx1-20020a170907774100b00787b0b0a96esi15842944ejc.131.2022.10.12.19.09.37; Wed, 12 Oct 2022 19:10:02 -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 S229827AbiJMCCE (ORCPT + 99 others); Wed, 12 Oct 2022 22:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbiJMCCC (ORCPT ); Wed, 12 Oct 2022 22:02:02 -0400 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 31E8A11C6CB; Wed, 12 Oct 2022 19:02:01 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 8135D1E80D9D; Thu, 13 Oct 2022 10:02:05 +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 mgpnUz1xtQkV; Thu, 13 Oct 2022 10:02:02 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: kunyu@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 6BC2B1E80D9C; Thu, 13 Oct 2022 10:02:02 +0800 (CST) From: Li kunyu To: skhan@linuxfoundation.org Cc: kunyu@nfschina.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, ray.huang@amd.com, shuah@kernel.org, trenn@suse.com Subject: Re: [PATCH] power: cpupower: utils: Optimize print_online_cpus and print_offline_cpus function Date: Thu, 13 Oct 2022 10:01:20 +0800 Message-Id: <20221013020121.2874-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <14d690a4-d2d5-01db-b2a2-e3c87b4a6394@linuxfoundation.org> References: <14d690a4-d2d5-01db-b2a2-e3c87b4a6394@linuxfoundation.org> Reply-To: "Re:[PATCH]"@lists.nfsmail.com, "power:cpupower:utils:Optimize"@lists.nfsmail.com, print_online_cpus@lists.nfsmail.com, and@lists.nfsmail.com, print_offline_cpus@lists.nfsmail.com, function@lists.nfsmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 I'm glad to get your reply. In previous tests, it was found that variable initialization and assignment use mov related instructions. Therefore, when I analyze the code and find that removing some variable initialization and assignment does not affect the function and security, I will try to remove variable initialization. Find the malloc function and find that its return value is void * type, so it does not need to cast. thanks, kunyu