Skip to contentSkip to conversation

dummy_dvb_fe: Tidy up the dummy frontend

PATCH In review Daniel W. S. Almeida 4 participants 16 messages Dec 1, 2019 – Dec 31, 2019 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.24.0
#1 lore raw

PATCH 1/6 media: dvb_dummy_fe: place EXPORT_SYMBOL below corresponding function

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

dvb_dummy_fe.c had all its EXPORT_SYMBOL macros located at the end of the file. Now these are located directly below the symbol they are exporting for increased readability.

---
 drivers/media/dvb-frontends/dvb_dummy_fe.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/media/dvb-frontends/dvb_dummy_fe.c +3 -4
index 4db679cb70ad..909dac2345c4 100644
@@ -121,6 +121,7 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
 }
+EXPORT_SYMBOL(dvb_dummy_fe_ofdm_attach);
 
 static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;
 
@@ -138,6 +139,7 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
 }
+EXPORT_SYMBOL(dvb_dummy_fe_qpsk_attach);
 
 static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops;
 
@@ -155,6 +157,7 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
 }
+EXPORT_SYMBOL(dvb_dummy_fe_qam_attach);
 
 static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 	.delsys = { SYS_DVBT },
@@ -253,7 +256,3 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 MODULE_DESCRIPTION("DVB DUMMY Frontend");
 MODULE_AUTHOR("Emard");
 MODULE_LICENSE("GPL");
-
-EXPORT_SYMBOL(dvb_dummy_fe_ofdm_attach);
-EXPORT_SYMBOL(dvb_dummy_fe_qam_attach);
-EXPORT_SYMBOL(dvb_dummy_fe_qpsk_attach);
Signature · 6 lines
2.24.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#2 lore raw

PATCH 2/6 media: dvb_dummy_fe: Add error messages in case of attach failure

In reply to Daniel W. S. Almeida

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

Complain if the attach functions fail, for any reason. This is helpful when debugging.

---
 drivers/media/dvb-frontends/dvb_dummy_fe.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/media/dvb-frontends/dvb_dummy_fe.c +15 -3
index 909dac2345c4..987c3488fe6c 100644
@@ -114,12 +114,16 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
 	/* allocate memory for the internal state */
 	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
 	if (!state)
-		return NULL;
+		goto err;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
+
+err:
+	pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
+	return NULL;
 }
 EXPORT_SYMBOL(dvb_dummy_fe_ofdm_attach);
 
@@ -132,12 +136,16 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
 	/* allocate memory for the internal state */
 	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
 	if (!state)
-		return NULL;
+		goto err;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
+
+err:
+	pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
+	return NULL;
 }
 EXPORT_SYMBOL(dvb_dummy_fe_qpsk_attach);
 
@@ -150,12 +158,16 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
 	/* allocate memory for the internal state */
 	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
 	if (!state)
-		return NULL;
+		goto err;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
+
+err:
+	pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
+	return NULL;
 }
 EXPORT_SYMBOL(dvb_dummy_fe_qam_attach);
 
Signature · 6 lines
2.24.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#3 lore raw

Re: [PATCH 2/6] media: dvb_dummy_fe: Add error messages in case of attach failure

Quoted 20 lines · Daniel W. S. Almeida

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

Complain if the attach functions fail, for any reason. This is helpful when debugging.

---
 drivers/media/dvb-frontends/dvb_dummy_fe.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/media/dvb-frontends/dvb_dummy_fe.c +0 -1
index 909dac2345c4..987c3488fe6c 100644
@@ -114,12 +114,16 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
 	/* allocate memory for the internal state */
 	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
 	if (!state)
-		return NULL;

drivers/media/dvb-frontends/dvb_dummy_fe.c struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void) · line 126

Quoted 10 lines
drivers/media/dvb-frontends/dvb_dummy_fe.c +5 -0
+		goto err;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
+
+err:
+	pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
+	return NULL;

No need to log anything after k[zm]alloc() failures.

Thanks

Sean

Quoted 41 lines
drivers/media/dvb-frontends/dvb_dummy_fe.c +10 -2
 }
 EXPORT_SYMBOL(dvb_dummy_fe_ofdm_attach);
 
@@ -132,12 +136,16 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
 	/* allocate memory for the internal state */
 	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
 	if (!state)
-		return NULL;
+		goto err;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
+
+err:
+	pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
+	return NULL;
 }
 EXPORT_SYMBOL(dvb_dummy_fe_qpsk_attach);
 
@@ -150,12 +158,16 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
 	/* allocate memory for the internal state */
 	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
 	if (!state)
-		return NULL;
+		goto err;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops));
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
+
+err:
+	pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
+	return NULL;
 }
 EXPORT_SYMBOL(dvb_dummy_fe_qam_attach);
 
Signature · 1 line
2.24.0
#4 lore raw

PATCH 3/6 media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION

In reply to Daniel W. S. Almeida

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;

---
 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(-)
