From: Sean Young <sean@mess.org>
To: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
Cc: kstewart@linuxfoundation.org, linux-kernel@vger.kernel.org,
rfontana@redhat.com, tglx@linutronix.de, mchehab@kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-media@vger.kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH 2/6] media: dvb_dummy_fe: Add error messages in case of attach failure
Date: Tue, 31 Dec 2019 10:20:20 +0000 [thread overview]
Message-ID: <20191231102020.GG24469@gofer.mess.org> (raw)
In-Reply-To: <20191201161542.69535-3-dwlsalmeida@gmail.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Sean Young <sean@mess.org>
To: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
Cc: mchehab@kernel.org, gregkh@linuxfoundation.org,
rfontana@redhat.com, kstewart@linuxfoundation.org,
tglx@linutronix.de, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] media: dvb_dummy_fe: Add error messages in case of attach failure
Date: Tue, 31 Dec 2019 10:20:20 +0000 [thread overview]
Message-ID: <20191231102020.GG24469@gofer.mess.org> (raw)
In-Reply-To: <20191201161542.69535-3-dwlsalmeida@gmail.com>
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
next prev parent reply other threads:[~2019-12-31 10:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-01 16:15 [Linux-kernel-mentees] [PATCH 0/6] dummy_dvb_fe: Tidy up the dummy frontend Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 1/6] media: dvb_dummy_fe: place EXPORT_SYMBOL below corresponding function Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 2/6] media: dvb_dummy_fe: Add error messages in case of attach failure Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-31 10:20 ` Sean Young [this message]
2019-12-31 10:20 ` Sean Young
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 3/6] media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-31 10:08 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 10:08 ` Sean Young
2019-12-31 18:14 ` [Linux-kernel-mentees] " Daniel W. S. Almeida
2019-12-31 18:14 ` Daniel W. S. Almeida
2019-12-31 18:34 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 18:34 ` Sean Young
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 4/6] media: dvb_dummy_fe: Fix long lines Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:37 ` [Linux-kernel-mentees] " Amit Choudhary
2019-12-01 16:52 ` Fwd: " Amit Choudhary
2019-12-01 16:54 ` Amit Choudhary
2019-12-02 5:35 ` [Linux-kernel-mentees] " Mauro Carvalho Chehab
2019-12-02 5:35 ` Mauro Carvalho Chehab
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 5/6] media: dvb_dummy_fe: Add blank line after declaration Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 6/6] media: dvb_dummy_frontend: remove 'extern' keyword from declaration Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-31 10:12 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 10:12 ` Sean Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191231102020.GG24469@gofer.mess.org \
--to=sean@mess.org \
--cc=dwlsalmeida@gmail.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rfontana@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.