* [PATCH] drm/i915: add \n to the end of sysfs attributes
@ 2013-02-14 8:42 Jani Nikula
2013-02-14 17:46 ` Ben Widawsky
0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2013-02-14 8:42 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
It is customary to end sysfs attributes with a newline.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/i915_sysfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 9462081..a3a3e22 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -49,7 +49,7 @@ static ssize_t
show_rc6_mask(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_minor *dminor = container_of(kdev, struct drm_minor, kdev);
- return snprintf(buf, PAGE_SIZE, "%x", intel_enable_rc6(dminor->dev));
+ return snprintf(buf, PAGE_SIZE, "%x\n", intel_enable_rc6(dminor->dev));
}
static ssize_t
@@ -57,7 +57,7 @@ show_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_minor *dminor = container_of(kdev, struct drm_minor, kdev);
u32 rc6_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6);
- return snprintf(buf, PAGE_SIZE, "%u", rc6_residency);
+ return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
}
static ssize_t
@@ -65,7 +65,7 @@ show_rc6p_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_minor *dminor = container_of(kdev, struct drm_minor, kdev);
u32 rc6p_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6p);
- return snprintf(buf, PAGE_SIZE, "%u", rc6p_residency);
+ return snprintf(buf, PAGE_SIZE, "%u\n", rc6p_residency);
}
static ssize_t
@@ -73,7 +73,7 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
{
struct drm_minor *dminor = container_of(kdev, struct drm_minor, kdev);
u32 rc6pp_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6pp);
- return snprintf(buf, PAGE_SIZE, "%u", rc6pp_residency);
+ return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
}
static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
@@ -215,7 +215,7 @@ static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
ret = dev_priv->rps.cur_delay * GT_FREQUENCY_MULTIPLIER;
mutex_unlock(&dev_priv->rps.hw_lock);
- return snprintf(buf, PAGE_SIZE, "%d", ret);
+ return snprintf(buf, PAGE_SIZE, "%d\n", ret);
}
static ssize_t gt_max_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
@@ -229,7 +229,7 @@ static ssize_t gt_max_freq_mhz_show(struct device *kdev, struct device_attribute
ret = dev_priv->rps.max_delay * GT_FREQUENCY_MULTIPLIER;
mutex_unlock(&dev_priv->rps.hw_lock);
- return snprintf(buf, PAGE_SIZE, "%d", ret);
+ return snprintf(buf, PAGE_SIZE, "%d\n", ret);
}
static ssize_t gt_max_freq_mhz_store(struct device *kdev,
@@ -280,7 +280,7 @@ static ssize_t gt_min_freq_mhz_show(struct device *kdev, struct device_attribute
ret = dev_priv->rps.min_delay * GT_FREQUENCY_MULTIPLIER;
mutex_unlock(&dev_priv->rps.hw_lock);
- return snprintf(buf, PAGE_SIZE, "%d", ret);
+ return snprintf(buf, PAGE_SIZE, "%d\n", ret);
}
static ssize_t gt_min_freq_mhz_store(struct device *kdev,
@@ -355,7 +355,7 @@ static ssize_t gt_rp_mhz_show(struct device *kdev, struct device_attribute *attr
} else {
BUG();
}
- return snprintf(buf, PAGE_SIZE, "%d", val);
+ return snprintf(buf, PAGE_SIZE, "%d\n", val);
}
static const struct attribute *gen6_attrs[] = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: add \n to the end of sysfs attributes
2013-02-14 8:42 [PATCH] drm/i915: add \n to the end of sysfs attributes Jani Nikula
@ 2013-02-14 17:46 ` Ben Widawsky
2013-02-19 10:33 ` Jani Nikula
0 siblings, 1 reply; 4+ messages in thread
From: Ben Widawsky @ 2013-02-14 17:46 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Thu, Feb 14, 2013 at 10:42:11AM +0200, Jani Nikula wrote:
> It is customary to end sysfs attributes with a newline.
>
As best I can tell, you are correct. Have you tested powertop with this
change? If not, can you?
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
[snip]
--
Ben Widawsky, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: add \n to the end of sysfs attributes
2013-02-14 17:46 ` Ben Widawsky
@ 2013-02-19 10:33 ` Jani Nikula
2013-02-19 11:19 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2013-02-19 10:33 UTC (permalink / raw)
To: Ben Widawsky; +Cc: intel-gfx
On Thu, 14 Feb 2013, Ben Widawsky <ben@bwidawsk.net> wrote:
> On Thu, Feb 14, 2013 at 10:42:11AM +0200, Jani Nikula wrote:
>> It is customary to end sysfs attributes with a newline.
>>
>
> As best I can tell, you are correct. Have you tested powertop with this
> change? If not, can you?
Good point. Tested, and eyeballed the powertop sysfs reading code. This
should be all right.
BR,
Jani.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: add \n to the end of sysfs attributes
2013-02-19 10:33 ` Jani Nikula
@ 2013-02-19 11:19 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-02-19 11:19 UTC (permalink / raw)
To: Jani Nikula; +Cc: Ben Widawsky, intel-gfx
On Tue, Feb 19, 2013 at 12:33:14PM +0200, Jani Nikula wrote:
> On Thu, 14 Feb 2013, Ben Widawsky <ben@bwidawsk.net> wrote:
> > On Thu, Feb 14, 2013 at 10:42:11AM +0200, Jani Nikula wrote:
> >> It is customary to end sysfs attributes with a newline.
> >>
> >
> > As best I can tell, you are correct. Have you tested powertop with this
> > change? If not, can you?
>
> Good point. Tested, and eyeballed the powertop sysfs reading code. This
> should be all right.
Patche queued for next, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-19 11:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-14 8:42 [PATCH] drm/i915: add \n to the end of sysfs attributes Jani Nikula
2013-02-14 17:46 ` Ben Widawsky
2013-02-19 10:33 ` Jani Nikula
2013-02-19 11:19 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.