2019-12-01 16:25:36

by Daniel Almeida

[permalink] [raw]
Subject: [PATCH 0/6] dummy_dvb_fe: Tidy up the dummy frontend

From: "Daniel W. S. Almeida" <[email protected]>

This patch series irons out checkpatch.pl errors in dvb_dummy_fe.c
and dvb_dummy_fe.h.

These patches were sent previously in a separate fashion, but they
are now compiled into this series. One of them would not apply, but
I fixed this as well.

Daniel W. S. Almeida (6):
media: dvb_dummy_fe: place EXPORT_SYMBOL below corresponding function
media: dvb_dummy_fe: Add error messages in case of attach failure
media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION
media: dvb_dummy_fe: Fix long lines
media: dvb_dummy_fe: Add blank line after declaration
media: dvb_dummy_frontend: remove 'extern' keyword from declaration

drivers/media/dvb-frontends/dvb_dummy_fe.c | 109 ++++++++++++++-------
drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +-
2 files changed, 77 insertions(+), 38 deletions(-)

--
2.24.0


2019-12-01 16:26:25

by Daniel Almeida

[permalink] [raw]
Subject: [PATCH 3/6] media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION

From: "Daniel W. S. Almeida" <[email protected]>

Change foo* bar to foo *bar to avoid ERROR: POINTER_LOCATION in checkpatch.pl

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_sleep(struct dvb_frontend* fe)

ERROR: "foo* bar" should be "foo *bar"
+static int dvb_dummy_fe_init(struct dvb_frontend* fe)

ERROR: "foo* bar" should be "foo *bar"
+static void dvb_dummy_fe_release(struct dvb_frontend* fe)

ERROR: "foo* bar" should be "foo *bar"
+ struct dvb_dummy_fe_state* state = fe->demodulator_priv;

ERROR: "foo* bar" should be "foo *bar"
+struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)

ERROR: "foo* bar" should be "foo *bar"
+ struct dvb_dummy_fe_state* state = NULL;

ERROR: "foo* bar" should be "foo *bar"
+ struct dvb_dummy_fe_state* state = NULL;

ERROR: "foo* bar" should be "foo *bar"
+ struct dvb_dummy_fe_state* state = NULL;

Suggested-by: Shuah Khan <[email protected]>
Signed-off-by: Daniel W. S. Almeida <[email protected]>
---
drivers/media/dvb-frontends/dvb_dummy_fe.c | 24 +++++++++++-----------
drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +++---
2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c
index 987c3488fe6c..209e7ac0de33 100644
--- a/drivers/media/dvb-frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c
@@ -31,25 +31,25 @@ static int dvb_dummy_fe_read_status(struct dvb_frontend *fe,
return 0;
}

-static int dvb_dummy_fe_read_ber(struct dvb_frontend* fe, u32* ber)
+static int dvb_dummy_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
{
*ber = 0;
return 0;
}

-static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength)
+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
*strength = 0;
return 0;
}

-static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr)
+static int dvb_dummy_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
{
*snr = 0;
return 0;
}

-static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
+static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
*ucblocks = 0;
return 0;
@@ -77,12 +77,12 @@ static int dvb_dummy_fe_set_frontend(struct dvb_frontend *fe)
return 0;
}

-static int dvb_dummy_fe_sleep(struct dvb_frontend* fe)
+static int dvb_dummy_fe_sleep(struct dvb_frontend *fe)
{
return 0;
}

-static int dvb_dummy_fe_init(struct dvb_frontend* fe)
+static int dvb_dummy_fe_init(struct dvb_frontend *fe)
{
return 0;
}
@@ -99,17 +99,17 @@ static int dvb_dummy_fe_set_voltage(struct dvb_frontend *fe,
return 0;
}

-static void dvb_dummy_fe_release(struct dvb_frontend* fe)
+static void dvb_dummy_fe_release(struct dvb_frontend *fe)
{
- struct dvb_dummy_fe_state* state = fe->demodulator_priv;
+ struct dvb_dummy_fe_state *state = fe->demodulator_priv;
kfree(state);
}

static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops;

-struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
+struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
{
- struct dvb_dummy_fe_state* state = NULL;
+ struct dvb_dummy_fe_state *state = NULL;

/* allocate memory for the internal state */
state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
@@ -131,7 +131,7 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;

struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
{
- struct dvb_dummy_fe_state* state = NULL;
+ struct dvb_dummy_fe_state *state = NULL;

/* allocate memory for the internal state */
state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
@@ -153,7 +153,7 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops;

struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
{
- struct dvb_dummy_fe_state* state = NULL;
+ struct dvb_dummy_fe_state *state = NULL;

/* allocate memory for the internal state */
state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.h b/drivers/media/dvb-frontends/dvb_dummy_fe.h
index 526fabd7751f..35efe2ce1a88 100644
--- a/drivers/media/dvb-frontends/dvb_dummy_fe.h
+++ b/drivers/media/dvb-frontends/dvb_dummy_fe.h
@@ -12,9 +12,9 @@
#include <media/dvb_frontend.h>

#if IS_REACHABLE(CONFIG_DVB_DUMMY_FE)
-extern struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void);
-extern struct dvb_frontend* dvb_dummy_fe_qpsk_attach(void);
-extern struct dvb_frontend* dvb_dummy_fe_qam_attach(void);
+extern struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
+extern struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
+extern struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
#else
static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
{
--
2.24.0

2019-12-01 16:27:46

by Daniel Almeida

[permalink] [raw]
Subject: [PATCH 6/6] media: dvb_dummy_frontend: remove 'extern' keyword from declaration

From: "Daniel W. S. Almeida" <[email protected]>

Fix CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files
by removing it.

Signed-off-by: Daniel W. S. Almeida <[email protected]>
---
drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.h b/drivers/media/dvb-frontends/dvb_dummy_fe.h
index 35efe2ce1a88..1c82338e0c8a 100644
--- a/drivers/media/dvb-frontends/dvb_dummy_fe.h
+++ b/drivers/media/dvb-frontends/dvb_dummy_fe.h
@@ -12,9 +12,9 @@
#include <media/dvb_frontend.h>

#if IS_REACHABLE(CONFIG_DVB_DUMMY_FE)
-extern struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
-extern struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
-extern struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
+struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
+struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
+struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
#else
static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
{
--
2.24.0

2019-12-01 16:28:42

by Daniel Almeida

[permalink] [raw]
Subject: [PATCH 4/6] media: dvb_dummy_fe: Fix long lines

From: "Daniel W. S. Almeida" <[email protected]>

Break long lines into smaller ones to improve readability.

WARNING: line over 80 characters
+ memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops));

WARNING: line over 80 characters
+ memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops));
WARNING: line over 80 characters
+ memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops));

WARNING: line over 80 characters
+ FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |

WARNING: line over 80 characters
+ FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |

WARNING: line over 80 characters
+ FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |

WARNING: line over 80 characters
+ .symbol_rate_min = (57840000 / 2) / 6

Suggested-by: Shuah Khan <[email protected]>
Signed-off-by: Daniel W. S. Almeida <[email protected]>
---
drivers/media/dvb-frontends/dvb_dummy_fe.c | 61 ++++++++++++++++------
1 file changed, 44 insertions(+), 17 deletions(-)

diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c
index 209e7ac0de33..67a6ed307c1f 100644
--- a/drivers/media/dvb-frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c
@@ -37,7 +37,8 @@ static int dvb_dummy_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
return 0;
}

-static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
+ u16 *strength)
{
*strength = 0;
return 0;
@@ -117,7 +118,10 @@ struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
goto err;

/* create dvb_frontend */
- memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops));
+ memcpy(&state->frontend.ops,
+ &dvb_dummy_fe_ofdm_ops,
+ sizeof(struct dvb_frontend_ops));
+
state->frontend.demodulator_priv = state;
return &state->frontend;

@@ -139,7 +143,10 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
goto err;

/* create dvb_frontend */
- memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops));
+ memcpy(&state->frontend.ops,
+ &dvb_dummy_fe_qpsk_ops,
+ sizeof(struct dvb_frontend_ops));
+
state->frontend.demodulator_priv = state;
return &state->frontend;

@@ -161,7 +168,10 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
goto err;

/* create dvb_frontend */
- memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops));
+ memcpy(&state->frontend.ops,
+ &dvb_dummy_fe_qam_ops,
+ sizeof(struct dvb_frontend_ops));
+
state->frontend.demodulator_priv = state;
return &state->frontend;

