linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: cec: fix trivial style warnings
@ 2020-12-18  6:31 Nigel Christian
  2020-12-18 10:16 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Nigel Christian @ 2020-12-18  6:31 UTC (permalink / raw)
  To: hverkuil-cisco, mchehab, sakari.ailus, dan.carpenter, gustavoars
  Cc: linux-media, trivial, kernel-janitors

Comment has 'then' repeated twice. Let's clean it up.
Use unsigned int to maintain naming consistency.

Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
---
 drivers/media/cec/core/cec-adap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c
index d5d5d28d0b36..79fa36de8a04 100644
--- a/drivers/media/cec/core/cec-adap.c
+++ b/drivers/media/cec/core/cec-adap.c
@@ -1296,7 +1296,7 @@ static int cec_config_log_addr(struct cec_adapter *adap,
 	/*
 	 * If we are unable to get an OK or a NACK after max_retries attempts
 	 * (and note that each attempt already consists of four polls), then
-	 * then we assume that something is really weird and that it is not a
+	 * we assume that something is really weird and that it is not a
 	 * good idea to try and claim this logical address.
 	 */
 	if (i == max_retries)
@@ -1735,7 +1735,7 @@ int __cec_s_log_addrs(struct cec_adapter *adap,
 		const u8 feature_sz = ARRAY_SIZE(log_addrs->features[0]);
 		u8 *features = log_addrs->features[i];
 		bool op_is_dev_features = false;
-		unsigned j;
+		unsigned int j;
 
 		log_addrs->log_addr[i] = CEC_LOG_ADDR_INVALID;
 		if (log_addrs->log_addr_type[i] > CEC_LOG_ADDR_TYPE_UNREGISTERED) {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: cec: fix trivial style warnings
  2020-12-18  6:31 [PATCH] media: cec: fix trivial style warnings Nigel Christian
@ 2020-12-18 10:16 ` Dan Carpenter
  2020-12-18 12:35   ` Nigel Christian
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2020-12-18 10:16 UTC (permalink / raw)
  To: Nigel Christian
  Cc: hverkuil-cisco, mchehab, sakari.ailus, gustavoars, linux-media,
	trivial, kernel-janitors

On Fri, Dec 18, 2020 at 01:31:17AM -0500, Nigel Christian wrote:
> Comment has 'then' repeated twice. Let's clean it up.
> Use unsigned int to maintain naming consistency.
> 

Do you use a tool to find the double "then then"?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: cec: fix trivial style warnings
  2020-12-18 10:16 ` Dan Carpenter
@ 2020-12-18 12:35   ` Nigel Christian
  2020-12-18 13:36     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Nigel Christian @ 2020-12-18 12:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: hverkuil-cisco, mchehab, sakari.ailus, gustavoars, linux-media,
	trivial, kernel-janitors

On Fri, Dec 18, 2020 at 01:16:30PM +0300, Dan Carpenter wrote:
> On Fri, Dec 18, 2020 at 01:31:17AM -0500, Nigel Christian wrote:
> > Comment has 'then' repeated twice. Let's clean it up.
> > Use unsigned int to maintain naming consistency.
> > 
> 
> Do you use a tool to find the double "then then"?
> 
> regards,
> dan carpenter
> 

Started working on nodejs script to run the 'checkpatch.pl -f'
on directories and filter the output by command line arg.
It goes in scripts/ and is run from the root of the kernel.
Let me know if there is any modification that can make it
more effective or specific filters.
------------------
'use strict'
// place this file in kernel 'scripts' directory
const pfs = require('fs').promises
const { spawn } = require('child_process')
const dir = process.argv[2]
const lvl = process.argv[3]
const path = `./${dir}`
const checkPatch = './scripts/checkpatch.pl -f'
const badInput = dir === undefined || dir === null || dir === ''
                || lvl === undefined || lvl === null || lvl === ''

/**
 * Check for valid command line arguments
 */
if(badInput) {
    console.log('Run checkpatch.pl on directories')
    console.log('Usage: node ./scripts/checkdirpatch <path/to/check>'
    + ' <LEVEL> (e.g. WARNING or ERROR)')
    process.exit(1)
} else {
    console.log(`Reading path ${path}...`)
}

/**
 * Async function for running checkpatch.pl on entire directory
 * We won't drill down any further from here and only check for
 * files at the current directory. Output is controlled via the 
 * log level which is passed as command line argument
 */
async function check() {
    const files = await pfs.readdir(path).then(v => v)
    files.forEach(async f => {
        const stat = await pfs.lstat(`${path}${f}`)
        if(stat.isFile()) {
            const child = spawn(`${checkPatch} ${path}${f} | grep -A1 ${lvl}`, {
                shell: true,
                stdio: ['pipe', 'inherit', 'ignore']
            })
        }
    })
}
check().catch(e => console.error(e))
--------------------------------------------

https://github.com/callmekurisu/kernel-dev/blob/main/checkdirpatch.js


Thanks, 

Nigel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: cec: fix trivial style warnings
  2020-12-18 12:35   ` Nigel Christian
@ 2020-12-18 13:36     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-12-18 13:36 UTC (permalink / raw)
  To: Nigel Christian
  Cc: hverkuil-cisco, mchehab, sakari.ailus, gustavoars, linux-media,
	trivial, kernel-janitors

On Fri, Dec 18, 2020 at 07:35:58AM -0500, Nigel Christian wrote:
> On Fri, Dec 18, 2020 at 01:16:30PM +0300, Dan Carpenter wrote:
> > On Fri, Dec 18, 2020 at 01:31:17AM -0500, Nigel Christian wrote:
> > > Comment has 'then' repeated twice. Let's clean it up.
> > > Use unsigned int to maintain naming consistency.
> > > 
> > 
> > Do you use a tool to find the double "then then"?
> > 
> > regards,
> > dan carpenter
> > 
> 
> Started working on nodejs script to run the 'checkpatch.pl -f'
> on directories and filter the output by command line arg.

Ah...  I didn't realize that checkpatch could find this sort of thing.
Thanks!

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-18 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18  6:31 [PATCH] media: cec: fix trivial style warnings Nigel Christian
2020-12-18 10:16 ` Dan Carpenter
2020-12-18 12:35   ` Nigel Christian
2020-12-18 13:36     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).