From patchwork Thu Sep 10 07:36:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 7151681 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 32458BEEC1 for ; Thu, 10 Sep 2015 07:35:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66B6220614 for ; Thu, 10 Sep 2015 07:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C8B7206BD for ; Thu, 10 Sep 2015 07:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141AbbIJHfS (ORCPT ); Thu, 10 Sep 2015 03:35:18 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34978 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753132AbbIJHfS (ORCPT ); Thu, 10 Sep 2015 03:35:18 -0400 Received: by pacfv12 with SMTP id fv12so35936177pac.2 for ; Thu, 10 Sep 2015 00:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=r+8OdpgTHi3aaxqohQe/JadHzLtRobXj1stU+vDClgY=; b=vsLydH51tgerW1H3Cao2GdqQm5U55WYZ7jW6WjEjgpXSM2OhoJvUhNTcEasS0LA3Nz edJpFHKNV+HkEshKvqcTgVpYG41RWvayY29WFaD9JioRfcKKqFsaACRFPPJornacEfI+ u9ymyuvEZVcCvZ6F5kKJbXrJsdn6HtDE9HNyt7Rkv/qLS66+DzKKG/cmCgiy3lgklacG T2PDgLfxs63Dg+OuUxMudrf9sbf0gH+0U0UzqmuOObR6m+le4oC3sShR7pBilYmzDzua Y/QKzqFlX45UaHVHESBT+mZyb5ncN45jXOClZyTjrYIEYoyj0CYuM7K/twBD9OQdpMaM nobA== X-Received: by 10.66.161.137 with SMTP id xs9mr72428060pab.117.1441870517891; Thu, 10 Sep 2015 00:35:17 -0700 (PDT) Received: from localhost ([39.7.47.154]) by smtp.gmail.com with ESMTPSA id zn9sm10170427pac.11.2015.09.10.00.35.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 00:35:17 -0700 (PDT) Date: Thu, 10 Sep 2015 16:36:00 +0900 From: Sergey Senozhatsky To: "Rafael J. Wysocki" Cc: tglx@linutronix.de, Alexandra Yates , kristen.c.accardi@intel.com, linux-pm@vger.kernel.org Subject: Re: [PATCH V7] Report interrupt that caused system wakeup Message-ID: <20150910073600.GB587@swordfish> References: <1441853301-3816-1-git-send-email-alexandra.yates@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1441853301-3816-1-git-send-email-alexandra.yates@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On (09/09/15 19:48), Alexandra Yates wrote: [..] > +static ssize_t pm_last_wakeup_irq_store(struct kobject *kobj, > + struct kobj_attribute *attr, > + const char *buf, size_t n) > +{ > + return -EINVAL; > +} > +power_attr(pm_last_wakeup_irq); a side note, do you guys want to define a power_attr_ro() macro and to drop 'return -EINVAL' *_show() functions: pm_trace_dev_match_store() and pm_last_wakeup_irq_store()? --- kernel/power/main.c | 9 +-------- kernel/power/power.h | 9 +++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/power/main.c b/kernel/power/main.c index 63d395b..0217a5c 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -548,14 +548,7 @@ static ssize_t pm_trace_dev_match_show(struct kobject *kobj, return show_trace_dev_match(buf, PAGE_SIZE); } -static ssize_t -pm_trace_dev_match_store(struct kobject *kobj, struct kobj_attribute *attr, - const char *buf, size_t n) -{ - return -EINVAL; -} - -power_attr(pm_trace_dev_match); +power_attr_ro(pm_trace_dev_match); #endif /* CONFIG_PM_TRACE */ diff --git a/kernel/power/power.h b/kernel/power/power.h index caadb56..efe1b3b 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -77,6 +77,15 @@ static struct kobj_attribute _name##_attr = { \ .store = _name##_store, \ } +#define power_attr_ro(_name) \ +static struct kobj_attribute _name##_attr = { \ + .attr = { \ + .name = __stringify(_name), \ + .mode = S_IRUGO, \ + }, \ + .show = _name##_show, \ +} + /* Preferred image size in bytes (default 500 MB) */ extern unsigned long image_size; /* Size of memory reserved for drivers (default SPARE_PAGES x PAGE_SIZE) */