From patchwork Mon Oct 29 14:48:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 12566 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 844C623E01 for ; Mon, 29 Oct 2012 14:48:49 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2F1CFA183CA for ; Mon, 29 Oct 2012 14:48:49 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6411324iej.11 for ; Mon, 29 Oct 2012 07:48:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=VQJf7Lejjq7Z5N48JmhASqLSaWDoeuJ8k5xMEduVA9A=; b=Clzfh1q5bNhMhapk98/rNCodlMsmkZ5ox7IuoStRHXN5u4XXjm/+ps31Tw6FFGGg4x NypwJEjuT6dX+AGjmudhX00I9irFlvOv5DQ5Yp5GEAp4ia3ICbjYo2P8SnSdk4bTyXsp 8jPlY7McIERdGe+aB/ss2cpN8t4si2dIcevtXRiY/zY7JlwfsOwJtp4C+OE3qMM+FcSZ RVlzJtluNoMbd0HhF2mF9dsfK7elotxmYgE17YmmoYbHVGBHgTO4QB252hkt3y+ncG4e /S6iDmEmtW0FNDpuFDrfmFtiuir7se4tMgfGqtCcOZj+fC/uumndPKHqbTPEnf2tnqyK boDw== Received: by 10.50.46.226 with SMTP id y2mr9531597igm.62.1351522128626; Mon, 29 Oct 2012 07:48:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp219097igt; Mon, 29 Oct 2012 07:48:47 -0700 (PDT) Received: by 10.204.136.197 with SMTP id s5mr9507972bkt.88.1351522127388; Mon, 29 Oct 2012 07:48:47 -0700 (PDT) Received: from mail-bk0-f50.google.com (mail-bk0-f50.google.com [209.85.214.50]) by mx.google.com with ESMTPS id he7si13584760bkc.74.2012.10.29.07.48.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 07:48:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=209.85.214.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-bk0-f50.google.com with SMTP id q16so2134634bkw.37 for ; Mon, 29 Oct 2012 07:48:46 -0700 (PDT) Received: by 10.204.8.67 with SMTP id g3mr9266215bkg.107.1351522126580; Mon, 29 Oct 2012 07:48:46 -0700 (PDT) Received: from localhost.localdomain ([91.224.175.20]) by mx.google.com with ESMTPS id fm5sm4246424bkc.5.2012.10.29.07.48.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 07:48:42 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Cc: linux-pm@vger.kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH] cpuidle : fixup device.h header in cpuidle.h Date: Mon, 29 Oct 2012 15:48:40 +0100 Message-Id: <1351522120-24697-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQlqKcK2pZqNaF0hjg68hoZWSoIhfdGEtHMKGjl/6bXXeQ7yeNmrmOkagTM5jFHV+xcUcYRz The "struct device" is only used in sysfs.c. The other .c files including the private header "cpuidle.h" do not need to pull the entire headers tree from there as they don't manipulate the "struct device". This patch fix this by moving the header inclusion to sysfs.c and adding a forward declaration for the struct device. The number of lines generated by the preprocesor: Without this patch : 17269 loc With this patch : 16446 loc Signed-off-by: Daniel Lezcano --- drivers/cpuidle/cpuidle.h | 5 +++-- drivers/cpuidle/sysfs.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h index 2120d9e..f6b0923 100644 --- a/drivers/cpuidle/cpuidle.h +++ b/drivers/cpuidle/cpuidle.h @@ -5,8 +5,6 @@ #ifndef __DRIVER_CPUIDLE_H #define __DRIVER_CPUIDLE_H -#include - /* For internal use only */ extern struct cpuidle_governor *cpuidle_curr_governor; extern struct list_head cpuidle_governors; @@ -25,6 +23,9 @@ extern void cpuidle_uninstall_idle_handler(void); extern int cpuidle_switch_governor(struct cpuidle_governor *gov); /* sysfs */ + +struct device; + extern int cpuidle_add_interface(struct device *dev); extern void cpuidle_remove_interface(struct device *dev); extern int cpuidle_add_state_sysfs(struct cpuidle_device *device); diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index ed87399..860a686 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "cpuidle.h"