From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> 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. Suggested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> --- drivers/media/dvb-frontends/dvb_dummy_fe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c index 4db679cb70ad..909dac2345c4 100644 --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c @@ -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); -- 2.24.0 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> Complain if the attach functions fail, for any reason. This is helpful when debugging. Suggested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> --- drivers/media/dvb-frontends/dvb_dummy_fe.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c index 909dac2345c4..987c3488fe6c 100644 --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c @@ -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); -- 2.24.0 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> 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 <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> --- 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> 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 <skhan@linuxfoundation.org> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> --- 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> Fix checkpatch.pl error by adding a blank line Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> --- 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> Fix CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files by removing it. Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> --- 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
[-- Attachment #1.1: Type: text/plain, Size: 637 bytes --] +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) + .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 [-- Attachment #1.2: Type: text/html, Size: 1306 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Em Sun, 1 Dec 2019 22:07:22 +0530 Amit Choudhary <amitchoudhary2305@gmail.com> 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Hi Daniel, On Sun, Dec 01, 2019 at 01:15:39PM -0300, Daniel W. S. Almeida wrote: > From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> > > 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 <skhan@linuxfoundation.org> > Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Hi Daniel, On Sun, Dec 01, 2019 at 01:15:42PM -0300, Daniel W. S. Almeida wrote: > From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> > > Fix CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files > by removing it. > > Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> > --- > 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
On Sun, Dec 01, 2019 at 01:15:38PM -0300, Daniel W. S. Almeida wrote: > From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> > > Complain if the attach functions fail, for any reason. This is helpful > when debugging. > > Suggested-by: Shuah Khan <skhan@linuxfoundation.org> > Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> > --- > drivers/media/dvb-frontends/dvb_dummy_fe.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c > index 909dac2345c4..987c3488fe6c 100644 > --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c > +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c > @@ -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; No need to log anything after k[zm]alloc() failures. Thanks Sean > } > 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); > > -- > 2.24.0 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
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? _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees