Commit 4eea4bd5 authored by Federico Vaga's avatar Federico Vaga
Browse files

restyle: checkpatch fix


Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d66eb39a
......@@ -204,7 +204,7 @@ out_unlock:
spin_unlock(&bi->lock);
/* There is no data in buffer, and we may pull to have data soon */
ti = bi->cset->ti;
if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT && ti->t_op->pull_block){
if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT && ti->t_op->pull_block) {
/* chek if trigger is disabled */
if (unlikely((ti->flags & ZIO_STATUS) == ZIO_DISABLED))
return NULL;
......@@ -290,5 +290,5 @@ static void __exit zbk_exit(void)
}
/* This is the default buffer, and is part of zio-core: no module init/exit */
int __init __attribute__((alias("zbk_init"))) zio_default_buffer_init(void);
int __init __attribute__((alias("zbk_init"))) zio_default_buffer_init(void);
void __exit __attribute__((alias("zbk_exit"))) zio_default_buffer_exit(void);
......@@ -51,7 +51,7 @@ struct zbk_item {
#define to_item(block) container_of(block, struct zbk_item, block);
static ZIO_ATTR_DEFINE_STD(ZIO_BUF, zbk_std_zattr) = {
ZIO_ATTR_REG(zbuf, ZIO_ATTR_ZBUF_MAXKB, S_IRUGO | S_IWUGO, 0x0, 128 /* kB */),
ZIO_ATTR_REG(zbuf, ZIO_ATTR_ZBUF_MAXKB, S_IRUGO | S_IWUGO, 0x0, 128),
};
static int zbk_conf_set(struct device *dev, struct zio_attribute *zattr,
......@@ -251,7 +251,7 @@ out_unlock:
spin_unlock(&bi->lock);
/* There is no data in buffer, and we may pull to have data soon */
ti = bi->cset->ti;
if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT && ti->t_op->pull_block){
if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT && ti->t_op->pull_block) {
/* chek if trigger is disabled */
if (unlikely((ti->flags & ZIO_STATUS) == ZIO_DISABLED))
return NULL;
......@@ -325,23 +325,23 @@ static int zbk_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
struct zio_bi *bi = priv->chan->bi;
struct zbk_instance *zbki = to_zbki(bi);
long off = vmf->pgoff * PAGE_SIZE;
struct page *p;
struct page *p;
void *addr;
if (priv->type == ZIO_CDEV_CTRL)
return VM_FAULT_SIGBUS;
printk("fault at %li (size %li)\n", off, zbki->size);
if (off > zbki->size)
if (off > zbki->size)
return VM_FAULT_SIGBUS;
addr = zbki->data + off;
printk("%s: uaddr %p, off %li: kaddr %p\n",
__FUNCTION__, vmf->virtual_address, off, addr);
p = vmalloc_to_page(addr);
get_page(p);
vmf->page = p;
return 0;
addr = zbki->data + off;
printk("%s: uaddr %p, off %li: kaddr %p\n",
__func__, vmf->virtual_address, off, addr);
p = vmalloc_to_page(addr);
get_page(p);
vmf->page = p;
return 0;
}
static struct vm_operations_struct zbk_vma_ops = {
......
......@@ -58,13 +58,15 @@ struct ad788x {
static ZIO_ATTR_DEFINE_STD(ZIO_DEV, zattr_dev_ad7887) = {
ZIO_ATTR_REG(zdev, ZIO_ATTR_NBITS, S_IRUGO, 0, 12),
/* vref_src can be internal (0) or external (1)*/
ZIO_ATTR_REG(zdev, ZIO_ATTR_VREFTYPE, S_IRUGO | S_IWUGO, AD7887_VREF_ADDR, 1),
ZIO_ATTR_REG(zdev, ZIO_ATTR_VREFTYPE, S_IRUGO | S_IWUGO,
AD7887_VREF_ADDR, 1),
};
/* Standard attributes for AD7888*/
static ZIO_ATTR_DEFINE_STD(ZIO_DEV, zattr_dev_ad7888) = {
ZIO_ATTR_REG(zdev, ZIO_ATTR_NBITS, S_IRUGO, 0, 12),
/* vref_src can be internal (0) or external (1)*/
ZIO_ATTR_REG(zdev, ZIO_ATTR_VREFTYPE, S_IRUGO | S_IWUGO, AD7888_VREF_ADDR, 0),
ZIO_ATTR_REG(zdev, ZIO_ATTR_VREFTYPE, S_IRUGO | S_IWUGO,
AD7888_VREF_ADDR, 0),
};
/* Extended attributes for AD7887 */
static struct zio_attribute zattr_dev_ext_ad7887[] = {
......@@ -305,7 +307,7 @@ static int __devinit ad788x_spi_probe(struct spi_device *spi)
dev_id = spi->chip_select | (spi->master->bus_num << 8);
/* Register a ZIO device */
err= zio_register_device(zdev, spi_id->name, dev_id);
err = zio_register_device(zdev, spi_id->name, dev_id);
if (err)
kfree(ad788x);
return err;
......
......@@ -171,8 +171,8 @@ static int __init zgp_init(void)
zgp_dev->owner = THIS_MODULE;
err = zio_register_device(zgp_dev, "gpio", 0);
if (err) {
pr_err(KBUILD_MODNAME ": can't register zio driver "
"(error %i)\n", err);
pr_err(KBUILD_MODNAME ": can't register zio driver (err %i)\n",
err);
goto out_reg;
}
......
......@@ -19,13 +19,15 @@ ZIO_PARAM_TRIGGER(zzero_trigger);
ZIO_PARAM_BUFFER(zzero_buffer);
ZIO_ATTR_DEFINE_STD(ZIO_DEV, zzero_zattr_cset8) = {
ZIO_ATTR_REG(zdev, ZIO_ATTR_NBITS, S_IRUGO, 0, 8), /* 8 bit -> ssize = 1 */
/* 8 bit -> ssize = 1 */
ZIO_ATTR_REG(zdev, ZIO_ATTR_NBITS, S_IRUGO, 0, 8),
};
ZIO_ATTR_DEFINE_STD(ZIO_DEV, zzero_zattr_cset32) = {
ZIO_ATTR_REG(zdev, ZIO_ATTR_NBITS, S_IRUGO, 0, 32), /* 32 bit -> ssize = 4 */
/* 32 bit -> ssize = 4 */
ZIO_ATTR_REG(zdev, ZIO_ATTR_NBITS, S_IRUGO, 0, 32),
};
/* This attribute is the sequence point for input channel number 0 of cset 2 */
enum zzero_ext{
enum zzero_ext {
ZZERO_SEQ,
};
static struct zio_attribute zzero_cset1_ext[] = {
......
......@@ -41,7 +41,7 @@ struct zio_attribute {
};
#define ZIO_ATTR_INDEX_NONE -1
enum zattr_flags {
ZIO_ATTR_TYPE = 0x10,
ZIO_ATTR_TYPE = 0x10,
ZIO_ATTR_TYPE_STD = 0x00,
ZIO_ATTR_TYPE_EXT = 0x10,
ZIO_ATTR_CONTROL = 0x20,
......
......@@ -117,5 +117,5 @@ static void __exit ztu_exit(void)
/* This is the default trigger, and is part of zio-core: no module init/exit */
int __init __attribute__((alias("ztu_init"))) zio_default_trigger_init(void);
int __init __attribute__((alias("ztu_init"))) zio_default_trigger_init(void);
void __exit __attribute__((alias("ztu_exit"))) zio_default_trigger_exit(void);
......@@ -261,7 +261,7 @@ void zio_trigger_abort(struct zio_cset *cset)
*/
spin_lock(&cset->lock);
if ((ti->flags & ZIO_TI_BUSY) && !(ti->flags & ZIO_TI_COMPLETING)) {
if(ti->t_op->abort)
if (ti->t_op->abort)
ti->t_op->abort(cset);
else
__zio_internal_abort_free(cset);
......@@ -381,8 +381,8 @@ static int zobj_unique_name(struct zio_object_list *zobj_list, const char *name)
return -EINVAL;
}
if (strlen(name) > ZIO_OBJ_NAME_LEN)
pr_warning("ZIO: name too long, cut to %d characters\n",
ZIO_OBJ_NAME_LEN);
pr_warn("ZIO: name too long, cut to %d characters\n",
ZIO_OBJ_NAME_LEN);
pr_debug("%s\n", __func__);
list_for_each_entry(cur, &zobj_list->list, list) {
......@@ -695,7 +695,7 @@ static void __zattr_trig_init_ctrl(struct zio_ti *ti, struct zio_control *ctrl)
}
static int __zattr_chan_init_ctrl(struct zio_channel *chan, unsigned int start)
{
struct zio_ctrl_attr*ctrl_attr_chan;
struct zio_ctrl_attr *ctrl_attr_chan;
struct zio_control *ctrl;
struct zio_device *zdev;
struct zio_cset *cset;
......@@ -1140,7 +1140,7 @@ static const struct zio_device_id *zio_match_id(const struct zio_device_id *id,
const struct zio_obj_head *head)
{
while (id->name[0]) {
pr_debug("%s comparing %s == %s \n", __func__,
pr_debug("%s comparing %s == %s\n", __func__,
id->name, head->name);
if (!strcmp(head->name, id->name))
return id;
......@@ -1165,7 +1165,7 @@ static int zio_match_device(struct device *dev, struct device_driver *drv)
if (!zdrv->id_table)
return 0;
id = zio_match_id(zdrv->id_table, to_zio_head(dev));
if(!id)
if (!id)
return 0;
pr_debug("%s:%d\n", __func__, __LINE__);
/* device and driver match */
......@@ -1366,7 +1366,7 @@ static int zattr_set_create(struct zio_obj_head *head,
goto out;
/* Allocate needed groups. dev->groups is null ended */
groups = kzalloc(sizeof(struct attribute_group*) * (g_count + 1),
groups = kzalloc(sizeof(struct attribute_group *) * (g_count + 1),
GFP_KERNEL);
if (!groups)
return -ENOMEM;
......@@ -1434,7 +1434,7 @@ static void zattr_set_remove(struct zio_obj_head *head)
zattr_set = zio_get_from_obj(head, zattr_set);
if (!zattr_set)
return;
if (! head->dev.groups)
if (!head->dev.groups)
return;
for (i = 0; head->dev.groups[i]; ++i) {
kfree(head->dev.groups[i]->attrs);
......@@ -2240,7 +2240,7 @@ int zio_register_buf(struct zio_buffer_type *zbuf, const char *name)
/* Verify if it is a valid name */
err = zobj_unique_name(&zstat->all_buffer_types, name);
if (err)
return err < 0 ? err: -EBUSY;
return err < 0 ? err : -EBUSY;
strncpy(zbuf->head.name, name, ZIO_OBJ_NAME_LEN);
err = zio_init_buffer_fops(zbuf);
......@@ -2290,7 +2290,7 @@ int zio_register_trig(struct zio_trigger_type *trig, const char *name)
/* Verify if it is a valid name */
err = zobj_unique_name(&zstat->all_trigger_types, name);
if (err)
return err < 0 ? err: -EBUSY;
return err < 0 ? err : -EBUSY;
strncpy(trig->head.name, name, ZIO_OBJ_NAME_LEN);
trig->head.zobj_type = ZIO_TRG;
err = zobj_register(&zstat->all_trigger_types, &trig->head, trig->owner);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment