projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[firefly-linux-kernel-4.4.55.git]
/
block
/
blk-integrity.c
diff --git
a/block/blk-integrity.c
b/block/blk-integrity.c
index 65f23ef38bbe5e1973f5cba63cf8ef9910b77b48..3f1a8478cc384b041c8ef8c66f633eb85e10b36d 100644
(file)
--- a/
block/blk-integrity.c
+++ b/
block/blk-integrity.c
@@
-178,8
+178,9
@@
static ssize_t integrity_attr_show(struct kobject *kobj, struct attribute *attr,
return entry->show(bi, page);
}
return entry->show(bi, page);
}
-static ssize_t integrity_attr_store(struct kobject *kobj, struct attribute *attr,
- const char *page, size_t count)
+static ssize_t integrity_attr_store(struct kobject *kobj,
+ struct attribute *attr, const char *page,
+ size_t count)
{
struct blk_integrity *bi =
container_of(kobj, struct blk_integrity, kobj);
{
struct blk_integrity *bi =
container_of(kobj, struct blk_integrity, kobj);
@@
-216,17
+217,16
@@
static ssize_t integrity_read_store(struct blk_integrity *bi,
unsigned long val = simple_strtoul(p, &p, 10);
if (val)
unsigned long val = simple_strtoul(p, &p, 10);
if (val)
-
set_bit(INTEGRITY_FLAG_READ, &bi->flags)
;
+
bi->flags |= INTEGRITY_FLAG_READ
;
else
else
-
clear_bit(INTEGRITY_FLAG_READ, &bi->flags)
;
+
bi->flags &= ~INTEGRITY_FLAG_READ
;
return count;
}
static ssize_t integrity_read_show(struct blk_integrity *bi, char *page)
{
return count;
}
static ssize_t integrity_read_show(struct blk_integrity *bi, char *page)
{
- return sprintf(page, "%d\n",
- test_bit(INTEGRITY_FLAG_READ, &bi->flags) ? 1 : 0);
+ return sprintf(page, "%d\n", (bi->flags & INTEGRITY_FLAG_READ) != 0);
}
static ssize_t integrity_write_store(struct blk_integrity *bi,
}
static ssize_t integrity_write_store(struct blk_integrity *bi,
@@
-236,17
+236,16
@@
static ssize_t integrity_write_store(struct blk_integrity *bi,
unsigned long val = simple_strtoul(p, &p, 10);
if (val)
unsigned long val = simple_strtoul(p, &p, 10);
if (val)
-
set_bit(INTEGRITY_FLAG_WRITE, &bi->flags)
;
+
bi->flags |= INTEGRITY_FLAG_WRITE
;
else
else
-
clear_bit(INTEGRITY_FLAG_WRITE, &bi->flags)
;
+
bi->flags &= ~INTEGRITY_FLAG_WRITE
;
return count;
}
static ssize_t integrity_write_show(struct blk_integrity *bi, char *page)
{
return count;
}
static ssize_t integrity_write_show(struct blk_integrity *bi, char *page)
{
- return sprintf(page, "%d\n",
- test_bit(INTEGRITY_FLAG_WRITE, &bi->flags) ? 1 : 0);
+ return sprintf(page, "%d\n", (bi->flags & INTEGRITY_FLAG_WRITE) != 0);
}
static struct integrity_sysfs_entry integrity_format_entry = {
}
static struct integrity_sysfs_entry integrity_format_entry = {
@@
-326,7
+325,8
@@
int blk_integrity_register(struct gendisk *disk, struct blk_integrity *template)
BUG_ON(template == NULL);
if (disk->integrity == NULL) {
BUG_ON(template == NULL);
if (disk->integrity == NULL) {
- bi = kmem_cache_alloc(integrity_cachep, GFP_KERNEL | __GFP_ZERO);
+ bi = kmem_cache_alloc(integrity_cachep,
+ GFP_KERNEL | __GFP_ZERO);
if (!bi)
return -1;
if (!bi)
return -1;
@@
-338,8
+338,7
@@
int blk_integrity_register(struct gendisk *disk, struct blk_integrity *template)
kobject_uevent(&bi->kobj, KOBJ_ADD);
kobject_uevent(&bi->kobj, KOBJ_ADD);
- set_bit(INTEGRITY_FLAG_READ, &bi->flags);
- set_bit(INTEGRITY_FLAG_WRITE, &bi->flags);
+ bi->flags |= INTEGRITY_FLAG_READ | INTEGRITY_FLAG_WRITE;
bi->sector_size = disk->queue->hardsect_size;
disk->integrity = bi;
} else
bi->sector_size = disk->queue->hardsect_size;
disk->integrity = bi;
} else