From: Shuah Khan <shuah@kernel.org>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
Max Kellermann <max.kellermann@gmail.com>,
Colin Ian King <colin.king@canonical.com>,
Satendra Singh Thakur <satendra.t@samsung.com>,
Shuah Khan <shuahkh@osg.samsung.com>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH 18/25] media: dvb_frontend: get rid of dtv_get_property_dump()
Date: Thu, 21 Sep 2017 08:52:45 -0600 [thread overview]
Message-ID: <56186eeb-252d-ce8d-5a82-6fbc30981a3d@kernel.org> (raw)
In-Reply-To: <770f2fb8fba1930ca728ae6e713de86e2c6b95c8.1505933919.git.mchehab@s-opensource.com>
On 09/20/2017 01:11 PM, Mauro Carvalho Chehab wrote:
> Simplify the get property handling and move it to the existing
> code at dtv_property_process_get() directly.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
> drivers/media/dvb-core/dvb_frontend.c | 43 ++++++++++-------------------------
> 1 file changed, 12 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
> index b7094c7a405f..607eaf3db052 100644
> --- a/drivers/media/dvb-core/dvb_frontend.c
> +++ b/drivers/media/dvb-core/dvb_frontend.c
> @@ -1107,36 +1107,6 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
> _DTV_CMD(DTV_STAT_TOTAL_BLOCK_COUNT, 0, 0),
> };
>
> -static void dtv_get_property_dump(struct dvb_frontend *fe,
> - struct dtv_property *tvp)
> -{
> - int i;
> -
> - if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) {
> - dev_warn(fe->dvb->device, "%s: GET tvp.cmd = 0x%08x undefined\n"
> - , __func__,
> - tvp->cmd);
> - return;
> - }
> -
> - dev_dbg(fe->dvb->device, "%s: GET tvp.cmd = 0x%08x (%s)\n", __func__,
> - tvp->cmd,
> - dtv_cmds[tvp->cmd].name);
> -
> - if (dtv_cmds[tvp->cmd].buffer) {
> - dev_dbg(fe->dvb->device, "%s: tvp.u.buffer.len = 0x%02x\n",
> - __func__, tvp->u.buffer.len);
> -
> - for(i = 0; i < tvp->u.buffer.len; i++)
> - dev_dbg(fe->dvb->device,
> - "%s: tvp.u.buffer.data[0x%02x] = 0x%02x\n",
> - __func__, i, tvp->u.buffer.data[i]);
> - } else {
> - dev_dbg(fe->dvb->device, "%s: tvp.u.data = 0x%08x\n", __func__,
> - tvp->u.data);
> - }
> -}
> -
> /* Synchronise the legacy tuning parameters into the cache, so that demodulator
> * drivers can use a single set_frontend tuning function, regardless of whether
> * it's being used for the legacy or new API, reducing code and complexity.
> @@ -1529,7 +1499,18 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
> return -EINVAL;
> }
>
> - dtv_get_property_dump(fe, tvp);
> + if (!dtv_cmds[tvp->cmd].buffer)
> + dev_dbg(fe->dvb->device,
> + "%s: GET cmd 0x%08x (%s) = 0x%08x\n",
> + __func__, tvp->cmd, dtv_cmds[tvp->cmd].name,
> + tvp->u.data);
> + else
> + dev_dbg(fe->dvb->device,
> + "%s: GET cmd 0x%08x (%s) len %d: %*ph\n",
> + __func__,
> + tvp->cmd, dtv_cmds[tvp->cmd].name,
> + tvp->u.buffer.len,
> + tvp->u.buffer.len, tvp->u.buffer.data);
>
> return 0;
> }
>
Why not keep common dtv_property_dum(0 and make these enhancements to add
more information to the dump in a common routine so both get and set are
covered.
I think this change coupled with the change in 17/25 is moving away from
common simpler code to embedded debug code. I am not clear on the value
it adds.
thanks,
-- Shuah
next prev parent reply other threads:[~2017-09-21 14:52 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 19:11 [PATCH 00/25] DVB cleanups and documentation improvements Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 01/25] media: dvb_frontend: better document the -EPERM condition Mauro Carvalho Chehab
2017-09-20 21:29 ` Shuah Khan
2017-09-20 19:11 ` [PATCH 02/25] media: dvb_frontend: fix return values for FE_SET_PROPERTY Mauro Carvalho Chehab
2017-09-21 14:19 ` Shuah Khan
2017-09-20 19:11 ` [PATCH 03/25] media: dvbdev: convert DVB device types into an enum Mauro Carvalho Chehab
2017-09-21 13:06 ` Michael Ira Krufky
2017-09-21 15:38 ` Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 04/25] media: dvbdev: fully document its functions Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 05/25] media: dvb_frontend.h: improve kernel-doc markups Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 06/25] media: dtv-core.rst: add chapters and introductory tests for common parts Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 07/25] media: dtv-core.rst: split into multiple files Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 08/25] media: dtv-demux.rst: minor markup improvements Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 09/25] media: dvb_demux.h: add an enum for DMX_TYPE_* and document Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 10/25] media: dvb_demux.h: add an enum for DMX_STATE_* " Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 11/25] media: dvb_demux.h: get rid of unused timer at struct dvb_demux_filter Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 12/25] media: dvb_demux: mark a boolean field as such Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 13/25] media: dvb_demux: dvb_demux_feed.pusi_seen is boolean Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 14/25] media: dvb_demux.h: get rid of DMX_FEED_ENTRY() macro Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 15/25] media: dvb_demux: fix type of dvb_demux_feed.ts_type Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 16/25] media: dvb_demux: document dvb_demux_filter and dvb_demux_feed Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 17/25] media: dvb_frontend: dtv_property_process_set() cleanups Mauro Carvalho Chehab
2017-09-21 14:32 ` Shuah Khan
2017-09-21 16:00 ` Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 18/25] media: dvb_frontend: get rid of dtv_get_property_dump() Mauro Carvalho Chehab
2017-09-21 14:52 ` Shuah Khan [this message]
2017-09-20 19:11 ` [PATCH 19/25] media: dvb_demux.h: document structs defined on it Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 20/25] media: dvb_demux.h: document functions Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 21/25] scripts: kernel-doc: fix nexted handling Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 22/25] media: dmxdev.h: add kernel-doc markups for data types and functions Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 23/25] media: dtv-demux.rst: parse other demux headers with kernel-doc Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 24/25] media: dvb-net.rst: document DVB network kAPI interface Mauro Carvalho Chehab
2017-09-20 19:11 ` [PATCH 25/25] media: dvb uAPI docs: get rid of examples section Mauro Carvalho Chehab
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=56186eeb-252d-ce8d-5a82-6fbc30981a3d@kernel.org \
--to=shuah@kernel.org \
--cc=colin.king@canonical.com \
--cc=linux-media@vger.kernel.org \
--cc=max.kellermann@gmail.com \
--cc=mchehab@infradead.org \
--cc=mchehab@s-opensource.com \
--cc=satendra.t@samsung.com \
--cc=shuahkh@osg.samsung.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).