Displaying 20 results from an estimated 137 matches for "device_attr".
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
...--git a/block/genhd.c b/block/genhd.c
index 066de6d321c7..cb65a3013480 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1127,28 +1127,25 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
}
-static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL);
-static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL);
-static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
-static DEVICE_ATTR(hidden, S_IRUGO, disk_hidden_show, NULL);
-static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL);
-static...
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
...--git a/block/genhd.c b/block/genhd.c
index 066de6d321c7..cb65a3013480 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1127,28 +1127,25 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
}
-static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL);
-static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL);
-static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
-static DEVICE_ATTR(hidden, S_IRUGO, disk_hidden_show, NULL);
-static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL);
-static...
2018 May 24
3
[PATCH] gpu: Consistently use octal not symbolic permissions
...pu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index b455da487782..fa55d7e9e784 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -905,39 +905,39 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
return -EINVAL;
}
-static DEVICE_ATTR(power_dpm_state, S_IRUGO | S_IWUSR, amdgpu_get_dpm_state, amdgpu_set_dpm_state);
-static DEVICE_ATTR(power_dpm_force_performance_level, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(power_dpm_state, 0644, amdgpu_get_dpm_state, amdgpu_set_dpm_state);
+static DEVICE_ATTR(power_dpm_force_performance_level, 0...
2018 May 25
0
[PATCH] gpu: Consistently use octal not symbolic permissions
..._pm.c
> index b455da487782..fa55d7e9e784 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> @@ -905,39 +905,39 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
> return -EINVAL;
> }
>
> -static DEVICE_ATTR(power_dpm_state, S_IRUGO | S_IWUSR, amdgpu_get_dpm_state, amdgpu_set_dpm_state);
> -static DEVICE_ATTR(power_dpm_force_performance_level, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(power_dpm_state, 0644, amdgpu_get_dpm_state, amdgpu_set_dpm_state);
> +static DEVICE_ATTR(power_dpm_force_perfo...
2014 Mar 19
5
[PATCH] virtio-blk: make the queue depth configurable
...; static const char __param_str_##name[] = prefix #name; \
>> > static struct kernel_param __moduleparam_const __param_##name \
>>
>> It might make sense to separate this octal permissions
>> test into a new macro for other checks in macros like
>> CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2.
OK, I took your bikeshed and re-painted it below.
> #define VERIFY_OCTAL_PERMISSIONS(perms) \
> ({ \
> if (__builtin_constant_p(perms)) { \
> BUILD_BUG_ON((perms) < 0); \
> BUILD_BUG_ON((perms) > 0777); \
> /* Use...
2014 Mar 19
5
[PATCH] virtio-blk: make the queue depth configurable
...; static const char __param_str_##name[] = prefix #name; \
>> > static struct kernel_param __moduleparam_const __param_##name \
>>
>> It might make sense to separate this octal permissions
>> test into a new macro for other checks in macros like
>> CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2.
OK, I took your bikeshed and re-painted it below.
> #define VERIFY_OCTAL_PERMISSIONS(perms) \
> ({ \
> if (__builtin_constant_p(perms)) { \
> BUILD_BUG_ON((perms) < 0); \
> BUILD_BUG_ON((perms) > 0777); \
> /* Use...
2014 Nov 25
2
[PATCH v4 18/42] virtio_blk: make serial attribute static
...hanged, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index f601f16..055f3df 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,7 +332,8 @@ static ssize_t virtblk_serial_show(struct device *dev,
return err;
}
-DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
+
+static DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
static void virtblk_config_changed_work(struct work_struct *work)
{
--
MST
2014 Nov 25
2
[PATCH v4 18/42] virtio_blk: make serial attribute static
...hanged, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index f601f16..055f3df 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,7 +332,8 @@ static ssize_t virtblk_serial_show(struct device *dev,
return err;
}
-DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
+
+static DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
static void virtblk_config_changed_work(struct work_struct *work)
{
--
MST
2011 Jun 24
1
[PATCH 1/2] xen: Populate xenbus device attributes
...obe.c
index 7397695..2ed0b04 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -378,26 +378,31 @@ static void xenbus_dev_release(struct device *dev)
kfree(to_xenbus_device(dev));
}
-static ssize_t xendev_show_nodename(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t nodename_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
}
-static DEVICE_ATTR(nodename, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_nodename, NULL);
-s...
2011 Jun 24
1
[PATCH 1/2] xen: Populate xenbus device attributes
...obe.c
index 7397695..2ed0b04 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -378,26 +378,31 @@ static void xenbus_dev_release(struct device *dev)
kfree(to_xenbus_device(dev));
}
-static ssize_t xendev_show_nodename(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t nodename_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
}
-static DEVICE_ATTR(nodename, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_nodename, NULL);
-s...
2011 Jun 24
1
[PATCH 1/2] xen: Populate xenbus device attributes
...obe.c
index 7397695..2ed0b04 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -378,26 +378,31 @@ static void xenbus_dev_release(struct device *dev)
kfree(to_xenbus_device(dev));
}
-static ssize_t xendev_show_nodename(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t nodename_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
}
-static DEVICE_ATTR(nodename, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_nodename, NULL);
-s...
2014 Mar 19
1
[PATCH] virtio-blk: make the queue depth configurable
Couple more bikesheddy things:
Is there ever a reason to use a non __builtin_const_p(perms)?
Maybe that should be a BUILD_BUG_ON too
BUILD_BUG_ON(!builtin_const_p_perms)
My brain of little size gets confused by the
BUILD_BUG_ON_ZERO(foo) +
vs
BUILD_BUG_ON(foo);
as it just seems like more text for the same content.
Is there any value on the "_ZERO(foo) +" I don't understand?
2014 Mar 19
1
[PATCH] virtio-blk: make the queue depth configurable
Couple more bikesheddy things:
Is there ever a reason to use a non __builtin_const_p(perms)?
Maybe that should be a BUILD_BUG_ON too
BUILD_BUG_ON(!builtin_const_p_perms)
My brain of little size gets confused by the
BUILD_BUG_ON_ZERO(foo) +
vs
BUILD_BUG_ON(foo);
as it just seems like more text for the same content.
Is there any value on the "_ZERO(foo) +" I don't understand?
2013 Sep 06
2
[PATCH RESEND v3 3/7] Intel MIC Host Driver, card OS state management.
Again, very minor fixups for later (I can even do them...)
> +static DEVICE_ATTR(state, S_IRUGO|S_IWUSR, mic_show_state, mic_store_state);
DEVICE_ATTR_RW() please.
Same for the other attributes you create in this patch.
thanks,
greg k-h
2013 Sep 06
2
[PATCH RESEND v3 3/7] Intel MIC Host Driver, card OS state management.
Again, very minor fixups for later (I can even do them...)
> +static DEVICE_ATTR(state, S_IRUGO|S_IWUSR, mic_show_state, mic_store_state);
DEVICE_ATTR_RW() please.
Same for the other attributes you create in this patch.
thanks,
greg k-h
2014 Mar 17
2
[PATCH] virtio-blk: make the queue depth configurable
...uot;prefix) > MAX_PARAM_PREFIX_LEN); \
> static const char __param_str_##name[] = prefix #name; \
> static struct kernel_param __moduleparam_const __param_##name \
It might make sense to separate this octal permissions
test into a new macro for other checks in macros like
CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2.
Maybe something like:
#define VERIFY_OCTAL_PERMISSIONS(perm) \
static int __param_perm_check_##name __attribute__((unused)) = \
BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \
/* User perms >= group perms >= other perms. */...
2014 Mar 17
2
[PATCH] virtio-blk: make the queue depth configurable
...uot;prefix) > MAX_PARAM_PREFIX_LEN); \
> static const char __param_str_##name[] = prefix #name; \
> static struct kernel_param __moduleparam_const __param_##name \
It might make sense to separate this octal permissions
test into a new macro for other checks in macros like
CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2.
Maybe something like:
#define VERIFY_OCTAL_PERMISSIONS(perm) \
static int __param_perm_check_##name __attribute__((unused)) = \
BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \
/* User perms >= group perms >= other perms. */...
2014 Oct 23
0
[PATCH] virtio_blk: make serial attribute static
...hanged, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 93e23a7..a68f4c6 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,7 +332,8 @@ static ssize_t virtblk_serial_show(struct device *dev,
return err;
}
-DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
+
+static DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
static void virtblk_config_changed_work(struct work_struct *work)
{
--
MST
2014 Nov 24
0
[PATCH v3 17/41] virtio_blk: make serial attribute static
...hanged, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index f601f16..055f3df 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,7 +332,8 @@ static ssize_t virtblk_serial_show(struct device *dev,
return err;
}
-DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
+
+static DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
static void virtblk_config_changed_work(struct work_struct *work)
{
--
MST
2014 Nov 27
0
[PATCH v5 20/45] virtio_blk: make serial attribute static
...hanged, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index f601f16..055f3df 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,7 +332,8 @@ static ssize_t virtblk_serial_show(struct device *dev,
return err;
}
-DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
+
+static DEVICE_ATTR(serial, S_IRUGO, virtblk_serial_show, NULL);
static void virtblk_config_changed_work(struct work_struct *work)
{
--
MST