From: Joe Perches <joe@perches.com>
To: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Cc: richard.cochran@omicron.at, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, qi.wang@intel.com,
yong.y.wang@intel.com, joel.clark@intel.com,
kok.howg.ewe@intel.com, tomoya-linux@dsn.okisemi.com
Subject: Re: [PATCH v2] pch ieee1588 driver for Intel EG20T PCH
Date: Wed, 10 Aug 2011 06:40:43 -0700 [thread overview]
Message-ID: <1312983643.11924.84.camel@Joe-Laptop> (raw)
In-Reply-To: <1312956783-11460-1-git-send-email-toshiharu-linux@dsn.okisemi.com>
On Wed, 2011-08-10 at 15:13 +0900, Toshiharu Okada wrote:
> This patch is for IEEE1588 driver of Intel EG20T PCH.
> EG20T PCH is the platform controller hub that is used in Intel's
> general embedded platform.
> This driver adds support for using the EG20T PCH as a PTP clock.
> Would you review this patch, although this driver has not been tested yet?
Just trivia...
> diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
[]
> +/**
> + * struct ch_1588_params_ - 1588 module paramter
parameter
> + */
> +struct pch_params_ {
> + u8 station[STATION_ADDR_LEN];
> +};
names for struct types ending in _ are pretty unusual.
[]
> +/**
> + * get_decimal() - Returns the decimal value of the passed hexadecimal value
> + * @ch: The hexadecimal value that has to be converted.
> + */
> +static s32 get_decimal(u8 ch)
> +{
> + s32 ret;
> +
> + if ((ch >= '0') && (ch <= '9'))
> + ret = ch - '0';
> + else if ((ch >= 'A') && (ch <= 'F'))
> + ret = 10 + ch - 'A';
> + else if ((ch >= 'a') && (ch <= 'f'))
> + ret = 10 + ch - 'a';
> + else
> + return -1;
> +
> + return ret;
> +}
hex_to_bin
> +pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
[]
> + if (ret != 0) {
> + dev_err(&pdev->dev,
> + "%s:could not enable the pci device\n", __func__);
> + goto err_pci_en;
> + }
It seems all of the dev_<level> logging messages include __func__.
I think these __func__ uses are not particularly valuable and could
be removed.
> + /* retreive the available length of the IO memory space */
retrieve
> + if (!request_mem_region(chip->mem_base, chip->mem_size, "1588_regs")) {
> + dev_err(&pdev->dev, "%s: could not allocate register memory "
> + "space\n", __func__);
Please don't split format strings.
dev_err(&pdev->dev, "could not allocate register memory space\n");
or if you must
dev_err(&pdev->dev, "%s: could not allocate register memory space\n",
__func__);
[]
> + if (strcmp(pch_param.station, "00:00:00:00:00:00") != 0) {
> + if (pch_set_station_address(pch_param.station, pdev) != 0) {
> + dev_err(&pdev->dev,
> + "%s: Invalid station address parameter\n"
> + "Module loaded; But, station address not set "
> + "correctly\n", __func__);
dev_err(&pdev->dev,
"%s: Invalid station address parameter\n"
"Module loaded but station address not set correctly\n",
__func__);
prev parent reply other threads:[~2011-08-10 13:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 6:13 [PATCH v2] pch ieee1588 driver for Intel EG20T PCH Toshiharu Okada
2011-08-10 13:40 ` Joe Perches [this message]
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=1312983643.11924.84.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=joel.clark@intel.com \
--cc=kok.howg.ewe@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=qi.wang@intel.com \
--cc=richard.cochran@omicron.at \
--cc=tomoya-linux@dsn.okisemi.com \
--cc=toshiharu-linux@dsn.okisemi.com \
--cc=yong.y.wang@intel.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