Skip to content

Commit

Permalink
silicom: checkpatch: errors caused by macros
Browse files Browse the repository at this point in the history
fixed checkpatch error:
added parenthesis around complex macro.

Macro with return was only used once in the code,
so I expandet it in-place.

Signed-off-by: Lorenz Haspel <lorenz@badgers.com>
Signed-off-by: Michael Banken <michael.banken@mathe.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lorenz Haspel authored and Greg Kroah-Hartman committed Jun 24, 2013
1 parent bbeebec commit 27a9095
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/staging/silicom/bpctl_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ MODULE_DESCRIPTION(BP_MOD_DESCR);
MODULE_VERSION(BP_MOD_VER);
spinlock_t bpvm_lock;

#define lock_bpctl() \
if (down_interruptible(&bpctl_sema)) { \
return -ERESTARTSYS; \
} \

#define unlock_bpctl() \
up(&bpctl_sema);

Expand Down Expand Up @@ -5414,7 +5409,8 @@ static long device_ioctl(struct file *file, /* see include/linux/fs.h */
static bpctl_dev_t *pbpctl_dev;

/* lock_kernel(); */
lock_bpctl();
if (down_interruptible(&bpctl_sema))
return -ERESTARTSYS;
/* local_irq_save(flags); */
/* if(!spin_trylock_irqsave(&bpvm_lock)){
local_irq_restore(flags);
Expand Down Expand Up @@ -7871,7 +7867,8 @@ int bypass_proc_create_dev_sd(bpctl_dev_t *pbp_device_block)
}
current_pfs->bypass_entry = procfs_dir;

#define ENTRY(x) ret |= procfs_add(#x, &x##_ops, pbp_device_block)
#define ENTRY(x) (ret |= procfs_add(#x, &x##_ops, pbp_device_block))

ENTRY(bypass_info);
if (pbp_device_block->bp_caps & SW_CTL_CAP) {
/* Create set param proc's */
Expand Down

0 comments on commit 27a9095

Please sign in to comment.