@@ -178,13 +188,21 @@ static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
.frequency_min_hz = 0,
.frequency_max_hz = 863250 * kHz,
.frequency_stepsize_hz = 62500,
- .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
- FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
- FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
- FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
- FE_CAN_TRANSMISSION_MODE_AUTO |
- FE_CAN_GUARD_INTERVAL_AUTO |
- FE_CAN_HIERARCHY_AUTO,
+ .caps = FE_CAN_FEC_1_2 |
+ FE_CAN_FEC_2_3 |
+ FE_CAN_FEC_3_4 |
+ FE_CAN_FEC_4_5 |
+ FE_CAN_FEC_5_6 |
+ FE_CAN_FEC_6_7 |
+ FE_CAN_FEC_7_8 |
+ FE_CAN_FEC_8_9 |
+ FE_CAN_FEC_AUTO |
+ FE_CAN_QAM_16 |
+ FE_CAN_QAM_64 |
+ FE_CAN_QAM_AUTO |
+ FE_CAN_TRANSMISSION_MODE_AUTO |
+ FE_CAN_GUARD_INTERVAL_AUTO |
+ FE_CAN_HIERARCHY_AUTO,
},

.release = dvb_dummy_fe_release,
@@ -209,11 +227,16 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
.frequency_min_hz = 51 * MHz,
.frequency_max_hz = 858 * MHz,
.frequency_stepsize_hz = 62500,
- .symbol_rate_min = (57840000 / 2) / 64, /* SACLK/64 == (XIN/2)/64 */
+ /* symbol_rate_min: SACLK/64 == (XIN/2)/64 */
+ .symbol_rate_min = (57840000 / 2) / 64,
.symbol_rate_max = (57840000 / 2) / 4, /* SACLK/4 */
- .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |
- FE_CAN_QAM_128 | FE_CAN_QAM_256 |
- FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO
+ .caps = FE_CAN_QAM_16 |
+ FE_CAN_QAM_32 |
+ FE_CAN_QAM_64 |
+ FE_CAN_QAM_128 |
+ FE_CAN_QAM_256 |
+ FE_CAN_FEC_AUTO |
+ FE_CAN_INVERSION_AUTO
},

.release = dvb_dummy_fe_release,
@@ -242,8 +265,12 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
.symbol_rate_min = 1000000,
.symbol_rate_max = 45000000,
.caps = FE_CAN_INVERSION_AUTO |
- FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
- FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
+ FE_CAN_FEC_1_2 |
+ FE_CAN_FEC_2_3 |
+ FE_CAN_FEC_3_4 |
+ FE_CAN_FEC_5_6 |
+ FE_CAN_FEC_7_8 |
+ FE_CAN_FEC_AUTO |
FE_CAN_QPSK
},

--
2.24.0

2019-12-01 16:29:26

by Daniel Almeida

[permalink] [raw]
Subject: [PATCH 5/6] media: dvb_dummy_fe: Add blank line after declaration

From: "Daniel W. S. Almeida" <[email protected]>

Fix checkpatch.pl error by adding a blank line

Signed-off-by: Daniel W. S. Almeida <[email protected]>
---
drivers/media/dvb-frontends/dvb_dummy_fe.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c
index 67a6ed307c1f..2bf847cef665 100644
--- a/drivers/media/dvb-frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c
@@ -103,6 +103,7 @@ static int dvb_dummy_fe_set_voltage(struct dvb_frontend *fe,
static void dvb_dummy_fe_release(struct dvb_frontend *fe)
{
struct dvb_dummy_fe_state *state = fe->demodulator_priv;
+
kfree(state);
}

--
2.24.0

2019-12-02 05:42:30

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 4/6] media: dvb_dummy_fe: Fix long lines

Em Sun, 1 Dec 2019 22:07:22 +0530
Amit Choudhary <[email protected]> escreveu:

> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
>
> > + u16 *strength)
> >
>
> In my opinion, the arguments on new line should be just below the start of
> arguments on top line. Like this:
>
> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
> + u16
> *strength)

No, that is not the way we indent. The alignment is relative to the open
parenthesis:

foo(arg1,
arg2);

Btw, if you run checkpatch --strict, you'll see it complaining if the
alignment is different:

