From mboxrd@z Thu Jan 1 00:00:00 1970 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 6E63EC00140 for ; Mon, 15 Aug 2022 15:04:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232492AbiHOPEq (ORCPT ); Mon, 15 Aug 2022 11:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbiHOPEn (ORCPT ); Mon, 15 Aug 2022 11:04:43 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF8B81EAF3 for ; Mon, 15 Aug 2022 08:04:41 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id z12so9372240wrs.9 for ; Mon, 15 Aug 2022 08:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=11iOYJYT2e13K8s6XgKD9aJwBI/D1n9/1GA9l3T5EdU=; b=0l0n8J8oLHQpw4KO8ZATjxzBbGtlxSKPh+Zx6UM+b2l1FA0FDzTM/QPWNO1fZBfrUR VBA8H+qC06qDCkiYQ/bmbJ+W8jBscgSQIpgwYr5wQwH6C6ZYLJbz2IsQp/jk7onr+aRZ yYwEywQrDeJ4Z1dxbojsOpUyLhuFjYsPNMEBtRO6dYB4TyMjzlsCOQjHxpBmTkhfrWAo d/KgW8BaVQjCp/ZclzPwng3lKX0/JTrUO3TxG4MuBaqttdIFwHb4sqyqN4NJohD/tnrh VxDH/uetuwZhNWinL+gZYHxHEmeSaTHz8tVsrVdtldSfLZUz8hpGB8V+01//OLrR1i0g YntA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=11iOYJYT2e13K8s6XgKD9aJwBI/D1n9/1GA9l3T5EdU=; b=LqLuMCoEvmyVRyN9iGqM8acp8rZKUsHqsmrZJGG0GJSKBpfBI68Rthx9Pb2kMNdxYX uO3kRN0G/CvusAAshB7XsHtzBVllI5XRYGdvBlXbTYjPXkJeQV0mZRnv+NdObrb/61mB pT58Ez934rVi0eTz2OfACdxxrj91CjbEzyAQm9obSwRX4M8/RA0oKFcMa85Buw16HP37 rm7MEoS8r5KiC9YdkmwZ0lcC4q29AHaGJ7n9AyDiRNLU6bRlcV+XPXXz7vSL5pGIYfGG r329+6EBwHJ0b1zL1EMUbn//ytWGPQ6JB93BVrDyxft9gH6VR1u61VXMK9Jl+ilQ/StQ fNZg== X-Gm-Message-State: ACgBeo2v9HWZXKi5p1xbNv0c4V95fQApOE1dxBHxZEeKN7m43d7LVpOe NtHlU1fEo9BU3KPWOCufQ27oag== X-Google-Smtp-Source: AA6agR4Cn9TM3OgrdvUAtLqY0NQqp052poL59AH0CMXJaR9rpGCZtSY4D321sbwI25TV4/TqJsBf4A== X-Received: by 2002:adf:fe4d:0:b0:223:9815:b1e5 with SMTP id m13-20020adffe4d000000b002239815b1e5mr8572076wrs.709.1660575880388; Mon, 15 Aug 2022 08:04:40 -0700 (PDT) Received: from localhost ([109.180.234.208]) by smtp.gmail.com with ESMTPSA id v17-20020a5d43d1000000b0021eed2414c9sm7364535wrr.40.2022.08.15.08.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 08:04:39 -0700 (PDT) From: Punit Agrawal To: Perry Yuan Cc: , , , , , , , , , , , , Subject: Re: [PATCH v5 1/7] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration References: <20220814163548.326686-1-Perry.Yuan@amd.com> <20220814163548.326686-2-Perry.Yuan@amd.com> Date: Mon, 15 Aug 2022 16:04:38 +0100 In-Reply-To: <20220814163548.326686-2-Perry.Yuan@amd.com> (Perry Yuan's message of "Mon, 15 Aug 2022 00:35:42 +0800") Message-ID: <87fshxim49.fsf@stealth> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Perry, Perry Yuan writes: > Cleanup the headers declaration which are not used > actually and some duplicated declaration which is declarated in some > other headers already, it will help to simplify the header part. We usually don't get rid of indirectly included headers as long as definitions from header are used in the code. This avoids problems if for some reason the included header gets dropped - it'll leave the code in an uncompilable state. More below. > > Reviewed-by: Huang Rui > Acked-by: Viresh Kumar > Signed-off-by: Perry Yuan > --- > drivers/cpufreq/amd-pstate.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c > index 9ac75c1cde9c..19a078e232dd 100644 > --- a/drivers/cpufreq/amd-pstate.c > +++ b/drivers/cpufreq/amd-pstate.c > @@ -31,19 +31,14 @@ > #include > #include > #include > -#include > #include > #include > #include > #include > > -#include > #include > > #include > -#include On a quick scan, I noticed that "boot_cpu_data" and "boot_cpu_has()" in the module init function are defined in "asm/processor.h" that is being removed here. It may compile for now but makes the code more fragile as explained above. Please ensure that only the header files that have no definitions used in this file (amd-pstate.c) are dropped. > -#include > -#include > #include "amd-pstate-trace.h" > > #define AMD_PSTATE_TRANSITION_LATENCY 0x20000