drivers/media/dvb-frontends/dvb_dummy_fe.c +12 -12
index 987c3488fe6c..209e7ac0de33 100644
@@ -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);
drivers/media/dvb-frontends/dvb_dummy_fe.h +3 -3
index 526fabd7751f..35efe2ce1a88 100644
@@ -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)
 {
Signature · 6 lines
2.24.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#5 lore raw

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

Hi Daniel,

Quoted 46 lines · Daniel W. S. Almeida

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"

(quoted diff) +1 -0
+	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"

(quoted diff) +1 -0
+	struct dvb_dummy_fe_state* state = NULL;

ERROR: "foo* bar" should be "foo *bar"

(quoted diff) +1 -0
+	struct dvb_dummy_fe_state* state = NULL;

ERROR: "foo* bar" should be "foo *bar"

(quoted diff) +1 -0
+	struct dvb_dummy_fe_state* state = NULL;
Quoted 2 lines

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

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

Thanks,

Sean

Quoted 113 lines
---
 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(-)
drivers/media/dvb-frontends/dvb_dummy_fe.c +12 -12
index 987c3488fe6c..209e7ac0de33 100644
@@ -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);
drivers/media/dvb-frontends/dvb_dummy_fe.h +3 -3
index 526fabd7751f..35efe2ce1a88 100644
@@ -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)
 {
Signature · 1 line
2.24.0
#6 lore raw

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

Hi Sean, thanks for reviewing this!

Quoted 8 lines

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?

#7 lore raw

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

Hi Daniel,

Quoted 19 lines · Daniel W. S. Almeida

Hi Sean, thanks for reviewing this!

Quoted 8 lines

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/

Quoted 7 lines

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

#8 lore raw

PATCH 4/6 media: dvb_dummy_fe: Fix long lines

In reply to Daniel W. S. Almeida

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

---
 drivers/media/dvb-frontends/dvb_dummy_fe.c | 61 ++++++++++++++++------
 1 file changed, 44 insertions(+), 17 deletions(-)
drivers/media/dvb-frontends/dvb_dummy_fe.c +44 -17
index 209e7ac0de33..67a6ed307c1f 100644
@@ -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
 	},
 
Signature · 1 line
2.24.0
#9 lore raw

Re: [Linux-kernel-mentees] [PATCH 4/6] media: dvb_dummy_fe: Fix long lines

+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,

Quoted 2 lines

+ 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)

+ .caps = FE_CAN_FEC_1_2 |

Quoted 2 lines

+ FE_CAN_FEC_2_3 |

Similarly, here too and other places too:

+ .caps = FE_CAN_FEC_1_2 |
+ FE_CAN_FEC_2_3 |

Regards,
Amit

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#10 lore raw

PATCH 4/6 media: dvb_dummy_fe: Fix long lines

+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,

Quoted 2 lines

+ 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)

drivers/media/dvb-frontends/dvb_dummy_fe.c static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { · line 192

Quoted 2 lines
drivers/media/dvb-frontends/dvb_dummy_fe.c +2 -0
+               .caps = FE_CAN_FEC_1_2 |
+                       FE_CAN_FEC_2_3 |

Similarly, here too and other places too:
+ .caps = FE_CAN_FEC_1_2 |
+ FE_CAN_FEC_2_3 |

Regards,
Amit

#11 lore raw

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

Somehow reply got messed up.

Quoted 24 lines · Amit Choudhary

+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,

Quoted 2 lines

+ u16 *strength)

In my opinion, the arguments on new line should be just below the start of arguments on top line. Like this:

(quoted diff) +2 -0
+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
+

u16 *strength)

drivers/media/dvb-frontends/dvb_dummy_fe.c static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { · line 192

Quoted 2 lines
drivers/media/dvb-frontends/dvb_dummy_fe.c +2 -0
+               .caps = FE_CAN_FEC_1_2 |
+                       FE_CAN_FEC_2_3 |

Similarly, here too and other places too:

drivers/media/dvb-frontends/dvb_dummy_fe.c +2 -0
+               .caps = FE_CAN_FEC_1_2 |
+                           FE_CAN_FEC_2_3 |

Regards,
Amit

#12 lore raw

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

In reply to Amit Choudhary

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

Quoted 11 lines

+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,

Quoted 2 lines

+ u16 *strength)

In my opinion, the arguments on new line should be just below the start of arguments on top line. Like this:

(quoted diff) +2 -0
+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)
Quoted 2 lines

+ .caps = FE_CAN_FEC_1_2 |

Quoted 1 line

+ 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
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#13 lore raw

PATCH 5/6 media: dvb_dummy_fe: Add blank line after declaration

In reply to Daniel W. S. Almeida

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

Fix checkpatch.pl error by adding a blank line

---
 drivers/media/dvb-frontends/dvb_dummy_fe.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/dvb-frontends/dvb_dummy_fe.c +1 -0
index 67a6ed307c1f..2bf847cef665 100644
@@ -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);
 }
 
Signature · 1 line
2.24.0
#14 lore raw

PATCH 6/6 media: dvb_dummy_frontend: remove 'extern' keyword from declaration

In reply to Daniel W. S. Almeida

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

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

---
 drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/dvb-frontends/dvb_dummy_fe.h +3 -3
index 35efe2ce1a88..1c82338e0c8a 100644
@@ -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)
 {
Signature · 6 lines
2.24.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#15 lore raw

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

Hi Daniel,

Quoted 15 lines · Daniel W. S. Almeida

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

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

---
 drivers/media/dvb-frontends/dvb_dummy_fe.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/dvb-frontends/dvb_dummy_fe.h +0 -0
index 35efe2ce1a88..1c82338e0c8a 100644

drivers/media/dvb-frontends/dvb_dummy_fe.h line 17

Quoted 9 lines
drivers/media/dvb-frontends/dvb_dummy_fe.h +3 -3
@@ -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

Quoted 5 lines
drivers/media/dvb-frontends/dvb_dummy_fe.h +0 -0
 #else
 static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
 {
Signature · 1 line
2.24.0