[PATCH 2/2] audit: uninitialize variable audit_sig_sid
Checkpatch tool reports "ERROR: do not initialise globals/statics to 0" To fix this, audit_sig_sid is uninitialized As this is stored in the .bss section, the compiler can initialize the variable automatically. Signed-off-by: Jules Irenge --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index afd7827cf6e8..1c74d1d788b6 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -125,7 +125,7 @@ static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; /* The identity of the user shutting down the audit system. */ static kuid_t audit_sig_uid = INVALID_UID; static pid_t audit_sig_pid = -1; -static u32 audit_sig_sid = 0; +static u32 audit_sig_sid; /* Records can be lost in several ways: 0) [suppressed in audit_alloc] -- 2.26.2
[RESEND PATCH 2/2] audit: uninitialize variable audit_sig_sid
Checkpatch tool reports "ERROR: do not initialise globals/statics to 0" To fix this, audit_sig_sid is uninitialized As this is stored in the .bss section, the compiler can initialize the variable automatically. Signed-off-by: Jules Irenge --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index afd7827cf6e8..1c74d1d788b6 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -125,7 +125,7 @@ static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; /* The identity of the user shutting down the audit system. */ static kuid_t audit_sig_uid = INVALID_UID; static pid_t audit_sig_pid = -1; -static u32 audit_sig_sid = 0; +static u32 audit_sig_sid; /* Records can be lost in several ways: 0) [suppressed in audit_alloc] -- 2.26.2
[RESEND PATCH 1/2] audit: change unnecessary globals into statics
Variables sig_pid, audit_sig_uid and audit_sig_sid are only used in the audit.c file across the kernel Hence it appears no reason for declaring them as globals This patch removes their global declarations from the .h file and change them into static in the .c file. Signed-off-by: Jules Irenge --- kernel/audit.c | 6 +++--- kernel/audit.h | 4 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/audit.c b/kernel/audit.c index b2301bdc9773..afd7827cf6e8 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -123,9 +123,9 @@ static u32 audit_backlog_limit = 64; static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; /* The identity of the user shutting down the audit system. */ -kuid_t audit_sig_uid = INVALID_UID; -pid_t audit_sig_pid = -1; -u32audit_sig_sid = 0; +static kuid_t audit_sig_uid = INVALID_UID; +static pid_t audit_sig_pid = -1; +static u32 audit_sig_sid = 0; /* Records can be lost in several ways: 0) [suppressed in audit_alloc] diff --git a/kernel/audit.h b/kernel/audit.h index ddc22878433d..3b9c0945225a 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -327,10 +327,6 @@ static inline int audit_signal_info_syscall(struct task_struct *t) extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len); -extern pid_t audit_sig_pid; -extern kuid_t audit_sig_uid; -extern u32 audit_sig_sid; - extern int audit_filter(int msgtype, unsigned int listtype); extern void audit_ctl_lock(void); -- 2.26.2
[RESEND PATCH 0/2] cleanups
I am proposing these 2 patches, one of which is recommendation of Joe Perches, namely the removing of unnecessary globals and change them to static. I am currently learning the core kernel the hard way. I will appreciate any feedback negative or positive. Thanks Jules Irenge (2): audit: change unnecessary globals into statics audit: uninitialize variable audit_sig_sid kernel/audit.c | 6 +++--- kernel/audit.h | 4 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.26.2
[PATCH 1/2] audit: change unnecessary globals into statics
Variables sig_pid, audit_sig_uid and audit_sig_sid are only used in the audit.c file across the kernel Hence it appears no reason for declaring them as globals This patch removes their global declarations from the .h file and change them into static in the .c file. Signed-off-by: Jules Irenge --- kernel/audit.c | 6 +++--- kernel/audit.h | 4 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/audit.c b/kernel/audit.c index b2301bdc9773..afd7827cf6e8 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -123,9 +123,9 @@ static u32 audit_backlog_limit = 64; static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; /* The identity of the user shutting down the audit system. */ -kuid_t audit_sig_uid = INVALID_UID; -pid_t audit_sig_pid = -1; -u32audit_sig_sid = 0; +static kuid_t audit_sig_uid = INVALID_UID; +static pid_t audit_sig_pid = -1; +static u32 audit_sig_sid = 0; /* Records can be lost in several ways: 0) [suppressed in audit_alloc] diff --git a/kernel/audit.h b/kernel/audit.h index ddc22878433d..3b9c0945225a 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -327,10 +327,6 @@ static inline int audit_signal_info_syscall(struct task_struct *t) extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len); -extern pid_t audit_sig_pid; -extern kuid_t audit_sig_uid; -extern u32 audit_sig_sid; - extern int audit_filter(int msgtype, unsigned int listtype); extern void audit_ctl_lock(void); -- 2.26.2
Re: [PATCH 4/4] context_tracking: uninitialize static variables
On Mon, 3 Aug 2020, pet...@infradead.org wrote: > So personally I prefer having the '= false' there. It used to be that > compilers were stupid and would put any initialized static variable in > .data, even if it was initialized with 0. But AFAIK compilers are no > longer that stupid. > Thanks for the reply, I completely understand the precaution measure.
Re: [PATCH 0/4] Checkpatch tool errors clean up
On Sat, 1 Aug 2020, Joe Perches wrote: > On Sat, 2020-08-01 at 19:45 +0100, Jules Irenge wrote: > > Hi > > I am proposing these 4 patches. > > I am currently learning the core kernel the hard way. > > I will appreciate any feedback negative or positive. > > Thanks > > Generally, whitespace only changes outside of drivers/staging > are not encouraged. > > > Jules Irenge (4): > > acct: Add required space between variable and operator > > audit: uninitialize global variable audit_sig_sid > > audit: uninitialize static variables > > context_tracking: uninitialize static variables > > > > kernel/acct.c | 2 +- > > kernel/audit.c| 10 +- > > kernel/context_tracking.c | 2 +- > > 3 files changed, 7 insertions(+), 7 deletions(-) > > > Thanks, I take good note. Kind regards, Jules
Re: [PATCH 2/4] audit: uninitialize global variable audit_sig_sid
On Sat, 1 Aug 2020, Joe Perches wrote: > On Sat, 2020-08-01 at 19:46 +0100, Jules Irenge wrote: > > Checkpatch tool reports an error at variable audit_sig_sid declaration > [] > > diff --git a/kernel/audit.c b/kernel/audit.c > [] > > @@ -125,7 +125,7 @@ static u32 audit_backlog_wait_time = > > AUDIT_BACKLOG_WAIT_TIME; > > /* The identity of the user shutting down the audit system. */ > > kuid_t audit_sig_uid = INVALID_UID; > > pid_t audit_sig_pid = -1; > > -u32audit_sig_sid = 0; > > +u32audit_sig_sid; > > All of these are unused outside of audit.c and might as > well be static and removed from the .h file. > Thanks for reply, I will resend a second version with the recommendation, namely make the above static and remove them from the .h file. Jules
[PATCH 2/4] audit: uninitialize global variable audit_sig_sid
Checkpatch tool reports an error at variable audit_sig_sid declaration "ERROR: do not initialise globals to 0" To fix this, the global variable has been uninitialized. Signed-off-by: Jules Irenge --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index 8c201f414226..7b1a38a211a9 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -125,7 +125,7 @@ static u32 audit_backlog_wait_time = AUDIT_BACKLOG_WAIT_TIME; /* The identity of the user shutting down the audit system. */ kuid_t audit_sig_uid = INVALID_UID; pid_t audit_sig_pid = -1; -u32audit_sig_sid = 0; +u32audit_sig_sid; /* Records can be lost in several ways: 0) [suppressed in audit_alloc] -- 2.26.2
[PATCH 4/4] context_tracking: uninitialize static variables
Checkpatch tool reports an error at a staic variable declaration "ERROR: do not initialise statics to false" This is due to the fact that this variable is stored in the buffer In the .bss section, one can not set an initial value Here we can trust the compiler to automatically set them to false. The variable has since been uninitialized. Signed-off-by: Jules Irenge --- kernel/context_tracking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 36a98c48aedc..21881c534152 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -190,7 +190,7 @@ NOKPROBE_SYMBOL(context_tracking_user_exit); void __init context_tracking_cpu_set(int cpu) { - static __initdata bool initialized = false; + static __initdata bool initialized; if (!per_cpu(context_tracking.active, cpu)) { per_cpu(context_tracking.active, cpu) = true; -- 2.26.2
[PATCH 0/4] Checkpatch tool errors clean up
Hi I am proposing these 4 patches. I am currently learning the core kernel the hard way. I will appreciate any feedback negative or positive. Thanks Jules Irenge (4): acct: Add required space between variable and operator audit: uninitialize global variable audit_sig_sid audit: uninitialize static variables context_tracking: uninitialize static variables kernel/acct.c | 2 +- kernel/audit.c| 10 +- kernel/context_tracking.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) -- 2.26.2
[PATCH 1/4] acct: Add required space between variable and operator
Checkpatch tool reports an error "ERROR: spaces required around that == (ctx:VxV)" To fix this space has been added between the variable, the operator and the value. Add the missing required space. Signed-off-by: Jules Irenge --- kernel/acct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/acct.c b/kernel/acct.c index b0c5b3a9f5af..d7cc5f917e11 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -451,7 +451,7 @@ static void fill_ac(acct_t *ac) do_div(elapsed, AHZ); btime = ktime_get_real_seconds() - elapsed; ac->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX); -#if ACCT_VERSION==2 +#if ACCT_VERSION == 2 ac->ac_ahz = AHZ; #endif -- 2.26.2
[PATCH 3/4] audit: uninitialize static variables
Checkpatch tool reports an error at variable declaration "ERROR: do not initialise statics to 0" This is due to the fact that these variables are stored in the buffer In the .bss section, one can not set an initial value Here we can trust the compiler to automatically set them to zero. The variable has since been uninitialized. Signed-off-by: Jules Irenge --- kernel/audit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/audit.c b/kernel/audit.c index 7b1a38a211a9..7d79ecb58b01 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -311,8 +311,8 @@ void audit_panic(const char *message) static inline int audit_rate_check(void) { - static unsigned longlast_check = 0; - static int messages = 0; + static unsigned longlast_check; + static int messages; static DEFINE_SPINLOCK(lock); unsigned long flags; unsigned long now; @@ -348,7 +348,7 @@ static inline int audit_rate_check(void) */ void audit_log_lost(const char *message) { - static unsigned longlast_msg = 0; + static unsigned longlast_msg; static DEFINE_SPINLOCK(lock); unsigned long flags; unsigned long now; @@ -713,7 +713,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid, { int rc = 0; struct sk_buff *skb; - static unsigned int failed = 0; + static unsigned int failed; /* NOTE: kauditd_thread takes care of all our locking, we just use * the netlink info passed to us (e.g. sk and portid) */ -- 2.26.2
[tip: core/rcu] rcu/rcutorture: Replace 0 with false
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 8f43d5911b38f00dfa46169dcb1feb1e101dd906 Gitweb: https://git.kernel.org/tip/8f43d5911b38f00dfa46169dcb1feb1e101dd906 Author:Jules Irenge AuthorDate:Mon, 01 Jun 2020 19:45:48 +01:00 Committer: Paul E. McKenney CommitterDate: Mon, 29 Jun 2020 12:01:44 -07:00 rcu/rcutorture: Replace 0 with false Coccinelle reports a warning WARNING: Assignment of 0/1 to bool variable The root cause is that the variable lastphase is a bool, but is initialised with integer 0. This commit therefore replaces the 0 with a false. Signed-off-by: Jules Irenge Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 5911207..37455a1 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2185,7 +2185,7 @@ static void rcu_torture_barrier1cb(void *rcu_void) static int rcu_torture_barrier_cbs(void *arg) { long myid = (long)arg; - bool lastphase = 0; + bool lastphase = false; bool newphase; struct rcu_head rcu;
[tip: core/rcu] rcu: Replace 1 with true
The following commit has been merged into the core/rcu branch of tip: Commit-ID: e40bb921119814c6f746891af9cd37eccda616a4 Gitweb: https://git.kernel.org/tip/e40bb921119814c6f746891af9cd37eccda616a4 Author:Jules Irenge AuthorDate:Mon, 01 Jun 2020 19:45:49 +01:00 Committer: Paul E. McKenney CommitterDate: Mon, 29 Jun 2020 11:58:51 -07:00 rcu: Replace 1 with true Coccinelle reports a warning WARNING: Assignment of 0/1 to bool variable The root cause is that the variable lastphase is a bool, but is initialised with integer 1. This commit therefore replaces the 1 with a true. Signed-off-by: Jules Irenge Signed-off-by: Paul E. McKenney --- kernel/rcu/update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index ca17b77..a0ba885 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -207,7 +207,7 @@ void rcu_end_inkernel_boot(void) rcu_unexpedite_gp(); if (rcu_normal_after_boot) WRITE_ONCE(rcu_normal, 1); - rcu_boot_ended = 1; + rcu_boot_ended = true; } /*
[PATCH 5/5] sfc: add missing annotation for efx_ef10_try_update_nic_stats_vf()
Sparse reports a warning at efx_ef10_try_update_nic_stats_vf() warning: context imbalance in efx_ef10_try_update_nic_stats_vf() - unexpected unlock The root cause is the missing annotation at efx_ef10_try_update_nic_stats_vf() Add the missing _must_hold(>stats_lock) annotation Signed-off-by: Jules Irenge --- drivers/net/ethernet/sfc/ef10.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 3f16bd807c6e..e8bbbd366625 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -1820,6 +1820,7 @@ static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats, } static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx) + __must_hold(>stats_lock) { MCDI_DECLARE_BUF(inbuf, MC_CMD_MAC_STATS_IN_LEN); struct efx_ef10_nic_data *nic_data = efx->nic_data; -- 2.18.2
[PATCH 1/5] rcu/rcutorture: replace 0 with false
Coccinelle reports a warning WARNING: Assignment of 0/1 to bool variable The root cause is the variable lastphase is of bool type is initialised with integer 0 Replacing 0 with false fixes the issue. Signed-off-by: Jules Irenge --- kernel/rcu/rcutorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 5453bd557f43..a082bc402f9b 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2065,7 +2065,7 @@ static void rcu_torture_barrier1cb(void *rcu_void) static int rcu_torture_barrier_cbs(void *arg) { long myid = (long)arg; - bool lastphase = 0; + bool lastphase = false; bool newphase; struct rcu_head rcu; -- 2.18.2
[PATCH 0/5] cleanups
Jules Irenge (5): rcu/rcutorture: replace 0 with false rcu: replace 1 with true rcu: replace + with | x86/ftrace: Add annotations for ftrace_arch_code_modify_prepare() and ftrace_arch_code_modify_post_process() sfc: add missing annotation for efx_ef10_try_update_nic_stats_vf() arch/x86/kernel/ftrace.c| 2 ++ drivers/net/ethernet/sfc/ef10.c | 1 + kernel/rcu/rcutorture.c | 2 +- kernel/rcu/tree_plugin.h| 22 +++--- kernel/rcu/update.c | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) -- 2.18.2
[PATCH 4/5] x86/ftrace: Add annotations for ftrace_arch_code_modify_prepare() and ftrace_arch_code_modify_post_process()
Sparse reports warnings warning: context imbalance in ftrace_arch_code_modify_prepare() - wrong count at exit warning: context imbalance in ftrace_arch_code_modify_post_process() - wrong count at exit The root cause is that even if the annotations on the function are correct, mutex do not support annotation This makes Sparse to complain. To fix this, __acquire(_mutex) and __release(_mutex) annotations are added inside ftrace_arch_code_modify_prepare() and ftrace_arch_code_modify_post_process() respectively. Signed-off-by: Jules Irenge --- arch/x86/kernel/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 37a0aeaf89e7..737c07ab2e07 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -46,6 +46,7 @@ int ftrace_arch_code_modify_prepare(void) * ftrace has it set to "read/write". */ mutex_lock(_mutex); + __acquire(_mutex); ftrace_poke_late = 1; return 0; } @@ -61,6 +62,7 @@ int ftrace_arch_code_modify_post_process(void) text_poke_finish(); ftrace_poke_late = 0; mutex_unlock(_mutex); + __release(_mutex); return 0; } -- 2.18.2
[PATCH 2/5] rcu: replace 1 with true
Coccinelle reports a warning WARNING: Assignment of 0/1 to bool variable The root cause is the variable rcu_boot_ended of bool type is initialised with integer 1 Replacing 1 with true fixes the issue. Signed-off-by: Jules Irenge --- kernel/rcu/update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 28a8bdc5072f..c18ae0cca512 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -193,7 +193,7 @@ void rcu_end_inkernel_boot(void) rcu_unexpedite_gp(); if (rcu_normal_after_boot) WRITE_ONCE(rcu_normal, 1); - rcu_boot_ended = 1; + rcu_boot_ended = true; } /* -- 2.18.2
[PATCH 3/5] rcu: replace + with |
Coccinelle reports warnings at rcu_preempt_ctxt_queue() WARNING: sum of probable bitmasks, consider | The root cause is the use of addition operator + for bitmask defined macros variables Replacing + with | fixes the issue. Signed-off-by: Jules Irenge --- kernel/rcu/tree_plugin.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 097635c41135..a20135ece06a 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -153,9 +153,9 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp) switch (blkd_state) { case 0: caseRCU_EXP_TASKS: - caseRCU_EXP_TASKS + RCU_GP_BLKD: + caseRCU_EXP_TASKS | RCU_GP_BLKD: case RCU_GP_TASKS: - case RCU_GP_TASKS + RCU_EXP_TASKS: + case RCU_GP_TASKS | RCU_EXP_TASKS: /* * Blocking neither GP, or first task blocking the normal @@ -168,10 +168,10 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp) case RCU_EXP_BLKD: caseRCU_GP_BLKD: - caseRCU_GP_BLKD + RCU_EXP_BLKD: - case RCU_GP_TASKS + RCU_EXP_BLKD: - case RCU_GP_TASKS + RCU_GP_BLKD + RCU_EXP_BLKD: - case RCU_GP_TASKS + RCU_EXP_TASKS + RCU_GP_BLKD + RCU_EXP_BLKD: + caseRCU_GP_BLKD | RCU_EXP_BLKD: + case RCU_GP_TASKS | RCU_EXP_BLKD: + case RCU_GP_TASKS | RCU_GP_BLKD | RCU_EXP_BLKD: + case RCU_GP_TASKS | RCU_EXP_TASKS | RCU_GP_BLKD | RCU_EXP_BLKD: /* * First task arriving that blocks either GP, or first task @@ -184,9 +184,9 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp) list_add_tail(>rcu_node_entry, >blkd_tasks); break; - caseRCU_EXP_TASKS + RCU_EXP_BLKD: - caseRCU_EXP_TASKS + RCU_GP_BLKD + RCU_EXP_BLKD: - case RCU_GP_TASKS + RCU_EXP_TASKS + RCU_EXP_BLKD: + caseRCU_EXP_TASKS | RCU_EXP_BLKD: + caseRCU_EXP_TASKS | RCU_GP_BLKD | RCU_EXP_BLKD: + case RCU_GP_TASKS | RCU_EXP_TASKS | RCU_EXP_BLKD: /* * Second or subsequent task blocking the expedited GP. @@ -197,8 +197,8 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp) list_add(>rcu_node_entry, rnp->exp_tasks); break; - case RCU_GP_TASKS + RCU_GP_BLKD: - case RCU_GP_TASKS + RCU_EXP_TASKS + RCU_GP_BLKD: + case RCU_GP_TASKS | RCU_GP_BLKD: + case RCU_GP_TASKS | RCU_EXP_TASKS | RCU_GP_BLKD: /* * Second or subsequent task blocking the normal GP. -- 2.18.2
[tip: core/rcu] rcu: Replace 1 by true
The following commit has been merged into the core/rcu branch of tip: Commit-ID: da44cd6c8e88b6da3d5277d0e7b0e4d38faf4532 Gitweb: https://git.kernel.org/tip/da44cd6c8e88b6da3d5277d0e7b0e4d38faf4532 Author:Jules Irenge AuthorDate:Mon, 30 Mar 2020 02:24:48 +01:00 Committer: Paul E. McKenney CommitterDate: Mon, 27 Apr 2020 11:01:16 -07:00 rcu: Replace 1 by true Coccinelle reports a warning at use_softirq declaration WARNING: Assignment of 0/1 to bool variable The root cause is use_softirq a variable of bool type is initialised with the integer 1 Replacing 1 with value true solve the issue. Signed-off-by: Jules Irenge Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 183b9cf..940c62a 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -113,7 +113,7 @@ static struct rcu_state rcu_state = { static bool dump_tree; module_param(dump_tree, bool, 0444); /* By default, use RCU_SOFTIRQ instead of rcuc kthreads. */ -static bool use_softirq = 1; +static bool use_softirq = true; module_param(use_softirq, bool, 0444); /* Control rcu_node-tree auto-balancing at boot time. */ static bool rcu_fanout_exact;
[tip: core/rcu] rcu: Replace assigned pointer ret value by corresponding boolean value
The following commit has been merged into the core/rcu branch of tip: Commit-ID: a66dbda7893f48b97d7406ae42fa29190aa672a0 Gitweb: https://git.kernel.org/tip/a66dbda7893f48b97d7406ae42fa29190aa672a0 Author:Jules Irenge AuthorDate:Fri, 27 Mar 2020 21:23:53 Committer: Paul E. McKenney CommitterDate: Mon, 27 Apr 2020 11:01:16 -07:00 rcu: Replace assigned pointer ret value by corresponding boolean value Coccinelle reports warnings at rcu_read_lock_held_common() WARNING: Assignment of 0/1 to bool variable To fix this, the assigned pointer ret values are replaced by corresponding boolean value. Given that ret is a pointer of bool type Signed-off-by: Jules Irenge Signed-off-by: Paul E. McKenney --- kernel/rcu/update.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 72461dd..17f2356 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -98,15 +98,15 @@ module_param(rcu_normal_after_boot, int, 0); static bool rcu_read_lock_held_common(bool *ret) { if (!debug_lockdep_rcu_enabled()) { - *ret = 1; + *ret = true; return true; } if (!rcu_is_watching()) { - *ret = 0; + *ret = false; return true; } if (!rcu_lockdep_current_cpu_online()) { - *ret = 0; + *ret = false; return true; } return false;
[PATCH 0/2] Lock warning cleanup
This patchset proposes a solution to functions that regiter context imbalance warnin, we add annotations to fix the warnings. Jules Irenge (2): cxgb4: Add missing annotation for service_ofldq() spi: atmel: Add missing annotation for atmel_spi_next_xfer_dma_submit() drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 + drivers/spi/spi-atmel.c | 1 + 2 files changed, 2 insertions(+) -- 2.26.2
[PATCH 2/2] spi: atmel: Add missing annotation for atmel_spi_next_xfer_dma_submit()
Sparse reports a warning at atmel_spi_next_xfer_dma_submit() warning: context imbalance in atmel_spi_next_xfer_dma_submit() - unexpected unlock The root cause is the missing annotation at atmel_spi_next_xfer_dma_submit() Add the missing __must_hold(>lock) annotation Signed-off-by: Jules Irenge --- drivers/spi/spi-atmel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 013458cabe3c..57ee8c3b7972 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -706,6 +706,7 @@ static void atmel_spi_next_xfer_pio(struct spi_master *master, static int atmel_spi_next_xfer_dma_submit(struct spi_master *master, struct spi_transfer *xfer, u32 *plen) + __must_hold(>lock) { struct atmel_spi*as = spi_master_get_devdata(master); struct dma_chan *rxchan = master->dma_rx; -- 2.26.2
[PATCH 1/2] cxgb4: Add missing annotation for service_ofldq()
Sparse reports a warning at service_ofldq() warning: context imbalance in service_ofldq() - unexpected unlock The root cause is the missing annotation at service_ofldq() Add the missing __must_hold(>sendq.lock) annotation Signed-off-by: Jules Irenge --- drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 97cda501e7e8..5da8eb6eb9b3 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -2702,6 +2702,7 @@ static void ofldtxq_stop(struct sge_uld_txq *q, struct fw_wr_hdr *wr) * is ever running at a time ... */ static void service_ofldq(struct sge_uld_txq *q) + __must_hold(>sendq.lock) { u64 *pos, *before, *end; int credits; -- 2.26.2
[PATCH v2] net: atm: Add annotation for lec_priv_walk() and lec_seq_stop()
Sparse reports a warning at lec_priv_walk() and lec_seq_stop() warning: context imbalance in lec_priv_walk() - unexpected unlock warning: context imbalance in lec_seq_stop() - unexpected unlock The root cause is the missing annotation at lec_priv_walk() and lec_seq_stop() To fix this, __acquire() and __release() annotations are added in case conditions are not met. This only instruct Sparse to shutdown the warning Add the __acquire(>lec_arp_lock) Add __release(>lec_arp_lock) annotation Add __releases(>locked->lec_arp_lock) annotation Add __release(>locked->lec_arp_lock) annotation Signed-off-by: Jules Irenge --- Changes since v2 - merge patch No 6 and No 4 into one net/atm/lec.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/atm/lec.c b/net/atm/lec.c index 25fa3a7b72bd..7947abb17af2 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -886,12 +886,18 @@ static void *lec_priv_walk(struct lec_state *state, loff_t *l, if (!state->locked) { state->locked = priv; spin_lock_irqsave(>lec_arp_lock, state->flags); + } else { + /* annotation for sparse */ + __acquire(>lec_arp_lock); } if (!lec_arp_walk(state, l, priv) && !lec_misc_walk(state, l, priv)) { spin_unlock_irqrestore(>lec_arp_lock, state->flags); state->locked = NULL; /* Partial state reset for the next time we get called */ state->arp_table = state->misc_table = 0; + } else { + /* annotation for sparse */ + __release(>lec_arp_lock); } return state->locked; } @@ -940,6 +946,7 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos) } static void lec_seq_stop(struct seq_file *seq, void *v) + __releases(>locked->lec_arp_lock) { struct lec_state *state = seq->private; @@ -947,6 +954,9 @@ static void lec_seq_stop(struct seq_file *seq, void *v) spin_unlock_irqrestore(>locked->lec_arp_lock, state->flags); dev_put(state->dev); + } else { + /* annotation for sparse */ + __release(>locked->lec_arp_lock); } } -- 2.25.3
[PATCH 1/6] usb: gadget: Add missing annotation for xudc_handle_setup()
Sparse reports a warning at xudc_handle_setup() warning: context imbalance in xudc_handle_setup() - unexpected unlock The root cause is the missing annotation at xudc_handle_setup() Add the missing __must_hold(>lock) annotation Signed-off-by: Jules Irenge --- drivers/usb/gadget/udc/udc-xilinx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index 29d8e5f8bb58..ae22882dba6a 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1733,6 +1733,7 @@ static void xudc_set_clear_feature(struct xusb_udc *udc) * Process setup packet and delegate to gadget layer. */ static void xudc_handle_setup(struct xusb_udc *udc) + __must_hold(>lock) { struct xusb_ep *ep0 = >ep[0]; struct usb_ctrlrequest setup; -- 2.25.3
[PATCH 3/6] udp: Add annotations for udp_rmem_release()
Sparse reports a warning warning: context imbalance in udp_rmem_release() - unexpected unlock To fix this, __acquire(_queue->lock) and __release(_queue->lock) annotations are added in case the condition is not met. This add basically tell Sparse and not GCC to shutdown the warning Add __acquire(_queue->lock) annotation Add the __release(_queue->lock) annotation Signed-off-by: Jules Irenge --- net/ipv4/udp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 5ca12a945ac3..175bd14bfac8 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1382,6 +1382,9 @@ static void udp_rmem_release(struct sock *sk, int size, int partial, sk_queue = >sk_receive_queue; if (!rx_queue_lock_held) spin_lock(_queue->lock); + else + /* annotation for sparse */ + __acquire(_queue->lock); sk->sk_forward_alloc += size; @@ -1398,6 +1401,9 @@ static void udp_rmem_release(struct sock *sk, int size, int partial, if (!rx_queue_lock_held) spin_unlock(_queue->lock); + else + /* annotation for sparse */ + __release(_queue->lock); } /* Note: called with reader_queue.lock held. -- 2.25.3
[PATCH 0/6] Lock warnings cleanup
This patch serie propose a solution to functions that record context imbalance by adding annotations Jules Irenge (6): usb: gadget: Add missing annotation for xudc_handle_setup() udp: Add missing annotations for busylock_acquire() and busylock_release() udp: Add annotations for udp_rmem_release() net: atm: Add missing annotation for lec_seq_stop() USB: dummy-hcd: Add missing annotation for set_link_state() net: atm: Add annotation for lec_priv_walk() drivers/usb/gadget/udc/dummy_hcd.c | 1 + drivers/usb/gadget/udc/udc-xilinx.c | 1 + net/atm/lec.c | 11 ++- net/ipv4/udp.c | 11 +++ 4 files changed, 23 insertions(+), 1 deletion(-) -- 2.25.3
[PATCH 6/6] net: atm: Add annotation for lec_priv_walk()
Sparse reports a warning at lec_priv_walk() warning: context imbalance in lec_priv_walk() - unexpected unlock The root cause is the missing annotation at lec_priv_walk() To fix this, __acquire() and __release() annotations are added in case conditions are not met. This only instruct Sparse to shutdown the warning Add the __acquire(>lec_arp_lock) Add __release(>lec_arp_lock) annotation Signed-off-by: Jules Irenge --- net/atm/lec.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/atm/lec.c b/net/atm/lec.c index 22415bc11878..6070acaa3d5c 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -886,12 +886,18 @@ static void *lec_priv_walk(struct lec_state *state, loff_t *l, if (!state->locked) { state->locked = priv; spin_lock_irqsave(>lec_arp_lock, state->flags); + } else { + /* annotation for sparse */ + __acquire(>lec_arp_lock); } if (!lec_arp_walk(state, l, priv) && !lec_misc_walk(state, l, priv)) { spin_unlock_irqrestore(>lec_arp_lock, state->flags); state->locked = NULL; /* Partial state reset for the next time we get called */ state->arp_table = state->misc_table = 0; + } else { + /* annotation for sparse */ + __release(>lec_arp_lock); } return state->locked; } -- 2.25.3
[PATCH 2/6] udp: Add missing annotations for busylock_acquire() and busylock_release()
Sparse reports warnings warning: context imbalance in busylock_acquire() - wrong count at exit warning: context imbalance in busylock_release() - unexpected unlock The root cause is the missing annotations at busylock_acquire() and busylock_release() The __release(busy) annotation inside busylock_release() tells Sparse and not GCC to shutdown the warning in case the condition is not satisfied. Add the missing __acquires(busy) annotation Add the missing __releases(busy) annotation Add the __release(busy) annotation Signed-off-by: Jules Irenge --- net/ipv4/udp.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index db76b9609299..5ca12a945ac3 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1430,6 +1430,7 @@ static int udp_busylocks_log __read_mostly; static spinlock_t *udp_busylocks __read_mostly; static spinlock_t *busylock_acquire(void *ptr) + __acquires(busy) { spinlock_t *busy; @@ -1439,9 +1440,13 @@ static spinlock_t *busylock_acquire(void *ptr) } static void busylock_release(spinlock_t *busy) + __releases(busy) { if (busy) spin_unlock(busy); + else + /* annotation for sparse */ + __release(busy); } int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb) -- 2.25.3
[PATCH 5/6] USB: dummy-hcd: Add missing annotation for set_link_state()
Sparse reports a warning at set_link_state() warning: context imbalance in set_link_state() - unexpected unlock The root cause is the missing annotation at set_link_state() Add the missing __must_hold(>lock) Signed-off-by: Jules Irenge --- drivers/usb/gadget/udc/dummy_hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 4c9d1e49d5ed..c07ddf11e137 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -427,6 +427,7 @@ static void set_link_state_by_speed(struct dummy_hcd *dum_hcd) /* caller must hold lock */ static void set_link_state(struct dummy_hcd *dum_hcd) + __must_hold(>lock) { struct dummy *dum = dum_hcd->dum; unsigned int power_bit; -- 2.25.3
[PATCH 4/6] net: atm: Add missing annotation for lec_seq_stop()
Sparse reports a warning at lec_seq_stop() warning: context imbalance in lec_seq_stop() - unexpected unlock The root cause is the missing annotation at lec_seq_stop() The __release() annotation inside lec_seq_stop() tells only Sparse to shutdown the warning Add the missing __releases(>locked->lec_arp_lock) Add __release(>locked->lec_arp_lock) annotation Signed-off-by: Jules Irenge --- net/atm/lec.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/atm/lec.c b/net/atm/lec.c index 25fa3a7b72bd..22415bc11878 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -940,6 +940,7 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos) } static void lec_seq_stop(struct seq_file *seq, void *v) + __releases(>locked->lec_arp_lock) { struct lec_state *state = seq->private; @@ -947,7 +948,9 @@ static void lec_seq_stop(struct seq_file *seq, void *v) spin_unlock_irqrestore(>locked->lec_arp_lock, state->flags); dev_put(state->dev); - } + } else + /* annotation for sparse */ + __release(>locked->lec_arp_lock); } static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos) -- 2.25.3
Re: [PATCH v1 1/5] staging: wfx: fix warnings of no space is necessary
On Sat, 19 Oct 2019, Dan Carpenter wrote: > On Sat, Oct 19, 2019 at 03:07:15PM +0100, Jules Irenge wrote: > > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c > > index 3355183fc86c..573216b08042 100644 > > --- a/drivers/staging/wfx/bh.c > > +++ b/drivers/staging/wfx/bh.c > > @@ -69,13 +69,13 @@ static int rx_helper(struct wfx_dev *wdev, size_t > > read_len, int *is_cnf) > > if (wfx_data_read(wdev, skb->data, alloc_len)) > > goto err; > > > > - piggyback = le16_to_cpup((u16 *) (skb->data + alloc_len - 2)); > > + piggyback = le16_to_cpup((u16 *)(skb->data + alloc_len - 2)); > > _trace_piggyback(piggyback, false); > > > > - hif = (struct hif_msg *) skb->data; > > + hif = (struct hif_msg *)skb->data; > > WARN(hif->encrypted & 0x1, "unsupported encryption type"); > > if (hif->encrypted == 0x2) { > > - if (wfx_sl_decode(wdev, (void *) hif)) { > > + if (wfx_sl_decode(wdev, (void *)hif)) { > > In the future you may want to go through and remove the (void *) casts. > It's not required here. > > > diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c > > index f65f7d75e731..effd07957753 100644 > > --- a/drivers/staging/wfx/bus_spi.c > > +++ b/drivers/staging/wfx/bus_spi.c > > @@ -90,7 +90,7 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int > > addr, > > struct wfx_spi_priv *bus = priv; > > u16 regaddr = (addr << 12) | (count / 2); > > // FIXME: use a bounce buffer > > - u16 *src16 = (void *) src; > > + u16 *src16 = (void *)src; > > Here we are just getting rid of the constness. Apparently we are doing > that so we can modify it without GCC pointing out the bug!! I don't > know the code but this seems very wrong. > Checkpatch was complaining about space between type cast and the variable. I just get rid of the space. Well I don't know whether this was false positive one. Thanks for the feedback. I will update the patch. Regards, Jules
[PATCH v1 0/5] staging: wfx: fix checkpatch warnings
Fix checkpatch warnings. Jules Irenge (5): staging: wfx: fix warnings of no space is necessary staging: wfx: fix warning of line over 80 characters staging: wfx: fix warnings of logical continuation staging: wfx: correct misspelled words staging: wfx: fix warnings of alignment should match open parenthesis drivers/staging/wfx/bh.c | 25 --- drivers/staging/wfx/bus.h | 6 +- drivers/staging/wfx/bus_sdio.c | 9 +-- drivers/staging/wfx/bus_spi.c | 11 +-- drivers/staging/wfx/data_rx.c | 35 + drivers/staging/wfx/data_tx.c | 127 + drivers/staging/wfx/data_tx.h | 4 +- drivers/staging/wfx/debug.c| 14 ++-- 8 files changed, 143 insertions(+), 88 deletions(-) -- 2.21.0
[PATCH v1 3/5] staging: wfx: fix warnings of logical continuation
Fix check warnings of logical continuations should be on the previous line. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/wfx/data_rx.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index 522592d71aac..52fb0f255dcd 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -163,14 +163,14 @@ void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, } /* Filter block ACK negotiation: fully controlled by firmware */ - if (ieee80211_is_action(frame->frame_control) - && arg->rx_flags.match_uc_addr - && mgmt->u.action.category == WLAN_CATEGORY_BACK) + if (ieee80211_is_action(frame->frame_control) && + arg->rx_flags.match_uc_addr && + mgmt->u.action.category == WLAN_CATEGORY_BACK) goto drop; - if (ieee80211_is_beacon(frame->frame_control) - && !arg->status && wvif->vif - && ether_addr_equal(ieee80211_get_SA(frame), - wvif->vif->bss_conf.bssid)) { + if (ieee80211_is_beacon(frame->frame_control) && + !arg->status && wvif->vif && + ether_addr_equal(ieee80211_get_SA(frame), +wvif->vif->bss_conf.bssid)) { const u8 *tim_ie; u8 *ies = mgmt->u.beacon.variable; size_t ies_len = skb->len - (ies - skb->data); -- 2.21.0
[PATCH v1 5/5] staging: wfx: fix warnings of alignment should match open parenthesis
: Fix warnings of alignment should match open parenthesis. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/wfx/data_rx.c | 2 +- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/debug.c | 14 -- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index 52fb0f255dcd..e7fcce8d0cc4 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -77,7 +77,7 @@ static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, s break; default: dev_err(wdev->dev, "unknown encryption type %d\n", -arg->rx_flags.encryp); + arg->rx_flags.encryp); return -EIO; } diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index a02692f3210d..ea4205ac2149 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -40,7 +40,7 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, /* TX policy cache implementation */ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, - struct ieee80211_tx_rate *rates) + struct ieee80211_tx_rate *rates) { int i; size_t count; diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index 761ad9b4f27e..0a9ca109039c 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -141,10 +141,11 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) mutex_lock(>rx_stats_lock); seq_printf(seq, "Timestamp: %dus\n", st->date); seq_printf(seq, "Low power clock: frequency %uHz, external %s\n", - st->pwr_clk_freq, - st->is_ext_pwr_clk ? "yes" : "no"); - seq_printf(seq, "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", - st->nb_rx_frame, st->per_total, st->throughput); + st->pwr_clk_freq, + st->is_ext_pwr_clk ? "yes" : "no"); + seq_printf(seq, + "N. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", + st->nb_rx_frame, st->per_total, st->throughput); seq_puts(seq, " Num. of PER RSSI SNR CFO\n"); seq_puts(seq, "frames (x10e4)(dBm) (dB)(kHz)\n"); for (i = 0; i < ARRAY_SIZE(channel_names); i++) { @@ -160,8 +161,9 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) } DEFINE_SHOW_ATTRIBUTE(wfx_rx_stats); -static ssize_t wfx_send_pds_write(struct file *file, const char __user *user_buf, -size_t count, loff_t *ppos) +static ssize_t wfx_send_pds_write(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) { struct wfx_dev *wdev = file->private_data; char *buf; -- 2.21.0
[PATCH v1 4/5] staging: wfx: correct misspelled words
Correct misspelled words: retrieved and auxiliary. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/wfx/data_tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 619ab2cac5fc..a02692f3210d 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -32,7 +32,7 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, } return rate->idx + 14; } - // WFx only support 2GHz, else band information should be retreived + // WFx only support 2GHz, else band information should be retrieved // from ieee80211_tx_info return wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->bitrates[rate->idx].hw_value; } @@ -664,7 +664,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->ht_tx_parameters = wfx_tx_get_tx_parms(wvif->wdev, tx_info); req->tx_flags.retry_policy_index = wfx_tx_get_rate_id(wvif, tx_info); - // Auxilliary operations + // Auxiliary operations wfx_tx_manage_pm(wvif, hdr, tx_priv, sta); wfx_tx_queue_put(wvif->wdev, >wdev->tx_queue[queue_id], skb); wfx_bh_request_tx(wvif->wdev); -- 2.21.0
[PATCH v1 1/5] staging: wfx: fix warnings of no space is necessary
Fix warnings of no space is necessary after a cast. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/wfx/bh.c | 8 drivers/staging/wfx/bus_sdio.c | 6 +++--- drivers/staging/wfx/bus_spi.c | 2 +- drivers/staging/wfx/data_rx.c | 8 drivers/staging/wfx/data_tx.c | 20 ++-- drivers/staging/wfx/data_tx.h | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 3355183fc86c..573216b08042 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -69,13 +69,13 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) if (wfx_data_read(wdev, skb->data, alloc_len)) goto err; - piggyback = le16_to_cpup((u16 *) (skb->data + alloc_len - 2)); + piggyback = le16_to_cpup((u16 *)(skb->data + alloc_len - 2)); _trace_piggyback(piggyback, false); - hif = (struct hif_msg *) skb->data; + hif = (struct hif_msg *)skb->data; WARN(hif->encrypted & 0x1, "unsupported encryption type"); if (hif->encrypted == 0x2) { - if (wfx_sl_decode(wdev, (void *) hif)) { + if (wfx_sl_decode(wdev, (void *)hif)) { dev_kfree_skb(skb); // If frame was a confirmation, expect trouble in next // exchange. However, it is harmless to fail to decode @@ -102,7 +102,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) if (!(hif->id & HIF_ID_IS_INDICATION)) { (*is_cnf)++; if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT) - release_count = le32_to_cpu(((struct hif_cnf_multi_transmit *) hif->body)->num_tx_confs); + release_count = le32_to_cpu(((struct hif_cnf_multi_transmit *)hif->body)->num_tx_confs); else release_count = 1; WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter"); diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c index f97360513150..184e20dfdd62 100644 --- a/drivers/staging/wfx/bus_sdio.c +++ b/drivers/staging/wfx/bus_sdio.c @@ -38,7 +38,7 @@ static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id, int ret; WARN(reg_id > 7, "chip only has 7 registers"); - WARN(((uintptr_t) dst) & 3, "unaligned buffer size"); + WARN(((uintptr_t)dst) & 3, "unaligned buffer size"); WARN(count & 3, "unaligned buffer address"); /* Use queue mode buffers */ @@ -59,14 +59,14 @@ static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id, int ret; WARN(reg_id > 7, "chip only has 7 registers"); - WARN(((uintptr_t) src) & 3, "unaligned buffer size"); + WARN(((uintptr_t)src) & 3, "unaligned buffer size"); WARN(count & 3, "unaligned buffer address"); /* Use queue mode buffers */ if (reg_id == WFX_REG_IN_OUT_QUEUE) sdio_addr |= bus->buf_id_tx << 7; // FIXME: discards 'const' qualifier for src - ret = sdio_memcpy_toio(bus->func, sdio_addr, (void *) src, count); + ret = sdio_memcpy_toio(bus->func, sdio_addr, (void *)src, count); if (!ret && reg_id == WFX_REG_IN_OUT_QUEUE) bus->buf_id_tx = (bus->buf_id_tx + 1) % 32; diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index f65f7d75e731..effd07957753 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -90,7 +90,7 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr, struct wfx_spi_priv *bus = priv; u16 regaddr = (addr << 12) | (count / 2); // FIXME: use a bounce buffer - u16 *src16 = (void *) src; + u16 *src16 = (void *)src; int ret, i; struct spi_message m; struct spi_transfer t_addr = { diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index 3a79089c8501..3a79ab93e97e 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -29,7 +29,7 @@ static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb) rcu_read_lock(); sta = ieee80211_find_sta(wvif->vif, pspoll->ta); if (sta) - link_id = ((struct wfx_sta_priv *) >drv_priv)->link_id; + link_id = ((struct wfx_sta_priv *)>drv_priv)->link_id; rcu_read_unlock(); if (link_id) pspoll_mask = BIT(link_id); @@ -102,8 +102,8 @@ void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, struct sk_buff *skb { int link_id = arg-&
[PATCH v1 2/5] staging: wfx: fix warning of line over 80 characters
Fix warning of lines over 80 characters. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/wfx/bh.c | 17 -- drivers/staging/wfx/bus.h | 6 +- drivers/staging/wfx/bus_sdio.c | 3 +- drivers/staging/wfx/bus_spi.c | 9 ++- drivers/staging/wfx/data_rx.c | 15 +++-- drivers/staging/wfx/data_tx.c | 101 ++--- 6 files changed, 102 insertions(+), 49 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 573216b08042..955ed3a1dd73 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -32,7 +32,8 @@ static void device_wakeup(struct wfx_dev *wdev) // completion without consume it (a kind of // wait_for_completion_done_timeout()). So we have to emulate // it. - if (wait_for_completion_timeout(>hif.ctrl_ready, msecs_to_jiffies(2) + 1)) + if (wait_for_completion_timeout(>hif.ctrl_ready, + msecs_to_jiffies(2) + 1)) complete(>hif.ctrl_ready); else dev_err(wdev->dev, "timeout while wake up chip\n"); @@ -179,8 +180,9 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif) wdev->hif.tx_seqnum = (wdev->hif.tx_seqnum + 1) % (HIF_COUNTER_MAX + 1); if (wfx_is_secure_command(wdev, hif->id)) { - len = round_up(len - sizeof(hif->len), 16) + sizeof(hif->len) - + sizeof(struct hif_sl_msg_hdr) + sizeof(struct hif_sl_tag); + len = round_up(len - sizeof(hif->len), 16) + sizeof(hif->len) + + sizeof(struct hif_sl_msg_hdr) + + sizeof(struct hif_sl_tag); // AES support encryption in-place. However, mac80211 access to // 802.11 header after frame was sent (to get MAC addresses). // So, keep origin buffer clear. @@ -241,7 +243,8 @@ static void ack_sdio_data(struct wfx_dev *wdev) config_reg_read(wdev, _reg); if (cfg_reg & 0xFF) { - dev_warn(wdev->dev, "chip reports errors: %02x\n", cfg_reg & 0xFF); + dev_warn(wdev->dev, "chip reports errors: %02x\n", +cfg_reg & 0xFF); config_reg_write_bits(wdev, 0xFF, 0x00); } } @@ -268,11 +271,13 @@ static void bh_work(struct work_struct *work) if (last_op_is_rx) ack_sdio_data(wdev); - if (!wdev->hif.tx_buffers_used && !work_pending(work) && !atomic_read(>scan_in_progress)) { + if (!wdev->hif.tx_buffers_used && !work_pending(work) && + !atomic_read(>scan_in_progress)) { device_release(wdev); release_chip = true; } - _trace_bh_stats(stats_ind, stats_req, stats_cnf, wdev->hif.tx_buffers_used, release_chip); + _trace_bh_stats(stats_ind, stats_req, stats_cnf, + wdev->hif.tx_buffers_used, release_chip); } /* diff --git a/drivers/staging/wfx/bus.h b/drivers/staging/wfx/bus.h index eb77abc09ec2..62d6ecabe4cb 100644 --- a/drivers/staging/wfx/bus.h +++ b/drivers/staging/wfx/bus.h @@ -21,8 +21,10 @@ #define WFX_REG_FRAME_OUT 0x7 struct hwbus_ops { - int (*copy_from_io)(void *bus_priv, unsigned int addr, void *dst, size_t count); - int (*copy_to_io)(void *bus_priv, unsigned int addr, const void *src, size_t count); + int (*copy_from_io)(void *bus_priv, unsigned int addr, + void *dst, size_t count); + int (*copy_to_io)(void *bus_priv, unsigned int addr, + const void *src, size_t count); void (*lock)(void *bus_priv); void (*unlock)(void *bus_priv); size_t (*align_size)(void *bus_priv, size_t size); diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c index 184e20dfdd62..375e07d6d9ae 100644 --- a/drivers/staging/wfx/bus_sdio.c +++ b/drivers/staging/wfx/bus_sdio.c @@ -180,7 +180,8 @@ static int wfx_sdio_probe(struct sdio_func *func, } bus->of_irq = irq_of_parse_and_map(np, 0); } else { - dev_warn(>dev, "device is not declared in DT, features will be limited\n"); + dev_warn(>dev, +"device is not declared in DT, features will be limited\n"); // FIXME: ignore VID/PID and only rely on device tree // return -ENODEV; } diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index effd07957753..ab0cda1e124f 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -178,11 +178,14 @@ static int wfx_spi_probe(struct spi_device *func) retur
Re: [Outreachy kernel] [PATCH] staging: vc04_services: fix line over 80 characters checks warning
On Wed, 16 Oct 2019, Julia Lawall wrote: > > #ifndef VCHI_BULK_GRANULARITY > > # if __VCCOREVER__ >= 0x0400 > > -# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache > > cleans > > +# define VCHI_BULK_GRANULARITY 32 // Allows for the need of cache cleans > > # else > > # define VCHI_BULK_GRANULARITY 16 > > # endif > > The branches should be indented to the same degree. > > julia > > -- Thanks, I have just updated.
[PATCH] staging: vc04_services: add space to fix check warning
Add space betwen operator to fix check warning. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/vc04_services/interface/vchi/vchi_cfg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h b/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h index dbb6a5f07a79..192c287503a5 100644 --- a/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h +++ b/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h @@ -163,9 +163,9 @@ * by suspending parsing as the comment above says, but we don't. * This sweeps the issue under the carpet. */ -#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS +#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE / 16 + 1) * VCHI_NUM_READ_SLOTS # undef VCHI_RX_MSG_QUEUE_SIZE -# define VCHI_RX_MSG_QUEUE_SIZE ((VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS) +# define VCHI_RX_MSG_QUEUE_SIZE ((VCHI_MAX_MSG_SIZE / 16 + 1) * VCHI_NUM_READ_SLOTS) #endif /* How many bulk transmits can we have pending. Once exhausted, -- 2.21.0
[PATCH] staging: vc04_services: fix line over 80 characters checks warning
Fix line over 80 characters checks warning. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- .../vc04_services/interface/vchi/vchi_cfg.h | 150 ++ 1 file changed, 88 insertions(+), 62 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h b/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h index 89aa4e6122cd..dbb6a5f07a79 100644 --- a/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h +++ b/drivers/staging/vc04_services/interface/vchi/vchi_cfg.h @@ -4,13 +4,17 @@ #ifndef VCHI_CFG_H_ #define VCHI_CFG_H_ -/ - * Defines in this first section are part of the VCHI API and may be examined by VCHI - * services. - ***/ - -/* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */ -/* Really determined by the message driver, and should be available from a run-time call. */ +/* + * Defines in this first section are part of the VCHI API and may be examined + * by VCHI services. + */ + +/* Required alignment of base addresses for bulk transfer, if unaligned + * transfers are not enabled + * + * Really determined by the message driver, and should be available from + * a run-time call. + */ #ifndef VCHI_BULK_ALIGN # if __VCCOREVER__ >= 0x0400 # define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans @@ -19,12 +23,15 @@ # endif #endif -/* Required length multiple for bulk transfers, if unaligned transfers are not enabled */ -/* May be less than or greater than VCHI_BULK_ALIGN */ -/* Really determined by the message driver, and should be available from a run-time call. */ +/* Required length multiple for bulk transfers, if unaligned transfers are + * not enabled + * May be less than or greater than VCHI_BULK_ALIGN + * Really determined by the message driver, and should be available from + * a run-time call. + */ #ifndef VCHI_BULK_GRANULARITY # if __VCCOREVER__ >= 0x0400 -# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans +# define VCHI_BULK_GRANULARITY 32 // Allows for the need of cache cleans # else # define VCHI_BULK_GRANULARITY 16 # endif @@ -39,19 +46,22 @@ # endif #endif -/** - * Defines below are system configuration options, and should not be used by VCHI services. - */ +/*** + * Defines below are system configuration options, and should not be used by + * VCHI services. + **/ -/* How many connections can we support? A localhost implementation uses 2 connections, - * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW - * driver. */ +/* How many connections can we support? A localhost implementation + * uses 2 connections, 1 for host-app, 1 for VMCS, + * and these are hooked together by a loopback MPHI VCFW driver. + */ #ifndef VCHI_MAX_NUM_CONNECTIONS # define VCHI_MAX_NUM_CONNECTIONS 3 #endif -/* How many services can we open per connection? Extending this doesn't cost processing time, just a small - * amount of static memory. */ +/* How many services can we open per connection? Extending this doesn't cost + * processing time, just a small amount of static memory. + */ #ifndef VCHI_MAX_SERVICES_PER_CONNECTION # define VCHI_MAX_SERVICES_PER_CONNECTION 36 #endif @@ -66,8 +76,9 @@ # define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI #endif -/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective - * receive queue space, less message headers. */ +/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives + * the effective receive queue space, less message headers. + */ #ifndef VCHI_NUM_READ_SLOTS # if defined(VCHI_LOCAL_HOST_PORT) # define VCHI_NUM_READ_SLOTS 4 @@ -76,92 +87,107 @@ # endif #endif -/* Do we utilise overrun facility for receive message slots? Can aid peer transmit - * performance. Only define on VideoCore end, talking to host. +/* Do we utilise overrun facility for receive message slots? Can aid peer + * transmit performance. Only define on VideoCore end, talking to host. */ //#define VCHI_MSG_RX_OVERRUN -/* How many transmit slots do we use. Generally don't need many, as the hardware driver - * underneath VCHI will usually have its own buffering. */ +/* How many transmit slots do we use. Generally don'
Re: [Outreachy kernel] [PATCH 1/2] staging: vc04_services: fix lines ending with open parenthesis
On Sun, 13 Oct 2019, Julia Lawall wrote: > > > On Sun, 13 Oct 2019, Jules Irenge wrote: > > > Fix lines ending with open parenthesis. Issue detected by checkpatch tool. > > In the process, change driver functions name in the multiple files from: > > vchiq_mmal_port_parameter_set to vmp_prmtr_set > > vchiq_mmal_component_disable to vm_cmpnt_disable > > vchiq_mmal_port_connect_tunnel to vmp_cnnct_tunnel > > vchiq_mmal_component_enable to vm_cmpnt_enable > > You should say why you change the names. > > As far as I can see, there is no change to the actual function > definitions, so the code can't compile. Perhaps that comes later in the > series, but the elements of the series have to be ordered such that > compilation is possible after each patch. > > julia > Thanks for the feedback, I am updating it and will be compiling each point. Jules
[PATCH 2/2] staging: vc04_services: fix lines ending with open parenthesis
Fix lines ending with open parenthesis. Issue detected by checkpatch tool. Within "controls.c", "mmal-vchiq.c" and" mmal-vchiq.h" files. Signed-off-by: Jules Irenge --- .../vc04_services/bcm2835-camera/controls.c | 208 +- .../vc04_services/bcm2835-camera/mmal-vchiq.c | 20 +- .../vc04_services/bcm2835-camera/mmal-vchiq.h | 54 ++--- 3 files changed, 138 insertions(+), 144 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 89786c264867..015ace1e9506 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -67,10 +67,9 @@ enum bm2835_mmal_ctrl_type { struct bm2835_mmal_v4l2_ctrl; -typedefint(bm2835_mmal_v4l2_ctrl_cb)( - struct bm2835_mmal_dev *dev, - struct v4l2_ctrl *ctrl, - const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl); +typedefint(bm2835_mmal_v4l2_ctrl_cb)(struct bm2835_mmal_dev *dev, + struct v4l2_ctrl *ctrl, + const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl); struct bm2835_mmal_v4l2_ctrl { u32 id; /* v4l2 control identifier */ @@ -169,7 +168,7 @@ static int ctrl_set_rational(struct bm2835_mmal_dev *dev, rational_value.num = ctrl->val; rational_value.den = 100; - return vchiq_mmal_port_parameter_set(dev->instance, control, + return vmp_prmtr_set(dev->instance, control, mmal_ctrl->mmal_id, _value, sizeof(rational_value)); @@ -186,7 +185,7 @@ static int ctrl_set_value(struct bm2835_mmal_dev *dev, u32_value = ctrl->val; - return vchiq_mmal_port_parameter_set(dev->instance, control, + return vmp_prmtr_set(dev->instance, control, mmal_ctrl->mmal_id, _value, sizeof(u32_value)); } @@ -214,7 +213,7 @@ static int ctrl_set_iso(struct bm2835_mmal_dev *dev, else u32_value = 0; - return vchiq_mmal_port_parameter_set(dev->instance, control, + return vmp_prmtr_set(dev->instance, control, MMAL_PARAMETER_ISO, _value, sizeof(u32_value)); } @@ -230,7 +229,7 @@ static int ctrl_set_value_ev(struct bm2835_mmal_dev *dev, s32_value = (ctrl->val - 12) * 2; /* Convert from index to 1/6ths */ - return vchiq_mmal_port_parameter_set(dev->instance, control, + return vmp_prmtr_set(dev->instance, control, mmal_ctrl->mmal_id, _value, sizeof(s32_value)); } @@ -247,19 +246,19 @@ static int ctrl_set_rotate(struct bm2835_mmal_dev *dev, u32_value = ((ctrl->val % 360) / 90) * 90; - ret = vchiq_mmal_port_parameter_set(dev->instance, >output[0], - mmal_ctrl->mmal_id, - _value, sizeof(u32_value)); + ret = vmp_prmtr_set(dev->instance, >output[0], + mmal_ctrl->mmal_id, + _value, sizeof(u32_value)); if (ret < 0) return ret; - ret = vchiq_mmal_port_parameter_set(dev->instance, >output[1], - mmal_ctrl->mmal_id, - _value, sizeof(u32_value)); + ret = vmp_prmtr_set(dev->instance, >output[1], + mmal_ctrl->mmal_id, + _value, sizeof(u32_value)); if (ret < 0) return ret; - return vchiq_mmal_port_parameter_set(dev->instance, >output[2], + return vmp_prmtr_set(dev->instance, >output[2], mmal_ctrl->mmal_id, _value, sizeof(u32_value)); } @@ -288,21 +287,24 @@ static int ctrl_set_flip(struct bm2835_mmal_dev *dev, else u32_value = MMAL_PARAM_MIRROR_NONE; - ret = vchiq_mmal_port_parameter_set(dev->instance, >output[0], - mmal_ctrl->mmal_id, - _value, sizeof(u32_value)); + ret = vmp_prmtr_set(dev->instance, + >output[0], + mmal_ctrl->mmal_id, + _value, sizeof(u32_value)); if (ret < 0) return ret; - ret = vchiq_mmal_port_pa
[PATCH 1/2] staging: vc04_services: fix lines ending with open parenthesis
Fix lines ending with open parenthesis. Issue detected by checkpatch tool. In the process, change driver functions name in the multiple files from: vchiq_mmal_port_parameter_set to vmp_prmtr_set vchiq_mmal_component_disable to vm_cmpnt_disable vchiq_mmal_port_connect_tunnel to vmp_cnnct_tunnel vchiq_mmal_component_enable to vm_cmpnt_enable Signed-off-by: Jules Irenge --- .../bcm2835-camera/bcm2835-camera.c | 191 -- 1 file changed, 89 insertions(+), 102 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index beb6a0063bb8..0ffe95b3bfb2 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -337,12 +337,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, if (is_capturing(dev)) { v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Grab another frame"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, - MMAL_PARAMETER_CAPTURE, - >capture.frame_count, - sizeof(dev->capture.frame_count)); + vmp_prmtr_set(instance, + dev->capture.camera_port, + MMAL_PARAMETER_CAPTURE, + >capture.frame_count, + sizeof(dev->capture.frame_count)); } if (vchiq_mmal_submit_buffer(instance, port, buf)) v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, @@ -392,12 +391,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, is_capturing(dev)) { v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Grab another frame as buffer has EOS"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, - MMAL_PARAMETER_CAPTURE, - >capture.frame_count, - sizeof(dev->capture.frame_count)); + vmp_prmtr_set(instance, + dev->capture.camera_port, + MMAL_PARAMETER_CAPTURE, + >capture.frame_count, + sizeof(dev->capture.frame_count)); } } @@ -406,20 +404,18 @@ static int enable_camera(struct bm2835_mmal_dev *dev) int ret; if (!dev->camera_use_count) { - ret = vchiq_mmal_port_parameter_set( - dev->instance, - >component[COMP_CAMERA]->control, - MMAL_PARAMETER_CAMERA_NUM, >camera_num, - sizeof(dev->camera_num)); + ret = vmp_prmtr_set(dev->instance, + >component[COMP_CAMERA]->control, + MMAL_PARAMETER_CAMERA_NUM, >camera_num, + sizeof(dev->camera_num)); if (ret < 0) { v4l2_err(>v4l2_dev, "Failed setting camera num, ret %d\n", ret); return -EINVAL; } - ret = vchiq_mmal_component_enable( - dev->instance, - dev->component[COMP_CAMERA]); + ret = vm_cmpnt_enable(dev->instance, + dev->component[COMP_CAMERA]); if (ret < 0) { v4l2_err(>v4l2_dev, "Failed enabling camera, ret %d\n", ret); @@ -449,19 +445,17 @@ static int disable_camera(struct bm2835_mmal_dev *dev) v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Disabling camera\n"); ret = - vchiq_mmal_component_disable( - dev->instance, - dev->component[COMP_CAMERA]); + vm_cmpnt_disable(dev->instance, +dev->component[COMP_CAMERA]); if (ret < 0) { v4l2_err(>v4l2_dev, "Failed disabling camera, ret %d\n", ret); return -EINVAL; } -
[PATCH v2] staging: vc04_services: place the AND operator at the end of the previous line
Place the AND logical operator at the end of the previous line; to fix warning of "Logical continuations should be on the previous line". Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index d4d1e44b16b2..beb6a0063bb8 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -1090,8 +1090,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ret = vchiq_mmal_port_set_format(dev->instance, camera_port); - if (!ret - && camera_port == + if (!ret && + camera_port == >component[COMP_CAMERA]->output[CAM_PORT_VIDEO]) { bool overlay_enabled = !!dev->component[COMP_PREVIEW]->enabled; -- 2.21.0
Re: [Outreachy kernel] [PATCH] staging: vc04_services: fix warning of Logical continuations should be on the previous line
On Fri, 11 Oct 2019, Julia Lawall wrote: On Fri, 11 Oct 2019, Jules Irenge wrote: Fix warning of logical continuations should be on the previous line. Issue detected by checkpatch tool. There seem to be several changes mixed together in this patch. Don't have a subject line that is identical to a line in the log message. The subject line should be short. Keeping the arguments of && on the same line, but breaking the line after a == doesn't seem to be a good idea. It would be better to have the left argument of == on one line and the right argument on another, if that is needed. julia Apology, Yesterday was my bday, I was reckless. I am resending now. Please do not hesitate to give me a feedback if possible. Thanks Jules
[PATCH] staging: vc04_services: fix warning of Logical continuations should be on the previous line
Fix warning of logical continuations should be on the previous line. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- .../bcm2835-camera/bcm2835-camera.c | 41 --- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index d4d1e44b16b2..365bcd97e19d 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -337,9 +337,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, if (is_capturing(dev)) { v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Grab another frame"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, + vchiq_mmal_port_parameter_set(instance, + dev->capture.camera_port, MMAL_PARAMETER_CAPTURE, >capture.frame_count, sizeof(dev->capture.frame_count)); @@ -392,9 +391,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, is_capturing(dev)) { v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Grab another frame as buffer has EOS"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, + vchiq_mmal_port_parameter_set(instance, + dev->capture.camera_port, MMAL_PARAMETER_CAPTURE, >capture.frame_count, sizeof(dev->capture.frame_count)); @@ -1090,8 +1088,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ret = vchiq_mmal_port_set_format(dev->instance, camera_port); - if (!ret - && camera_port == + if (!ret && camera_port == >component[COMP_CAMERA]->output[CAM_PORT_VIDEO]) { bool overlay_enabled = !!dev->component[COMP_PREVIEW]->enabled; @@ -1124,9 +1121,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, dev->capture.timeperframe.numerator; ret = vchiq_mmal_port_set_format(dev->instance, preview_port); if (overlay_enabled) { - ret = vchiq_mmal_port_connect_tunnel( - dev->instance, - preview_port, + ret = vchiq_mmal_port_connect_tunnel(dev->instance, +preview_port, >component[COMP_PREVIEW]->input[0]); if (!ret) ret = vchiq_mmal_port_enable(dev->instance, @@ -1154,9 +1150,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, camera_port->recommended_buffer.num; ret = - vchiq_mmal_port_connect_tunnel( - dev->instance, - camera_port, + vchiq_mmal_port_connect_tunnel(dev->instance, + camera_port, _component->input[0]); if (ret) { v4l2_dbg(1, bcm2835_v4l2_debug, @@ -1655,8 +1650,8 @@ static int mmal_init(struct bm2835_mmal_dev *dev) dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; /* get the preview component ready */ - ret = vchiq_mmal_component_init( - dev->instance, "ril.video_render", + ret = vchiq_mmal_component_init(dev->instance, + "ril.video_render", >component[COMP_PREVIEW]); if (ret < 0) goto unreg_camera; @@ -1669,8 +1664,8 @@ static int mmal_init(struct bm2835_mmal_dev *dev) } /* get the image encoder component ready */ - ret = vchiq_mmal_component_init( - dev->instance, "ril.image_encode", + ret = vchiq_mmal_component_init(dev->instance, + "ril.image_encode", >component[COMP_IMAGE_ENCODE]); if (ret < 0) goto unreg_preview; @@ -
[PATCH] staging: vc04_services: fix warnings of lines should not end with open parenthesis
Fix warning of lines should not end with open parenthesis. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge --- .../bcm2835-camera/bcm2835-camera.c | 38 --- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index d4d1e44b16b2..c7bb6e3f529c 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -337,9 +337,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, if (is_capturing(dev)) { v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Grab another frame"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, + vchiq_mmal_port_parameter_set(instance, + dev->capture.camera_port, MMAL_PARAMETER_CAPTURE, >capture.frame_count, sizeof(dev->capture.frame_count)); @@ -392,9 +391,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, is_capturing(dev)) { v4l2_dbg(1, bcm2835_v4l2_debug, >v4l2_dev, "Grab another frame as buffer has EOS"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, + vchiq_mmal_port_parameter_set(instance, + dev->capture.camera_port, MMAL_PARAMETER_CAPTURE, >capture.frame_count, sizeof(dev->capture.frame_count)); @@ -1124,9 +1122,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, dev->capture.timeperframe.numerator; ret = vchiq_mmal_port_set_format(dev->instance, preview_port); if (overlay_enabled) { - ret = vchiq_mmal_port_connect_tunnel( - dev->instance, - preview_port, + ret = vchiq_mmal_port_connect_tunnel(dev->instance, +preview_port, >component[COMP_PREVIEW]->input[0]); if (!ret) ret = vchiq_mmal_port_enable(dev->instance, @@ -1154,9 +1151,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, camera_port->recommended_buffer.num; ret = - vchiq_mmal_port_connect_tunnel( - dev->instance, - camera_port, + vchiq_mmal_port_connect_tunnel(dev->instance, + camera_port, _component->input[0]); if (ret) { v4l2_dbg(1, bcm2835_v4l2_debug, @@ -1655,8 +1651,8 @@ static int mmal_init(struct bm2835_mmal_dev *dev) dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; /* get the preview component ready */ - ret = vchiq_mmal_component_init( - dev->instance, "ril.video_render", + ret = vchiq_mmal_component_init(dev->instance, + "ril.video_render", >component[COMP_PREVIEW]); if (ret < 0) goto unreg_camera; @@ -1669,8 +1665,8 @@ static int mmal_init(struct bm2835_mmal_dev *dev) } /* get the image encoder component ready */ - ret = vchiq_mmal_component_init( - dev->instance, "ril.image_encode", + ret = vchiq_mmal_component_init(dev->instance, + "ril.image_encode", >component[COMP_IMAGE_ENCODE]); if (ret < 0) goto unreg_preview; @@ -1731,15 +1727,13 @@ static int mmal_init(struct bm2835_mmal_dev *dev) unreg_vid_encoder: pr_err("Cleanup: Destroy video encoder\n"); - vchiq_mmal_component_finalise( - dev->instance, - dev->component[COMP_VIDEO_ENCODE]); + vchiq_mmal_component_finalise(dev->instance, + dev->component[COMP_VIDEO_ENCODE]); unreg_image_encoder
[RESEND PATCH v1 2/5] staging: qlge: fix "alignment should match open parenthesis" checks
Fix "alignment should mactch open parenthesis" checks issued by checkpatch.pl tool: "CHECK: Alignment should match open parenthesis". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 182 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 28fc974ce982..27aa8de3b5ff 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -7,7 +7,7 @@ /* Read a NIC register from the alternate function. */ static u32 ql_read_other_func_reg(struct ql_adapter *qdev, - u32 reg) + u32 reg) { u32 register_to_read; u32 reg_val; @@ -26,7 +26,7 @@ static u32 ql_read_other_func_reg(struct ql_adapter *qdev, /* Write a NIC register from the alternate function. */ static int ql_write_other_func_reg(struct ql_adapter *qdev, - u32 reg, u32 reg_val) + u32 reg, u32 reg_val) { u32 register_to_read; int status = 0; @@ -41,7 +41,7 @@ static int ql_write_other_func_reg(struct ql_adapter *qdev, } static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg, - u32 bit, u32 err_bit) + u32 bit, u32 err_bit) { u32 temp; int count = 10; @@ -61,13 +61,13 @@ static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg, } static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, - u32 *data) +u32 *data) { int status; /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, - XG_SERDES_ADDR_RDY, 0); + XG_SERDES_ADDR_RDY, 0); if (status) goto exit; @@ -76,7 +76,7 @@ static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, - XG_SERDES_ADDR_RDY, 0); + XG_SERDES_ADDR_RDY, 0); if (status) goto exit; @@ -111,7 +111,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data) } static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, - u32 *direct_ptr, u32 *indirect_ptr, + u32 *direct_ptr, u32 *indirect_ptr, unsigned int direct_valid, unsigned int indirect_valid) { unsigned int status; @@ -133,7 +133,7 @@ static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, } static int ql_get_serdes_regs(struct ql_adapter *qdev, - struct ql_mpi_coredump *mpi_coredump) + struct ql_mpi_coredump *mpi_coredump) { int status; unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; @@ -203,7 +203,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0; i <= 0x00034; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xaui_direct_valid, xaui_indirect_valid); + xaui_direct_valid, xaui_indirect_valid); /* Get XAUI_HSS_PCS register block. */ if (qdev->func & 1) { @@ -220,7 +220,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x800; i <= 0x880; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xaui_direct_valid, xaui_indirect_valid); + xaui_direct_valid, xaui_indirect_valid); /* Get XAUI_XFI_AN register block. */ if (qdev->func & 1) { @@ -233,7 +233,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x1000; i <= 0x1034; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xfi_direct_valid, xfi_indirect_valid); + xfi_direct_valid, xfi_indirect_valid); /* Get XAUI_XFI_TRAIN register block. */ if (qdev->func & 1) { @@ -248,7 +248,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x1050; i <= 0x107c; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, -
[RESEND PATCH v1 4/5] staging: qlge: add space to fix check warning
Add space to fix warning of preferred space near the division operator issue detected by checkpatch. Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index b8ff9eccc472..eb993207d224 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -72,7 +72,7 @@ static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, goto exit; /* set up for reg read */ - ql_write_other_func_reg(qdev, XG_SERDES_ADDR/4, reg | PROC_ADDR_R); + ql_write_other_func_reg(qdev, XG_SERDES_ADDR / 4, reg | PROC_ADDR_R); /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, -- 2.21.0
[RESEND PATCH v1 5/5] staging: qlge: fix comparison to NULL warning
Fix comparison to NULL by replacing with !ptr instead. Issue detected by checkpatch. Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index eb993207d224..12a62a6fbb69 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -1804,7 +1804,7 @@ void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id) pr_err("%s: Enter\n", __func__); ptr = kmalloc(size, GFP_ATOMIC); - if (ptr == NULL) + if (!ptr) return; if (ql_write_cfg(qdev, ptr, size, bit, q_id)) { -- 2.21.0
[RESEND PATCH v1 3/5] staging: qlge: Fix multiple assignments warning by replacing integer variables to bool
Fix multiple assignments warning " check issue detected by checkpatch tool: "CHECK: multiple assignments should be avoided". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 27aa8de3b5ff..b8ff9eccc472 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -112,7 +112,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data) static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, u32 *direct_ptr, u32 *indirect_ptr, - unsigned int direct_valid, unsigned int indirect_valid) + bool direct_valid, bool indirect_valid) { unsigned int status; @@ -136,13 +136,12 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) { int status; - unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; - unsigned int xaui_indirect_valid, i; + bool xfi_direct_valid = false, xfi_indirect_valid = false; + bool xaui_direct_valid = true, xaui_indirect_valid = true; + unsigned int i; u32 *direct_ptr, temp; u32 *indirect_ptr; - xfi_direct_valid = xfi_indirect_valid = 0; - xaui_direct_valid = xaui_indirect_valid = 1; /* The XAUI needs to be read out per port */ status = ql_read_other_func_serdes_reg(qdev, @@ -152,7 +151,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == XG_SERDES_ADDR_XAUI_PWR_DOWN) - xaui_indirect_valid = 0; + xaui_indirect_valid = false; status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, ); @@ -161,7 +160,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == XG_SERDES_ADDR_XAUI_PWR_DOWN) - xaui_direct_valid = 0; + xaui_direct_valid = false; /* * XFI register is shared so only need to read one @@ -176,18 +175,18 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, /* now see if i'm NIC 1 or NIC 2 */ if (qdev->func & 1) /* I'm NIC 2, so the indirect (NIC1) xfi is up. */ - xfi_indirect_valid = 1; + xfi_indirect_valid = true; else - xfi_direct_valid = 1; + xfi_direct_valid = true; } if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) == XG_SERDES_ADDR_XFI2_PWR_UP) { /* now see if i'm NIC 1 or NIC 2 */ if (qdev->func & 1) /* I'm NIC 2, so the indirect (NIC1) xfi is up. */ - xfi_direct_valid = 1; + xfi_direct_valid = true; else - xfi_indirect_valid = 1; + xfi_indirect_valid = true; } /* Get XAUI_AN register block. */ -- 2.21.0
[RESEND PATCH v1 0/5] checkpatch warnings cleanup
Clean up multiple warnings reported by checkpatch tool. These are a resend in the order they were patched. Jules Irenge (5): staging: qlge: correct a misspelled word staging: qlge: fix "alignment should match open parenthesis" checks staging: qlge: Fix multiple assignments warning by replacing integer variables to bool staging: qlge: add space to fix check warning staging: qlge: fix comparison to NULL warning drivers/staging/qlge/qlge_dbg.c | 209 1 file changed, 104 insertions(+), 105 deletions(-) -- 2.21.0
[RESEND PATCH v1 1/5] staging: qlge: correct a misspelled word
Fix a misspelling of "several" detected by checkpatch Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 5599525a19d5..28fc974ce982 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -354,7 +354,7 @@ static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 *buf, for (i = PAUSE_SRC_LO; i < XGMAC_REGISTER_END; i += 4, buf++) { /* We're reading 400 xgmac registers, but we filter out -* serveral locations that are non-responsive to reads. +* several locations that are non-responsive to reads. */ if ((i == 0x0114) || (i == 0x0118) || -- 2.21.0
[RESEND PATCH] staging: qlge: correct a misspelled word
Fix a misspelling of "several" detected by checkpatch Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 5599525a19d5..28fc974ce982 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -354,7 +354,7 @@ static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 *buf, for (i = PAUSE_SRC_LO; i < XGMAC_REGISTER_END; i += 4, buf++) { /* We're reading 400 xgmac registers, but we filter out -* serveral locations that are non-responsive to reads. +* several locations that are non-responsive to reads. */ if ((i == 0x0114) || (i == 0x0118) || -- 2.21.0
[PATCH v2] staging: qlge: correct a misspelled word
Fix a misspelling of "several" detected by checkpatch Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 5599525a19d5..28fc974ce982 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -354,7 +354,7 @@ static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 *buf, for (i = PAUSE_SRC_LO; i < XGMAC_REGISTER_END; i += 4, buf++) { /* We're reading 400 xgmac registers, but we filter out -* serveral locations that are non-responsive to reads. +* several locations that are non-responsive to reads. */ if ((i == 0x0114) || (i == 0x0118) || -- 2.21.0
[PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
Fix multiple assignments warning " check issued by checkpatch.pl tool: "CHECK: multiple assignments should be avoided". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 086f067fd899..69bd4710c5ec 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, u32 *direct_ptr, temp; u32 *indirect_ptr; - xfi_direct_valid = xfi_indirect_valid = 0; - xaui_direct_valid = xaui_indirect_valid = 1; + xfi_indirect_valid = 0; + xfi_direct_valid = xfi_indirect_valid; + xaui_indirect_valid = 1; + xaui_direct_valid = xaui_indirect_valid /* The XAUI needs to be read out per port */ status = ql_read_other_func_serdes_reg(qdev, -- 2.21.0
[PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
Fix multiple assignments warning " check issued by checkpatch.pl tool: "CHECK: multiple assignments should be avoided". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 086f067fd899..69bd4710c5ec 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, u32 *direct_ptr, temp; u32 *indirect_ptr; - xfi_direct_valid = xfi_indirect_valid = 0; - xaui_direct_valid = xaui_indirect_valid = 1; + xfi_indirect_valid = 0; + xfi_direct_valid = xfi_indirect_valid; + xaui_indirect_valid = 1; + xaui_direct_valid = xaui_indirect_valid /* The XAUI needs to be read out per port */ status = ql_read_other_func_serdes_reg(qdev, -- 2.21.0
[PATCH] staging: qlge: fix "alignment should match open parenthesis" checks
Fix "alignment should mactch open parenthesis" checks issued by checkpatch.pl tool: "CHECK: Alignment should match open parenthesis". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 127 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 086f067fd899..c57d7e722974 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -26,7 +26,7 @@ static u32 ql_read_other_func_reg(struct ql_adapter *qdev, /* Write a NIC register from the alternate function. */ static int ql_write_other_func_reg(struct ql_adapter *qdev, - u32 reg, u32 reg_val) + u32 reg, u32 reg_val) { u32 register_to_read; int status = 0; @@ -41,7 +41,7 @@ static int ql_write_other_func_reg(struct ql_adapter *qdev, } static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg, - u32 bit, u32 err_bit) + u32 bit, u32 err_bit) { u32 temp; int count = 10; @@ -61,13 +61,13 @@ static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg, } static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, - u32 *data) +u32 *data) { int status; /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, - XG_SERDES_ADDR_RDY, 0); + XG_SERDES_ADDR_RDY, 0); if (status) goto exit; @@ -76,7 +76,7 @@ static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, - XG_SERDES_ADDR_RDY, 0); + XG_SERDES_ADDR_RDY, 0); if (status) goto exit; @@ -111,7 +111,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data) } static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, - u32 *direct_ptr, u32 *indirect_ptr, + u32 *direct_ptr, u32 *indirect_ptr, unsigned int direct_valid, unsigned int indirect_valid) { unsigned int status; @@ -133,7 +133,7 @@ static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, } static int ql_get_serdes_regs(struct ql_adapter *qdev, - struct ql_mpi_coredump *mpi_coredump) + struct ql_mpi_coredump *mpi_coredump) { int status; unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; @@ -146,7 +146,8 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, /* The XAUI needs to be read out per port */ status = ql_read_other_func_serdes_reg(qdev, - XG_SERDES_XAUI_HSS_PCS_START, ); + XG_SERDES_XAUI_HSS_PCS_START, + ); if (status) temp = XG_SERDES_ADDR_XAUI_PWR_DOWN; @@ -203,7 +204,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0; i <= 0x00034; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xaui_direct_valid, xaui_indirect_valid); + xaui_direct_valid, xaui_indirect_valid); /* Get XAUI_HSS_PCS register block. */ if (qdev->func & 1) { @@ -220,7 +221,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x800; i <= 0x880; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xaui_direct_valid, xaui_indirect_valid); + xaui_direct_valid, xaui_indirect_valid); /* Get XAUI_XFI_AN register block. */ if (qdev->func & 1) { @@ -233,7 +234,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x1000; i <= 0x1034; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xfi_direct_valid, xfi_indirect_valid); + xfi_direct_valid, xfi_indirect_valid); /* Get XAUI_XFI_TRAIN register block. */ if (qdev->func & 1) { @@ -248,7 +249,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x1050; i <= 0x107c; i += 4, direct_ptr++, in
[PATCH] staging: qlge: correct misspelled word
Correct misspelled word " check issued by checkpatch.pl tool: "CHECK: serveral may be misspelled - perhaps several?". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 086f067fd899..097fab7b4287 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -354,7 +354,7 @@ static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 *buf, for (i = PAUSE_SRC_LO; i < XGMAC_REGISTER_END; i += 4, buf++) { /* We're reading 400 xgmac registers, but we filter out -* serveral locations that are non-responsive to reads. +* several locations that are non-responsive to reads. */ if ((i == 0x0114) || (i == 0x0118) || -- 2.21.0
[PATCH] staging: qlge: correct misspelled word
Correct misspelled word " check issued by checkpatch.pl tool: "CHECK: serveral may be misspelled - perhaps several?". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 086f067fd899..097fab7b4287 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -354,7 +354,7 @@ static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 *buf, for (i = PAUSE_SRC_LO; i < XGMAC_REGISTER_END; i += 4, buf++) { /* We're reading 400 xgmac registers, but we filter out -* serveral locations that are non-responsive to reads. +* several locations that are non-responsive to reads. */ if ((i == 0x0114) || (i == 0x0118) || -- 2.21.0
[PATCH] staging: qlge: fix "alignment should match open parenthesis" checks
Fix "alignment should mactch open parenthesis" checks issued by checkpatch.pl tool: "CHECK: Alignment should match open parenthesis". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 127 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 086f067fd899..c57d7e722974 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -26,7 +26,7 @@ static u32 ql_read_other_func_reg(struct ql_adapter *qdev, /* Write a NIC register from the alternate function. */ static int ql_write_other_func_reg(struct ql_adapter *qdev, - u32 reg, u32 reg_val) + u32 reg, u32 reg_val) { u32 register_to_read; int status = 0; @@ -41,7 +41,7 @@ static int ql_write_other_func_reg(struct ql_adapter *qdev, } static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg, - u32 bit, u32 err_bit) + u32 bit, u32 err_bit) { u32 temp; int count = 10; @@ -61,13 +61,13 @@ static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg, } static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, - u32 *data) +u32 *data) { int status; /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, - XG_SERDES_ADDR_RDY, 0); + XG_SERDES_ADDR_RDY, 0); if (status) goto exit; @@ -76,7 +76,7 @@ static int ql_read_other_func_serdes_reg(struct ql_adapter *qdev, u32 reg, /* wait for reg to come ready */ status = ql_wait_other_func_reg_rdy(qdev, XG_SERDES_ADDR / 4, - XG_SERDES_ADDR_RDY, 0); + XG_SERDES_ADDR_RDY, 0); if (status) goto exit; @@ -111,7 +111,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data) } static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, - u32 *direct_ptr, u32 *indirect_ptr, + u32 *direct_ptr, u32 *indirect_ptr, unsigned int direct_valid, unsigned int indirect_valid) { unsigned int status; @@ -133,7 +133,7 @@ static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, } static int ql_get_serdes_regs(struct ql_adapter *qdev, - struct ql_mpi_coredump *mpi_coredump) + struct ql_mpi_coredump *mpi_coredump) { int status; unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; @@ -146,7 +146,8 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, /* The XAUI needs to be read out per port */ status = ql_read_other_func_serdes_reg(qdev, - XG_SERDES_XAUI_HSS_PCS_START, ); + XG_SERDES_XAUI_HSS_PCS_START, + ); if (status) temp = XG_SERDES_ADDR_XAUI_PWR_DOWN; @@ -203,7 +204,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0; i <= 0x00034; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xaui_direct_valid, xaui_indirect_valid); + xaui_direct_valid, xaui_indirect_valid); /* Get XAUI_HSS_PCS register block. */ if (qdev->func & 1) { @@ -220,7 +221,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x800; i <= 0x880; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xaui_direct_valid, xaui_indirect_valid); + xaui_direct_valid, xaui_indirect_valid); /* Get XAUI_XFI_AN register block. */ if (qdev->func & 1) { @@ -233,7 +234,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x1000; i <= 0x1034; i += 4, direct_ptr++, indirect_ptr++) ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr, - xfi_direct_valid, xfi_indirect_valid); + xfi_direct_valid, xfi_indirect_valid); /* Get XAUI_XFI_TRAIN register block. */ if (qdev->func & 1) { @@ -248,7 +249,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, for (i = 0x1050; i <= 0x107c; i += 4, direct_ptr++, in
[PATCH] staging: qlge: fix "alignment should match open parenthesis" check
Fix "alignment should match open parenthesis" check issued by checkpatch.pl tool: "CHECK: Alignment should match open parenthesis". Signed-off-by: Jules Irenge --- drivers/staging/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 5599525a19d5..086f067fd899 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -7,7 +7,7 @@ /* Read a NIC register from the alternate function. */ static u32 ql_read_other_func_reg(struct ql_adapter *qdev, - u32 reg) + u32 reg) { u32 register_to_read; u32 reg_val; -- 2.21.0
[PATCH] staging: comedi: Capitalize macro name to fix camelcase checkpatch warning
Capitalize RANGE_mA to fix camelcase check warning. Issue reported by checkpatch.pl Signed-off-by: Jules Irenge --- drivers/staging/comedi/comedidev.h | 2 +- drivers/staging/comedi/drivers/adv_pci1724.c | 4 ++-- drivers/staging/comedi/drivers/dac02.c | 2 +- drivers/staging/comedi/range.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 54c091866777..2fc536db203c 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -603,7 +603,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, #define RANGE(a, b){(a) * 1e6, (b) * 1e6, 0} #define RANGE_ext(a, b){(a) * 1e6, (b) * 1e6, RF_EXTERNAL} -#define RANGE_mA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} +#define RANGE_MA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} #define RANGE_unitless(a, b) {(a) * 1e6, (b) * 1e6, 0} #define BIP_RANGE(a) {-(a) * 1e6, (a) * 1e6, 0} #define UNI_RANGE(a) {0, (a) * 1e6, 0} diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c index e8ab573c839f..f20d710c19d3 100644 --- a/drivers/staging/comedi/drivers/adv_pci1724.c +++ b/drivers/staging/comedi/drivers/adv_pci1724.c @@ -64,8 +64,8 @@ static const struct comedi_lrange adv_pci1724_ao_ranges = { 4, { BIP_RANGE(10), - RANGE_mA(0, 20), - RANGE_mA(4, 20), + RANGE_MA(0, 20), + RANGE_MA(4, 20), RANGE_unitless(0, 1) } }; diff --git a/drivers/staging/comedi/drivers/dac02.c b/drivers/staging/comedi/drivers/dac02.c index 5ef8114c2c85..4503cbdf673c 100644 --- a/drivers/staging/comedi/drivers/dac02.c +++ b/drivers/staging/comedi/drivers/dac02.c @@ -54,7 +54,7 @@ static const struct comedi_lrange das02_ao_ranges = { UNI_RANGE(10), BIP_RANGE(5), BIP_RANGE(10), - RANGE_mA(4, 20), + RANGE_MA(4, 20), RANGE_ext(0, 1) } }; diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c index 89d599877445..dacdd7b6f1a0 100644 --- a/drivers/staging/comedi/range.c +++ b/drivers/staging/comedi/range.c @@ -23,11 +23,11 @@ const struct comedi_lrange range_unipolar5 = { 1, {UNI_RANGE(5)} }; EXPORT_SYMBOL_GPL(range_unipolar5); const struct comedi_lrange range_unipolar2_5 = { 1, {UNI_RANGE(2.5)} }; EXPORT_SYMBOL_GPL(range_unipolar2_5); -const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} }; +const struct comedi_lrange range_0_20mA = { 1, {RANGE_MA(0, 20)} }; EXPORT_SYMBOL_GPL(range_0_20mA); -const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} }; +const struct comedi_lrange range_4_20mA = { 1, {RANGE_MA(4, 20)} }; EXPORT_SYMBOL_GPL(range_4_20mA); -const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} }; +const struct comedi_lrange range_0_32mA = { 1, {RANGE_MA(0, 32)} }; EXPORT_SYMBOL_GPL(range_0_32mA); const struct comedi_lrange range_unknown = { 1, {{0, 100, UNIT_none} } }; EXPORT_SYMBOL_GPL(range_unknown); -- 2.21.0
[PATCH] staging: comedi: Capitalize macro name to fix camelcase checkpatch warning
Capitalize RANGE_mA to fix camelcase check warning. Issue reported by checkpatch.pl Signed-off-by: Jules Irenge --- drivers/staging/comedi/comedidev.h | 2 +- drivers/staging/comedi/drivers/adv_pci1724.c | 4 ++-- drivers/staging/comedi/drivers/dac02.c | 2 +- drivers/staging/comedi/range.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 54c091866777..2fc536db203c 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -603,7 +603,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, #define RANGE(a, b){(a) * 1e6, (b) * 1e6, 0} #define RANGE_ext(a, b){(a) * 1e6, (b) * 1e6, RF_EXTERNAL} -#define RANGE_mA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} +#define RANGE_MA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} #define RANGE_unitless(a, b) {(a) * 1e6, (b) * 1e6, 0} #define BIP_RANGE(a) {-(a) * 1e6, (a) * 1e6, 0} #define UNI_RANGE(a) {0, (a) * 1e6, 0} diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c index e8ab573c839f..f20d710c19d3 100644 --- a/drivers/staging/comedi/drivers/adv_pci1724.c +++ b/drivers/staging/comedi/drivers/adv_pci1724.c @@ -64,8 +64,8 @@ static const struct comedi_lrange adv_pci1724_ao_ranges = { 4, { BIP_RANGE(10), - RANGE_mA(0, 20), - RANGE_mA(4, 20), + RANGE_MA(0, 20), + RANGE_MA(4, 20), RANGE_unitless(0, 1) } }; diff --git a/drivers/staging/comedi/drivers/dac02.c b/drivers/staging/comedi/drivers/dac02.c index 5ef8114c2c85..4503cbdf673c 100644 --- a/drivers/staging/comedi/drivers/dac02.c +++ b/drivers/staging/comedi/drivers/dac02.c @@ -54,7 +54,7 @@ static const struct comedi_lrange das02_ao_ranges = { UNI_RANGE(10), BIP_RANGE(5), BIP_RANGE(10), - RANGE_mA(4, 20), + RANGE_MA(4, 20), RANGE_ext(0, 1) } }; diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c index 89d599877445..dacdd7b6f1a0 100644 --- a/drivers/staging/comedi/range.c +++ b/drivers/staging/comedi/range.c @@ -23,11 +23,11 @@ const struct comedi_lrange range_unipolar5 = { 1, {UNI_RANGE(5)} }; EXPORT_SYMBOL_GPL(range_unipolar5); const struct comedi_lrange range_unipolar2_5 = { 1, {UNI_RANGE(2.5)} }; EXPORT_SYMBOL_GPL(range_unipolar2_5); -const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} }; +const struct comedi_lrange range_0_20mA = { 1, {RANGE_MA(0, 20)} }; EXPORT_SYMBOL_GPL(range_0_20mA); -const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} }; +const struct comedi_lrange range_4_20mA = { 1, {RANGE_MA(4, 20)} }; EXPORT_SYMBOL_GPL(range_4_20mA); -const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} }; +const struct comedi_lrange range_0_32mA = { 1, {RANGE_MA(0, 32)} }; EXPORT_SYMBOL_GPL(range_0_32mA); const struct comedi_lrange range_unknown = { 1, {{0, 100, UNIT_none} } }; EXPORT_SYMBOL_GPL(range_unknown); -- 2.21.0
[PATCH] staging: comedi: Fix camelcase check warning
Capitalize unit_ma to fix camelcase check warning. Signed-off-by: Jules Irenge --- drivers/staging/comedi/comedi.h| 4 ++-- drivers/staging/comedi/comedidev.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h index 09a940066c0e..df770043b37d 100644 --- a/drivers/staging/comedi/comedi.h +++ b/drivers/staging/comedi/comedi.h @@ -674,7 +674,7 @@ struct comedi_rangeinfo { * linear (for the purpose of describing the range), with sample value %0 * mapping to @min, and the 'maxdata' sample value mapping to @max. * - * The currently defined units are %UNIT_volt (%0), %UNIT_mA (%1), and + * The currently defined units are %UNIT_volt (%0), %UNIT_MA (%1), and * %UNIT_none (%2). The @min and @max values are the physical range multiplied * by 1e6, so a @max value of %100 (with %UNIT_volt) represents a maximal * value of 1 volt. @@ -909,7 +909,7 @@ struct comedi_bufinfo { #define RF_EXTERNAL0x100 #define UNIT_volt 0 -#define UNIT_mA1 +#define UNIT_MA1 #define UNIT_none 2 #define COMEDI_MIN_SPEED 0xu diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 0dff1ac057cd..54c091866777 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -603,7 +603,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, #define RANGE(a, b){(a) * 1e6, (b) * 1e6, 0} #define RANGE_ext(a, b){(a) * 1e6, (b) * 1e6, RF_EXTERNAL} -#define RANGE_mA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_mA} +#define RANGE_mA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} #define RANGE_unitless(a, b) {(a) * 1e6, (b) * 1e6, 0} #define BIP_RANGE(a) {-(a) * 1e6, (a) * 1e6, 0} #define UNI_RANGE(a) {0, (a) * 1e6, 0} -- 2.21.0
[PATCH] staging: comedi: Capitalize macro name to fix camelcase checkpatch warning
Capitalize RANGE_mA to fix camelcase check warning. Issue reported by checkpatch.pl Signed-off-by: Jules Irenge --- drivers/staging/comedi/comedidev.h | 2 +- drivers/staging/comedi/drivers/adv_pci1724.c | 4 ++-- drivers/staging/comedi/drivers/dac02.c | 2 +- drivers/staging/comedi/range.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 54c091866777..2fc536db203c 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -603,7 +603,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, #define RANGE(a, b){(a) * 1e6, (b) * 1e6, 0} #define RANGE_ext(a, b){(a) * 1e6, (b) * 1e6, RF_EXTERNAL} -#define RANGE_mA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} +#define RANGE_MA(a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} #define RANGE_unitless(a, b) {(a) * 1e6, (b) * 1e6, 0} #define BIP_RANGE(a) {-(a) * 1e6, (a) * 1e6, 0} #define UNI_RANGE(a) {0, (a) * 1e6, 0} diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c index e8ab573c839f..f20d710c19d3 100644 --- a/drivers/staging/comedi/drivers/adv_pci1724.c +++ b/drivers/staging/comedi/drivers/adv_pci1724.c @@ -64,8 +64,8 @@ static const struct comedi_lrange adv_pci1724_ao_ranges = { 4, { BIP_RANGE(10), - RANGE_mA(0, 20), - RANGE_mA(4, 20), + RANGE_MA(0, 20), + RANGE_MA(4, 20), RANGE_unitless(0, 1) } }; diff --git a/drivers/staging/comedi/drivers/dac02.c b/drivers/staging/comedi/drivers/dac02.c index 5ef8114c2c85..4503cbdf673c 100644 --- a/drivers/staging/comedi/drivers/dac02.c +++ b/drivers/staging/comedi/drivers/dac02.c @@ -54,7 +54,7 @@ static const struct comedi_lrange das02_ao_ranges = { UNI_RANGE(10), BIP_RANGE(5), BIP_RANGE(10), - RANGE_mA(4, 20), + RANGE_MA(4, 20), RANGE_ext(0, 1) } }; diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c index 89d599877445..dacdd7b6f1a0 100644 --- a/drivers/staging/comedi/range.c +++ b/drivers/staging/comedi/range.c @@ -23,11 +23,11 @@ const struct comedi_lrange range_unipolar5 = { 1, {UNI_RANGE(5)} }; EXPORT_SYMBOL_GPL(range_unipolar5); const struct comedi_lrange range_unipolar2_5 = { 1, {UNI_RANGE(2.5)} }; EXPORT_SYMBOL_GPL(range_unipolar2_5); -const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} }; +const struct comedi_lrange range_0_20mA = { 1, {RANGE_MA(0, 20)} }; EXPORT_SYMBOL_GPL(range_0_20mA); -const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} }; +const struct comedi_lrange range_4_20mA = { 1, {RANGE_MA(4, 20)} }; EXPORT_SYMBOL_GPL(range_4_20mA); -const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} }; +const struct comedi_lrange range_0_32mA = { 1, {RANGE_MA(0, 32)} }; EXPORT_SYMBOL_GPL(range_0_32mA); const struct comedi_lrange range_unknown = { 1, {{0, 100, UNIT_none} } }; EXPORT_SYMBOL_GPL(range_unknown); -- 2.21.0
[PATCH] staging: speakup: fix line over 80 characters.
Fix coding style issues, which solves checkpatch.pl warning: "WARNING: line over 80 characters". --- drivers/staging/speakup/kobjects.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 2eb5af3debb3..abeab64899db 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -154,7 +154,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj, continue; } - /* Do not replace with kstrtoul: here we need temp to be updated */ +/* Do not replace with kstrtoul: here we need temp to be updated */ index = simple_strtoul(cp, , 10); if (index > 255) { rejected++; @@ -788,7 +788,7 @@ static ssize_t message_store_helper(const char *buf, size_t count, continue; } - /* Do not replace with kstrtoul: here we need temp to be updated */ +/* Do not replace with kstrtoul: here we need temp to be updated */ index = simple_strtoul(cp, , 10); while ((temp < linefeed) && (*temp == ' ' || *temp == '\t')) -- 2.20.1
[PATCH v3 0/2] SPDX Cleanups
This v3 corrects grammar and ensures it is ccied to the right maintainer Jules Irenge (2): staging: rtl8192e: add SPDX GPL-2.0 license identifier staging: rtl8192e: remove boilerplate license text drivers/staging/rtl8192e/dot11d.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.20.1
[PATCH v3 1/2] staging: rtl8192e: add SPDX GPL-2.0 license identifier
Add the SPDX GPL-2.0 license identifier to fix checkpatch.pl warning Issue found by checkpatch.pl warning: "WARNING: Missing or malformed SPDX-License-Identifier tag in line 1" Signed-off-by: Jules Irenge --- drivers/staging/rtl8192e/dot11d.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index 68f53013cb95..6d57abedaa34 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /** * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. * -- 2.20.1
[PATCH v3 2/2] staging: rtl8192e: remove boilerplate license text
Remove boilerplate license text. Signed-off-by: Jules Irenge --- drivers/staging/rtl8192e/dot11d.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index 6d57abedaa34..82c11caeee7a 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -2,14 +2,6 @@ /** * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * The full GNU General Public License is included in this distribution in the - * file called LICENSE. - * * Contact Information: * wlanfae **/ -- 2.20.1
[PATCH] net: ax25: Fix multiple blank lines warning
Signed-off-by: Jules Irenge --- net/ax25/af_ax25.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 5048790a75f6..2da349b7854a 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -49,8 +49,6 @@ #include #include - - HLIST_HEAD(ax25_list); DEFINE_SPINLOCK(ax25_list_lock); -- 2.20.1
[PATCH] net: ax25: Add SPDX License to fix missing License warning
Signed-off-by: Jules Irenge --- net/ax25/af_ax25.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 5d01edf8d819..5048790a75f6 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- 2.20.1