CHECK: Alignment should match open parenthesis
#2: FILE: a.c:2:
+void foo(int arg1,
+ int arg2)

> + .caps = FE_CAN_FEC_1_2 |
> > + FE_CAN_FEC_2_3 |

The alignment here is given by the first argument:

bitfield = BIT_1 |
BIT_2 |
BIT_3 |
...

or

bitfield = BIT_1
| BIT_2
| BIT_3
...

On media, we usually prefer the first form.

Cheers,
Mauro

2019-12-31 10:09:07

by Sean Young

[permalink] [raw]
Subject: Re: [PATCH 3/6] media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION

Hi Daniel,

On Sun, Dec 01, 2019 at 01:15:39PM -0300, Daniel W. S. Almeida wrote:
> From: "Daniel W. S. Almeida" <[email protected]>
>
> Change foo* bar to foo *bar to avoid ERROR: POINTER_LOCATION in checkpatch.pl
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_sleep(struct dvb_frontend* fe)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static int dvb_dummy_fe_init(struct dvb_frontend* fe)
>
> ERROR: "foo* bar" should be "foo *bar"
> +static void dvb_dummy_fe_release(struct dvb_frontend* fe)
>
> ERROR: "foo* bar" should be "foo *bar"
> + struct dvb_dummy_fe_state* state = fe->demodulator_priv;
>
> ERROR: "foo* bar" should be "foo *bar"
> +struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
>
> ERROR: "foo* bar" should be "foo *bar"
> + struct dvb_dummy_fe_state* state = NULL;
>
> ERROR: "foo* bar" should be "foo *bar"
> + struct dvb_dummy_fe_state* state = NULL;
>
> ERROR: "foo* bar" should be "foo *bar"
> + struct dvb_dummy_fe_state* state = NULL;
>
> Suggested-by: Shuah Khan <[email protected]>
> Signed-off-by: Daniel W. S. Almeida <[email protected]>

The comments from Mauro in the previous version of this patch have not been
addressed:

https://patchwork.linuxtv.org/patch/60048/#114016

Thanks,

Sean


