Commit 977a7f49 authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: fix checkpatch warnings in kernel files

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 308449f6
......@@ -15,7 +15,7 @@
#include <linux/miscdevice.h>
#include <linux/spinlock.h>
#include <linux/fmc.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
static LIST_HEAD(fc_devices);
static DEFINE_SPINLOCK(fc_lock);
......@@ -96,7 +96,7 @@ static ssize_t fc_write(struct file *f, const char __user *buf, size_t count,
return count;
}
static struct file_operations fc_fops = {
static const struct file_operations fc_fops = {
.open = fc_open,
.release = fc_release,
.llseek = generic_file_llseek,
......
......@@ -30,7 +30,7 @@ static int fmc_check_version(unsigned long version, const char *name)
static int fmc_uevent(struct device *dev, struct kobj_uevent_env *env)
{
//struct fmc_device *fdev = to_fmc_device(dev);
/* struct fmc_device *fdev = to_fmc_device(dev); */
/* FIXME: The MODALIAS */
add_uevent_var(env, "MODALIAS=%s", "fmc");
......@@ -68,7 +68,7 @@ static struct bus_type fmc_bus_type = {
};
/* Every device must have a release method: provide a default */
static void __fmc_release(struct device *dev){ }
static void __fmc_release(struct device *dev) { }
/* This is needed as parent for our devices and dir in sysfs */
struct device fmc_bus = {
......@@ -109,8 +109,9 @@ int fmc_device_register_n(struct fmc_device *fmcs, int n)
if (fmc_check_version(fmcs->version, fmcs->carrier_name))
return -EINVAL;
devarray = kmalloc(n * sizeof(*devarray),GFP_KERNEL);
if (!devarray) return -ENOMEM;
devarray = kmalloc(n * sizeof(*devarray), GFP_KERNEL);
if (!devarray)
return -ENOMEM;
/* Make all other checks before continuing, for all devices */
for (i = 0, fmc = fmcs; i < n; i++, fmc++) {
......@@ -128,11 +129,11 @@ int fmc_device_register_n(struct fmc_device *fmcs, int n)
}
if (!fmc->carrier_name || !fmc->carrier_data || \
!fmc->device_id) {
dev_err(fmc->hwdev, "carrier name and data, and dev_id"
"must all be set\n");
dev_err(fmc->hwdev,
"carrier name, data or dev_id not set\n");
ret = -EINVAL;
}
if(ret)
if (ret)
break;
fmc->nr_slots = n;
......
......@@ -26,7 +26,7 @@ static uint8_t *dump_line(int addr, uint8_t *line, uint8_t *prev)
int i;
if (!prev || memcmp(line, prev, LINELEN)) {
printk("%04x: ", addr);
pr_info("%04x: ", addr);
for (i = 0; i < LINELEN; ) {
printk("%02x", line[i]);
i++;
......@@ -36,7 +36,7 @@ static uint8_t *dump_line(int addr, uint8_t *line, uint8_t *prev)
}
/* repeated line */
if (line == prev + LINELEN)
printk("[...]\n");
pr_info("[...]\n");
return prev;
}
......@@ -48,16 +48,15 @@ void fmc_dump_eeprom(struct fmc_device *fmc)
if (!fmc_must_dump_eeprom)
return;
printk("FMC: mezzanine %i: %s on %s\n", fmc->slot_id,
pr_info("FMC: mezzanine %i: %s on %s\n", fmc->slot_id,
dev_name(fmc->hwdev), fmc->carrier_name);
printk("FMC: dumping eeprom 0x%x (%i) bytes\n", fmc->eeprom_len,
pr_info("FMC: dumping eeprom 0x%x (%i) bytes\n", fmc->eeprom_len,
fmc->eeprom_len);
line = fmc->eeprom;
prev = NULL;
for (i = 0; i < fmc->eeprom_len; i += LINELEN, line += LINELEN) {
for (i = 0; i < fmc->eeprom_len; i += LINELEN, line += LINELEN)
prev = dump_line(i, line, prev);
}
}
void fmc_dump_sdb(struct fmc_device *fmc)
......@@ -86,15 +85,14 @@ void fmc_dump_sdb(struct fmc_device *fmc)
*
* So, lazily, just dump the top-level array
*/
printk("FMC: mezzanine %i: %s on %s\n", fmc->slot_id,
pr_info("FMC: mezzanine %i: %s on %s\n", fmc->slot_id,
dev_name(fmc->hwdev), fmc->carrier_name);
printk("FMC: poor dump of sdb first level:\n");
pr_info("FMC: poor dump of sdb first level:\n");
len = fmc->sdb->len * sizeof(union sdb_record);
line = (void *)fmc->sdb->record;
prev = NULL;
for (i = 0; i < len; i += LINELEN, line += LINELEN) {
for (i = 0; i < len; i += LINELEN, line += LINELEN)
prev = dump_line(i, line, prev);
}
return;
}
......@@ -257,13 +257,6 @@ int ff_init(void)
device_unregister(&ff->dev);
return ret;
}
//schedule_delayed_work(&ff->work, HZ * 2); /* remove, replug, in 2s */
return ret;
}
......
......@@ -75,7 +75,7 @@ int fmc_fill_id_info(struct fmc_device *fmc)
goto out;
}
if (!fru_header_cksum_ok(h)) {
dev_warn(fmc->hwdev,"FRU: wrong header checksum\n");
dev_warn(fmc->hwdev, "FRU: wrong header checksum\n");
goto out;
}
bia = fru_get_board_area(h);
......
......@@ -104,7 +104,8 @@ static void __fmc_sdb_free(struct sdb_array *arr)
{
int i, n;
if (!arr) return;
if (!arr)
return;
n = arr->len;
for (i = 0; i < n; i++) {
if (IS_ERR(arr->subtree[i]))
......@@ -165,9 +166,10 @@ static void __fmc_show_sdb_tree(struct fmc_device *fmc, struct sdb_array *arr)
for (ap = arr; ap; ap = ap->parent)
base += ap->baseaddr;
dev_info(fmc->hwdev, "SDB: ");
for (j = 0; j < level; j++)
printk(" ");
switch(r->empty.record_type) {
switch (r->empty.record_type) {
case sdb_type_interconnect:
printk("%08llx:%08x %.19s\n",
__be64_to_cpu(p->vendor_id),
......@@ -246,7 +248,8 @@ signed long fmc_find_sdb_device(struct sdb_array *tree,
/* found */
last = __be64_to_cpu(c->addr_last);
first = __be64_to_cpu(c->addr_first);
if (sz) *sz = (typeof(*sz))(last + 1 -first);
if (sz)
*sz = (typeof(*sz))(last + 1 - first);
return first + tree->baseaddr;
}
return res;
......
......@@ -47,7 +47,7 @@ int t_probe(struct fmc_device *fmc)
/* Reprogram, if asked to. ESRCH == no filename specified */
ret = -ESRCH;
if (fmc->op->reprogram)
ret = fmc->op->reprogram(fmc, &t_drv,"");
ret = fmc->op->reprogram(fmc, &t_drv, "");
if (ret == -ESRCH)
ret = 0;
if (ret < 0)
......
......@@ -84,9 +84,9 @@ static int fwe_run(struct fmc_device *fmc, const struct firmware *fw, char *s)
char *last4 = s + strlen(s) - 4;
int err;
if (!strcmp(last4,".bin"))
if (!strcmp(last4, ".bin"))
return fwe_run_bin(fmc, fw);
if (!strcmp(last4,".tlv")) {
if (!strcmp(last4, ".tlv")) {
err = fwe_run_tlv(fmc, fw, 0);
if (!err)
err = fwe_run_tlv(fmc, fw, 1);
......
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