> ---
> drivers/media/dvb-frontends/dvb_dummy_fe.c | 24 +++++++++++-----------
> drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +++---
> 2 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c
> index 987c3488fe6c..209e7ac0de33 100644
> --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c
> +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c
> @@ -31,25 +31,25 @@ static int dvb_dummy_fe_read_status(struct dvb_frontend *fe,
> return 0;
> }
>
> -static int dvb_dummy_fe_read_ber(struct dvb_frontend* fe, u32* ber)
> +static int dvb_dummy_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
> {
> *ber = 0;
> return 0;
> }
>
> -static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend* fe, u16* strength)
> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
> {
> *strength = 0;
> return 0;
> }
>
> -static int dvb_dummy_fe_read_snr(struct dvb_frontend* fe, u16* snr)
> +static int dvb_dummy_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
> {
> *snr = 0;
> return 0;
> }
>
> -static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
> +static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
> {
> *ucblocks = 0;
> return 0;
> @@ -77,12 +77,12 @@ static int dvb_dummy_fe_set_frontend(struct dvb_frontend *fe)
> return 0;
> }
>
> -static int dvb_dummy_fe_sleep(struct dvb_frontend* fe)
> +static int dvb_dummy_fe_sleep(struct dvb_frontend *fe)
> {
> return 0;
> }
>
> -static int dvb_dummy_fe_init(struct dvb_frontend* fe)
> +static int dvb_dummy_fe_init(struct dvb_frontend *fe)
> {
> return 0;
> }
> @@ -99,17 +99,17 @@ static int dvb_dummy_fe_set_voltage(struct dvb_frontend *fe,
> return 0;
> }
>
> -static void dvb_dummy_fe_release(struct dvb_frontend* fe)
> +static void dvb_dummy_fe_release(struct dvb_frontend *fe)
> {
> - struct dvb_dummy_fe_state* state = fe->demodulator_priv;
> + struct dvb_dummy_fe_state *state = fe->demodulator_priv;
> kfree(state);
> }
>
> static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops;
>
> -struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
> +struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
> {
> - struct dvb_dummy_fe_state* state = NULL;
> + struct dvb_dummy_fe_state *state = NULL;
>
> /* allocate memory for the internal state */
> state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
> @@ -131,7 +131,7 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;
>
> struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
> {
> - struct dvb_dummy_fe_state* state = NULL;
> + struct dvb_dummy_fe_state *state = NULL;
>
> /* allocate memory for the internal state */
> state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
> @@ -153,7 +153,7 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops;
>
> struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
> {
> - struct dvb_dummy_fe_state* state = NULL;
> + struct dvb_dummy_fe_state *state = NULL;
>
> /* allocate memory for the internal state */
> state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
> diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.h b/drivers/media/dvb-frontends/dvb_dummy_fe.h
> index 526fabd7751f..35efe2ce1a88 100644
> --- a/drivers/media/dvb-frontends/dvb_dummy_fe.h
> +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.h
> @@ -12,9 +12,9 @@
> #include <media/dvb_frontend.h>
>
> #if IS_REACHABLE(CONFIG_DVB_DUMMY_FE)
> -extern struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void);
> -extern struct dvb_frontend* dvb_dummy_fe_qpsk_attach(void);
> -extern struct dvb_frontend* dvb_dummy_fe_qam_attach(void);
> +extern struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
> +extern struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
> +extern struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
> #else
> static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
> {
> --
> 2.24.0

2019-12-31 10:13:30

by Sean Young

[permalink] [raw]
Subject: Re: [PATCH 6/6] media: dvb_dummy_frontend: remove 'extern' keyword from declaration

Hi Daniel,

On Sun, Dec 01, 2019 at 01:15:42PM -0300, Daniel W. S. Almeida wrote:
> From: "Daniel W. S. Almeida" <[email protected]>
>
> Fix CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files
> by removing it.
>
> Signed-off-by: Daniel W. S. Almeida <[email protected]>
> ---
> drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.h b/drivers/media/dvb-frontends/dvb_dummy_fe.h
> index 35efe2ce1a88..1c82338e0c8a 100644
> --- a/drivers/media/dvb-frontends/dvb_dummy_fe.h
> +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.h
> @@ -12,9 +12,9 @@
> #include <media/dvb_frontend.h>
>
> #if IS_REACHABLE(CONFIG_DVB_DUMMY_FE)
> -extern struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
> -extern struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
> -extern struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
> +struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
> +struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
> +struct dvb_frontend *dvb_dummy_fe_qam_attach(void);

Please add these changes to your patch:
"media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION"

Every patch should pass the checkpatch --strict test by itself; you
cannot fix checkpatch errors in a patch in a subsequent patch.

Thanks,
Sean

> #else
> static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
> {
> --
> 2.24.0

2019-12-31 18:16:23

by Daniel Almeida

[permalink] [raw]
Subject: Re: [PATCH 3/6] media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION

Hi Sean, thanks for reviewing this!


> The comments from Mauro in the previous version of this patch have not been
> addressed:
>
> https://patchwork.linuxtv.org/patch/60048/#114016
>
> Thanks,
>
> Sean

As you've also noted, I have these as separate patches, i.e.

https://patchwork.linuxtv.org/patch/60430/

https://patchwork.linuxtv.org/patch/60432/


I will squash them with this one and send v2. I will also drop this from
the series:

https://patchwork.linuxtv.org/patch/60428/


Is this OK with you?

2019-12-31 18:37:21

by Sean Young

[permalink] [raw]
Subject: Re: [PATCH 3/6] media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION

Hi Daniel,

On Tue, Dec 31, 2019 at 03:14:04PM -0300, Daniel W. S. Almeida wrote:
> Hi Sean, thanks for reviewing this!
>
>
> > The comments from Mauro in the previous version of this patch have not been
> > addressed:
> >
> > https://patchwork.linuxtv.org/patch/60048/#114016
> >
> > Thanks,
> >
> > Sean
>
> As you've also noted, I have these as separate patches, i.e.
>
> https://patchwork.linuxtv.org/patch/60430/
>
> https://patchwork.linuxtv.org/patch/60432/
>
>
> I will squash them with this one and send v2. I will also drop this from the
> series:
>
> https://patchwork.linuxtv.org/patch/60428/
>
>
> Is this OK with you?

That's perfect, although v2 already exists so please name it v3 (or whatever
the next available version is).

Thanks!

Sean