2013-04-05 16:31:26

by Paul Bolle

[permalink] [raw]
Subject: [PATCH] nfc: Remove useless Makefile line

There's no Kconfig symbol NFC_DEBUG. Besides, there doesn't seem to be
any nfc code that uses a DEBUG macro. This line can safely be removed.

Signed-off-by: Paul Bolle <[email protected]>
---
Untested.

drivers/nfc/Makefile | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/nfc/Makefile b/drivers/nfc/Makefile
index a189ada0..5b4ad00 100644
--- a/drivers/nfc/Makefile
+++ b/drivers/nfc/Makefile
@@ -6,5 +6,3 @@ obj-$(CONFIG_NFC_PN544) += pn544/
obj-$(CONFIG_NFC_MICROREAD) += microread/
obj-$(CONFIG_NFC_PN533) += pn533.o
obj-$(CONFIG_NFC_WILINK) += nfcwilink.o
-
-ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG
--
1.7.11.7


2013-04-05 16:35:22

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] nfc: Remove useless Makefile line

On Fri, 2013-04-05 at 18:31 +0200, Paul Bolle wrote:
> There's no Kconfig symbol NFC_DEBUG. Besides, there doesn't seem to be
> any nfc code that uses a DEBUG macro. This line can safely be removed.
[]
> diff --git a/drivers/nfc/Makefile b/drivers/nfc/Makefile
[]
> -ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG

pr_debug/dev_dbg/nfc_dev_dbg logging messages
depend on this.

2013-04-05 16:39:22

by Paul Bolle

[permalink] [raw]
Subject: Re: [PATCH] nfc: Remove useless Makefile line

On Fri, 2013-04-05 at 09:35 -0700, Joe Perches wrote:
> On Fri, 2013-04-05 at 18:31 +0200, Paul Bolle wrote:
> > -ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG
>
> pr_debug/dev_dbg/nfc_dev_dbg logging messages
> depend on this.

Thanks. But then a NFC_DEBUG symbol needs to be added, because now the
DEBUG macro will never be set, won't it?


Paul Bolle

2013-04-05 16:46:55

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] nfc: Remove useless Makefile line

On Fri, 2013-04-05 at 18:39 +0200, Paul Bolle wrote:
> On Fri, 2013-04-05 at 09:35 -0700, Joe Perches wrote:
> > On Fri, 2013-04-05 at 18:31 +0200, Paul Bolle wrote:
> > > -ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG
> >
> > pr_debug/dev_dbg/nfc_dev_dbg logging messages
> > depend on this.
>
> Thanks. But then a NFC_DEBUG symbol needs to be added, because now the
> DEBUG macro will never be set, won't it?

Probably right.

I think all the nfc_dev_<level> uses are unsightly too.
Almost all the nfc_dev_dbg uses are functdion enter/leave
logging and should be done via the function tracer.

I'll submit some patches for that.

2013-04-05 19:27:48

by Joe Perches

[permalink] [raw]
Subject: [PATCH 0/3] nfc: standardize logging styles

Fix some defects in the logging too

Joe Perches (3):
nfc: Replace nfc_dev_dbg with dev_dbg, remove function tracing
nfc: Convert nfc_dev_info and nfc_dev_err to nfc_<level>
nfc: Standardize logging style

drivers/nfc/microread/i2c.c | 32 ++---
drivers/nfc/microread/mei.c | 20 +--
drivers/nfc/microread/microread.c | 7 +-
drivers/nfc/nfcwilink.c | 95 ++++++-------
drivers/nfc/pn533.c | 271 ++++++++++++++++----------------------
drivers/nfc/pn544/i2c.c | 38 +++---
drivers/nfc/pn544/pn544.c | 13 +-
include/net/nfc/nfc.h | 5 +-
8 files changed, 196 insertions(+), 285 deletions(-)

--
1.8.1.2.459.gbcd45b4.dirty

2013-04-05 19:27:59

by Joe Perches

[permalink] [raw]
Subject: [PATCH 1/3] nfc: Replace nfc_dev_dbg with dev_dbg, remove function tracing

Use the generic kernel function instead of a home-grown
one that does the same thing. Remove empty function
tracing style uses as the kernel function tracer does
that too.

Add \n to uses not at the macro. Don't add \n where
the nfc_dev_dbg macro mistakenly had them already.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/nfc/nfcwilink.c | 51 +++++++--------------
drivers/nfc/pn533.c | 118 ++++++++++++++++--------------------------------
include/net/nfc/nfc.h | 1 -
3 files changed, 56 insertions(+), 114 deletions(-)

diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
index 3b731ac..b2f4040 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -146,8 +146,6 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
unsigned long comp_ret;
int rc;

- nfc_dev_dbg(&drv->pdev->dev, "get_bts_file_name entry");
-
skb = nfcwilink_skb_alloc(sizeof(struct nci_vs_nfcc_info_cmd),
GFP_KERNEL);
if (!skb) {
@@ -172,17 +170,16 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)

comp_ret = wait_for_completion_timeout(&drv->completed,
msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
- nfc_dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld",
- comp_ret);
+ dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
+ comp_ret);
if (comp_ret == 0) {
- nfc_dev_err(&drv->pdev->dev,
- "timeout on wait_for_completion_timeout");
+ dev_err(&drv->pdev->dev,
+ "timeout on wait_for_completion_timeout\n");
return -ETIMEDOUT;
}

- nfc_dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d",
- drv->nfcc_info.plen,
- drv->nfcc_info.status);
+ dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d\n",
+ drv->nfcc_info.plen, drv->nfcc_info.status);

if ((drv->nfcc_info.plen != 5) || (drv->nfcc_info.status != 0)) {
nfc_dev_err(&drv->pdev->dev,
@@ -209,8 +206,6 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
unsigned long comp_ret;
int rc;

- nfc_dev_dbg(&drv->pdev->dev, "send_bts_cmd entry");
-
/* verify valid cmd for the NFC channel */
if ((len <= sizeof(struct nfcwilink_hdr)) ||
(len > BTS_FILE_CMD_MAX_LEN) ||
@@ -242,8 +237,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)

comp_ret = wait_for_completion_timeout(&drv->completed,
msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
- nfc_dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld",
- comp_ret);
+ dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
+ comp_ret);
if (comp_ret == 0) {
nfc_dev_err(&drv->pdev->dev,
"timeout on wait_for_completion_timeout");
@@ -261,8 +256,6 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
__u8 *ptr;
int len, rc;

- nfc_dev_dbg(&drv->pdev->dev, "download_fw entry");
-
set_bit(NFCWILINK_FW_DOWNLOAD, &drv->flags);

rc = nfcwilink_get_bts_file_name(drv, file_name);
@@ -284,8 +277,8 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
ptr = (__u8 *)fw->data;

if ((len == 0) || (ptr == NULL)) {
- nfc_dev_dbg(&drv->pdev->dev,
- "request_firmware returned size %d", len);
+ dev_dbg(&drv->pdev->dev,
+ "request_firmware returned size %d\n", len);
goto release_fw;
}

@@ -306,8 +299,8 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
action_len =
__le16_to_cpu(((struct bts_file_action *)ptr)->len);

- nfc_dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d",
- action_type, action_len);
+ dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d\n",
+ action_type, action_len);

switch (action_type) {
case BTS_FILE_ACTION_TYPE_SEND_CMD:
@@ -337,8 +330,6 @@ static void nfcwilink_register_complete(void *priv_data, char data)
{
struct nfcwilink *drv = priv_data;

- nfc_dev_dbg(&drv->pdev->dev, "register_complete entry");
-
/* store ST registration status */
drv->st_register_cb_status = data;

@@ -360,7 +351,7 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
return -EFAULT;
}

- nfc_dev_dbg(&drv->pdev->dev, "receive entry, len %d", skb->len);
+ dev_dbg(&drv->pdev->dev, "receive entry, len %d\n", skb->len);

/* strip the ST header
(apart for the chnl byte, which is not received in the hdr) */
@@ -402,8 +393,6 @@ static int nfcwilink_open(struct nci_dev *ndev)
unsigned long comp_ret;
int rc;

- nfc_dev_dbg(&drv->pdev->dev, "open entry");
-
if (test_and_set_bit(NFCWILINK_RUNNING, &drv->flags)) {
rc = -EBUSY;
goto exit;
@@ -421,9 +410,9 @@ static int nfcwilink_open(struct nci_dev *ndev)
&drv->completed,
msecs_to_jiffies(NFCWILINK_REGISTER_TIMEOUT));

- nfc_dev_dbg(&drv->pdev->dev,
- "wait_for_completion_timeout returned %ld",
- comp_ret);
+ dev_dbg(&drv->pdev->dev,
+ "wait_for_completion_timeout returned %ld\n",
+ comp_ret);

if (comp_ret == 0) {
/* timeout */
@@ -466,8 +455,6 @@ static int nfcwilink_close(struct nci_dev *ndev)
struct nfcwilink *drv = nci_get_drvdata(ndev);
int rc;

- nfc_dev_dbg(&drv->pdev->dev, "close entry");
-
if (!test_and_clear_bit(NFCWILINK_RUNNING, &drv->flags))
return 0;

@@ -487,7 +474,7 @@ static int nfcwilink_send(struct sk_buff *skb)
struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000};
long len;

- nfc_dev_dbg(&drv->pdev->dev, "send entry, len %d", skb->len);
+ dev_dbg(&drv->pdev->dev, "send entry, len %d\n", skb->len);

if (!test_bit(NFCWILINK_RUNNING, &drv->flags)) {
kfree_skb(skb);
@@ -524,8 +511,6 @@ static int nfcwilink_probe(struct platform_device *pdev)
int rc;
__u32 protocols;

- nfc_dev_dbg(&pdev->dev, "probe entry");
-
drv = devm_kzalloc(&pdev->dev, sizeof(struct nfcwilink), GFP_KERNEL);
if (!drv) {
rc = -ENOMEM;
@@ -576,8 +561,6 @@ static int nfcwilink_remove(struct platform_device *pdev)
struct nfcwilink *drv = dev_get_drvdata(&pdev->dev);
struct nci_dev *ndev;

- nfc_dev_dbg(&pdev->dev, "remove entry");
-
if (!drv)
return -EFAULT;

diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index f0f6763..e2956a6 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -527,9 +527,9 @@ static void pn533_recv_response(struct urb *urb)
break; /* success */
case -ECONNRESET:
case -ENOENT:
- nfc_dev_dbg(&dev->interface->dev,
- "The urb has been canceled (status %d)",
- urb->status);
+ dev_dbg(&dev->interface->dev,
+ "The urb has been canceled (status %d)\n",
+ urb->status);
dev->wq_in_error = urb->status;
goto sched_wq;
case -ESHUTDOWN:
@@ -542,7 +542,7 @@ static void pn533_recv_response(struct urb *urb)

in_frame = dev->in_urb->transfer_buffer;

- nfc_dev_dbg(&dev->interface->dev, "Received a frame.");
+ dev_dbg(&dev->interface->dev, "Received a frame\n");
print_hex_dump(KERN_DEBUG, "PN533 RX: ", DUMP_PREFIX_NONE, 16, 1,
in_frame, dev->ops->rx_frame_size(in_frame), false);

@@ -583,9 +583,9 @@ static void pn533_recv_ack(struct urb *urb)
break; /* success */
case -ECONNRESET:
case -ENOENT:
- nfc_dev_dbg(&dev->interface->dev,
- "The urb has been stopped (status %d)",
- urb->status);
+ dev_dbg(&dev->interface->dev,
+ "The urb has been stopped (status %d)\n",
+ urb->status);
dev->wq_in_error = urb->status;
goto sched_wq;
case -ESHUTDOWN:
@@ -631,8 +631,6 @@ static int pn533_send_ack(struct pn533 *dev, gfp_t flags)
/* spec 7.1.1.3: Preamble, SoPC (2), ACK Code (2), Postamble */
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
dev->out_urb->transfer_buffer = ack;
dev->out_urb->transfer_buffer_length = sizeof(ack);
rc = usb_submit_urb(dev->out_urb, flags);
@@ -739,7 +737,7 @@ static int __pn533_send_async(struct pn533 *dev, u8 cmd_code,
struct pn533_send_async_complete_arg *arg;
int rc = 0;

- nfc_dev_dbg(&dev->interface->dev, "Sending command 0x%x", cmd_code);
+ dev_dbg(&dev->interface->dev, "Sending command 0x%x\n", cmd_code);

arg = kzalloc(sizeof(*arg), GFP_KERNEL);
if (!arg)
@@ -764,8 +762,8 @@ static int __pn533_send_async(struct pn533 *dev, u8 cmd_code,
goto unlock;
}

- nfc_dev_dbg(&dev->interface->dev, "%s Queueing command 0x%x", __func__,
- cmd_code);
+ dev_dbg(&dev->interface->dev, "%s Queueing command 0x%x\n",
+ __func__, cmd_code);

cmd = kzalloc(sizeof(struct pn533_cmd), GFP_KERNEL);
if (!cmd) {
@@ -971,9 +969,9 @@ static void pn533_send_complete(struct urb *urb)
break; /* success */
case -ECONNRESET:
case -ENOENT:
- nfc_dev_dbg(&dev->interface->dev,
- "The urb has been stopped (status %d)",
- urb->status);
+ dev_dbg(&dev->interface->dev,
+ "The urb has been stopped (status %d)\n",
+ urb->status);
break;
case -ESHUTDOWN:
default:
@@ -1235,8 +1233,8 @@ static int pn533_target_found(struct pn533 *dev, u8 tg, u8 *tgdata,
struct nfc_target nfc_tgt;
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s - modulation=%d", __func__,
- dev->poll_mod_curr);
+ dev_dbg(&dev->interface->dev, "%s - modulation=%d\n",
+ __func__, dev->poll_mod_curr);

if (tg != 1)
return -EPROTO;
@@ -1267,14 +1265,14 @@ static int pn533_target_found(struct pn533 *dev, u8 tg, u8 *tgdata,
return rc;

if (!(nfc_tgt.supported_protocols & dev->poll_protocols)) {
- nfc_dev_dbg(&dev->interface->dev,
- "The Tg found doesn't have the desired protocol");
+ dev_dbg(&dev->interface->dev,
+ "The Tg found doesn't have the desired protocol\n");
return -EAGAIN;
}

- nfc_dev_dbg(&dev->interface->dev,
- "Target found - supported protocols: 0x%x",
- nfc_tgt.supported_protocols);
+ dev_dbg(&dev->interface->dev,
+ "Target found - supported protocols: 0x%x\n",
+ nfc_tgt.supported_protocols);

dev->tgt_available_prots = nfc_tgt.supported_protocols;

@@ -1331,8 +1329,6 @@ static int pn533_start_poll_complete(struct pn533 *dev, struct sk_buff *resp)
u8 nbtg, tg, *tgdata;
int rc, tgdata_len;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
nbtg = resp->data[0];
tg = resp->data[1];
tgdata = &resp->data[2];
@@ -1412,8 +1408,6 @@ static int pn533_tm_get_data_complete(struct pn533 *dev, void *arg,
{
u8 status;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (IS_ERR(resp))
return PTR_ERR(resp);

@@ -1437,8 +1431,6 @@ static void pn533_wq_tg_get_data(struct work_struct *work)
struct sk_buff *skb;
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
skb = pn533_alloc_skb(dev, 0);
if (!skb)
return;
@@ -1459,16 +1451,14 @@ static int pn533_init_target_complete(struct pn533 *dev, struct sk_buff *resp)
size_t gb_len;
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (resp->len < ATR_REQ_GB_OFFSET + 1)
return -EINVAL;

mode = resp->data[0];
cmd = &resp->data[1];

- nfc_dev_dbg(&dev->interface->dev, "Target mode 0x%x len %d\n",
- mode, resp->len);
+ dev_dbg(&dev->interface->dev, "Target mode 0x%x len %d\n",
+ mode, resp->len);

if ((mode & PN533_INIT_TARGET_RESP_FRAME_MASK) ==
PN533_INIT_TARGET_RESP_ACTIVE)
@@ -1498,8 +1488,6 @@ static void pn533_listen_mode_timer(unsigned long data)
{
struct pn533 *dev = (struct pn533 *)data;

- nfc_dev_dbg(&dev->interface->dev, "Listen mode timeout");
-
/* An ack will cancel the last issued command (poll) */
pn533_send_ack(dev, GFP_ATOMIC);

@@ -1516,8 +1504,6 @@ static int pn533_poll_complete(struct pn533 *dev, void *arg,
struct pn533_poll_modulations *cur_mod;
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (IS_ERR(resp)) {
rc = PTR_ERR(resp);

@@ -1587,8 +1573,8 @@ static int pn533_send_poll_frame(struct pn533 *dev)

mod = dev->poll_mod_active[dev->poll_mod_curr];

- nfc_dev_dbg(&dev->interface->dev, "%s mod len %d\n",
- __func__, mod->len);
+ dev_dbg(&dev->interface->dev, "%s mod len %d\n",
+ __func__, mod->len);

if (mod->len == 0) { /* Listen mode */
cmd_code = PN533_CMD_TG_INIT_AS_TARGET;
@@ -1621,9 +1607,9 @@ static void pn533_wq_poll(struct work_struct *work)

cur_mod = dev->poll_mod_active[dev->poll_mod_curr];

- nfc_dev_dbg(&dev->interface->dev,
- "%s cancel_listen %d modulation len %d",
- __func__, dev->cancel_listen, cur_mod->len);
+ dev_dbg(&dev->interface->dev,
+ "%s cancel_listen %d modulation len %d\n",
+ __func__, dev->cancel_listen, cur_mod->len);

if (dev->cancel_listen == 1) {
dev->cancel_listen = 0;
@@ -1645,9 +1631,9 @@ static int pn533_start_poll(struct nfc_dev *nfc_dev,
{
struct pn533 *dev = nfc_get_drvdata(nfc_dev);

- nfc_dev_dbg(&dev->interface->dev,
- "%s: im protocols 0x%x tm protocols 0x%x",
- __func__, im_protocols, tm_protocols);
+ dev_dbg(&dev->interface->dev,
+ "%s: im protocols 0x%x tm protocols 0x%x\n",
+ __func__, im_protocols, tm_protocols);

if (dev->tgt_active_prot) {
nfc_dev_err(&dev->interface->dev,
@@ -1679,13 +1665,11 @@ static void pn533_stop_poll(struct nfc_dev *nfc_dev)
{
struct pn533 *dev = nfc_get_drvdata(nfc_dev);

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
del_timer(&dev->listen_timer);

if (!dev->poll_mod_count) {
- nfc_dev_dbg(&dev->interface->dev,
- "Polling operation was not running");
+ dev_dbg(&dev->interface->dev,
+ "Polling operation was not running\n");
return;
}

@@ -1707,8 +1691,6 @@ static int pn533_activate_target_nfcdep(struct pn533 *dev)
struct sk_buff *skb;
struct sk_buff *resp;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
skb = pn533_alloc_skb(dev, sizeof(u8) * 2); /*TG + Next*/
if (!skb)
return -ENOMEM;
@@ -1741,12 +1723,12 @@ static int pn533_activate_target(struct nfc_dev *nfc_dev,
struct pn533 *dev = nfc_get_drvdata(nfc_dev);
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s - protocol=%u", __func__,
- protocol);
+ dev_dbg(&dev->interface->dev, "%s - protocol=%u\n",
+ __func__, protocol);

if (dev->poll_mod_count) {
- nfc_dev_err(&dev->interface->dev,
- "Cannot activate while polling");
+ dev_err(&dev->interface->dev,
+ "Cannot activate while polling\n");
return -EBUSY;
}

@@ -1794,8 +1776,6 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,

int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (!dev->tgt_active_prot) {
nfc_dev_err(&dev->interface->dev, "There is no active target");
return;
@@ -1857,7 +1837,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
if (!dev->tgt_available_prots) {
struct nfc_target nfc_target;

- nfc_dev_dbg(&dev->interface->dev, "Creating new target");
+ dev_dbg(&dev->interface->dev, "Creating new target\n");

nfc_target.supported_protocols = NFC_PROTO_NFC_DEP_MASK;
nfc_target.nfcid1_len = 10;
@@ -1910,8 +1890,6 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,

u8 passive_data[PASSIVE_DATA_LEN] = {0x00, 0xff, 0xff, 0x00, 0x3};

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (dev->poll_mod_count) {
nfc_dev_err(&dev->interface->dev,
"Cannot bring the DEP link up while polling");
@@ -1981,8 +1959,6 @@ static int pn533_dep_link_down(struct nfc_dev *nfc_dev)
{
struct pn533 *dev = nfc_get_drvdata(nfc_dev);

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
pn533_poll_reset_mod_list(dev);

if (dev->tgt_mode || dev->tgt_active_prot) {
@@ -2008,8 +1984,6 @@ static struct sk_buff *pn533_build_response(struct pn533 *dev)
struct sk_buff *skb, *tmp, *t;
unsigned int skb_len = 0, tmp_len = 0;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (skb_queue_empty(&dev->resp_q))
return NULL;

@@ -2021,8 +1995,8 @@ static struct sk_buff *pn533_build_response(struct pn533 *dev)
skb_queue_walk_safe(&dev->resp_q, tmp, t)
skb_len += tmp->len;

- nfc_dev_dbg(&dev->interface->dev, "%s total length %d\n",
- __func__, skb_len);
+ dev_dbg(&dev->interface->dev, "%s total length %d\n",
+ __func__, skb_len);

skb = alloc_skb(skb_len, GFP_KERNEL);
if (skb == NULL)
@@ -2049,8 +2023,6 @@ static int pn533_data_exchange_complete(struct pn533 *dev, void *_arg,
int rc = 0;
u8 status, ret, mi;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (IS_ERR(resp)) {
rc = PTR_ERR(resp);
goto _error;
@@ -2103,8 +2075,6 @@ static int pn533_transceive(struct nfc_dev *nfc_dev,
struct pn533_data_exchange_arg *arg = NULL;
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (skb->len > PN533_CMD_DATAEXCH_DATA_MAXLEN) {
/* TODO: Implement support to multi-part data exchange */
nfc_dev_err(&dev->interface->dev,
@@ -2166,8 +2136,6 @@ static int pn533_tm_send_complete(struct pn533 *dev, void *arg,
{
u8 status;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (IS_ERR(resp))
return PTR_ERR(resp);

@@ -2193,8 +2161,6 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
struct pn533 *dev = nfc_get_drvdata(nfc_dev);
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
if (skb->len > PN533_CMD_DATAEXCH_DATA_MAXLEN) {
nfc_dev_err(&dev->interface->dev,
"Data length greater than the max allowed: %d",
@@ -2217,8 +2183,6 @@ static void pn533_wq_mi_recv(struct work_struct *work)
struct sk_buff *skb;
int rc;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
skb = pn533_alloc_skb(dev, PN533_CMD_DATAEXCH_HEAD_LEN);
if (!skb)
goto error;
@@ -2268,8 +2232,6 @@ static int pn533_set_configuration(struct pn533 *dev, u8 cfgitem, u8 *cfgdata,

int skb_len;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
skb_len = sizeof(cfgitem) + cfgdata_len; /* cfgitem + cfgdata */

skb = pn533_alloc_skb(dev, skb_len);
@@ -2315,8 +2277,6 @@ static int pn533_fw_reset(struct pn533 *dev)
struct sk_buff *skb;
struct sk_buff *resp;

- nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
-
skb = pn533_alloc_skb(dev, sizeof(u8));
if (!skb)
return -ENOMEM;
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 87a6417..3448f09 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -30,7 +30,6 @@

#define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg)
#define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg)
-#define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), fmt "\n", ## arg)

struct nfc_dev;

--
1.8.1.2.459.gbcd45b4.dirty

2013-04-05 19:28:12

by Joe Perches

[permalink] [raw]
Subject: [PATCH 2/3] nfc: Convert nfc_dev_info and nfc_dev_err to nfc_<level>

Use a more standard kernel style macro logging name.

Standardize the spacing of the "NFC: " prefix.
Add \n to uses, remove from macro.
Fix the defective uses that already had a \n.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/nfc/nfcwilink.c | 44 +++++++-------
drivers/nfc/pn533.c | 156 ++++++++++++++++++++++++------------------------
include/net/nfc/nfc.h | 4 +-
3 files changed, 100 insertions(+), 104 deletions(-)

diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
index b2f4040..f58b390 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -149,8 +149,8 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
skb = nfcwilink_skb_alloc(sizeof(struct nci_vs_nfcc_info_cmd),
GFP_KERNEL);
if (!skb) {
- nfc_dev_err(&drv->pdev->dev,
- "no memory for nci_vs_nfcc_info_cmd");
+ nfc_err(&drv->pdev->dev,
+ "no memory for nci_vs_nfcc_info_cmd\n");
return -ENOMEM;
}

@@ -182,8 +182,7 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
drv->nfcc_info.plen, drv->nfcc_info.status);

if ((drv->nfcc_info.plen != 5) || (drv->nfcc_info.status != 0)) {
- nfc_dev_err(&drv->pdev->dev,
- "invalid nci_vs_nfcc_info_rsp");
+ nfc_err(&drv->pdev->dev, "invalid nci_vs_nfcc_info_rsp\n");
return -EINVAL;
}

@@ -194,7 +193,7 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
drv->nfcc_info.sw_ver_z,
drv->nfcc_info.patch_id);

- nfc_dev_info(&drv->pdev->dev, "nfcwilink FW file name: %s", file_name);
+ nfc_info(&drv->pdev->dev, "nfcwilink FW file name: %s\n", file_name);

return 0;
}
@@ -211,8 +210,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
(len > BTS_FILE_CMD_MAX_LEN) ||
(hdr->chnl != NFCWILINK_CHNL) ||
(hdr->opcode != NFCWILINK_OPCODE)) {
- nfc_dev_err(&drv->pdev->dev,
- "ignoring invalid bts cmd, len %d, chnl %d, opcode %d",
+ nfc_err(&drv->pdev->dev,
+ "ignoring invalid bts cmd, len %d, chnl %d, opcode %d\n",
len, hdr->chnl, hdr->opcode);
return 0;
}
@@ -223,7 +222,7 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)

skb = nfcwilink_skb_alloc(len, GFP_KERNEL);
if (!skb) {
- nfc_dev_err(&drv->pdev->dev, "no memory for bts cmd");
+ nfc_err(&drv->pdev->dev, "no memory for bts cmd\n");
return -ENOMEM;
}

@@ -240,8 +239,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
comp_ret);
if (comp_ret == 0) {
- nfc_dev_err(&drv->pdev->dev,
- "timeout on wait_for_completion_timeout");
+ nfc_err(&drv->pdev->dev,
+ "timeout on wait_for_completion_timeout\n");
return -ETIMEDOUT;
}

@@ -264,7 +263,7 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)

rc = request_firmware(&fw, file_name, &drv->pdev->dev);
if (rc) {
- nfc_dev_err(&drv->pdev->dev, "request_firmware failed %d", rc);
+ nfc_err(&drv->pdev->dev, "request_firmware failed %d\n", rc);

/* if the file is not found, don't exit with failure */
if (rc == -ENOENT)
@@ -284,7 +283,7 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)

if (__le32_to_cpu(((struct bts_file_hdr *)ptr)->magic) !=
BTS_FILE_HDR_MAGIC) {
- nfc_dev_err(&drv->pdev->dev, "wrong bts magic number");
+ nfc_err(&drv->pdev->dev, "wrong bts magic number\n");
rc = -EINVAL;
goto release_fw;
}
@@ -367,7 +366,7 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
/* Forward skb to NCI core layer */
rc = nci_recv_frame(skb);
if (rc < 0) {
- nfc_dev_err(&drv->pdev->dev, "nci_recv_frame failed %d", rc);
+ nfc_err(&drv->pdev->dev, "nci_recv_frame failed %d\n", rc);
return rc;
}

@@ -420,13 +419,12 @@ static int nfcwilink_open(struct nci_dev *ndev)
goto clear_exit;
} else if (drv->st_register_cb_status != 0) {
rc = drv->st_register_cb_status;
- nfc_dev_err(&drv->pdev->dev,
- "st_register_cb failed %d", rc);
+ nfc_err(&drv->pdev->dev,
+ "st_register_cb failed %d\n", rc);
goto clear_exit;
}
} else {
- nfc_dev_err(&drv->pdev->dev,
- "st_register failed %d", rc);
+ nfc_err(&drv->pdev->dev, "st_register failed %d\n", rc);
goto clear_exit;
}
}
@@ -436,8 +434,8 @@ static int nfcwilink_open(struct nci_dev *ndev)
drv->st_write = nfcwilink_proto.write;

if (nfcwilink_download_fw(drv)) {
- nfc_dev_err(&drv->pdev->dev, "nfcwilink_download_fw failed %d",
- rc);
+ nfc_err(&drv->pdev->dev, "nfcwilink_download_fw failed %d\n",
+ rc);
/* open should succeed, even if the FW download failed */
}

@@ -460,7 +458,7 @@ static int nfcwilink_close(struct nci_dev *ndev)

rc = st_unregister(&nfcwilink_proto);
if (rc)
- nfc_dev_err(&drv->pdev->dev, "st_unregister failed %d", rc);
+ nfc_err(&drv->pdev->dev, "st_unregister failed %d\n", rc);

drv->st_write = NULL;

@@ -492,7 +490,7 @@ static int nfcwilink_send(struct sk_buff *skb)
len = drv->st_write(skb);
if (len < 0) {
kfree_skb(skb);
- nfc_dev_err(&drv->pdev->dev, "st_write failed %ld", len);
+ nfc_err(&drv->pdev->dev, "st_write failed %ld\n", len);
return -EFAULT;
}

@@ -531,7 +529,7 @@ static int nfcwilink_probe(struct platform_device *pdev)
NFCWILINK_HDR_LEN,
0);
if (!drv->ndev) {
- nfc_dev_err(&pdev->dev, "nci_allocate_device failed");
+ nfc_err(&pdev->dev, "nci_allocate_device failed\n");
rc = -ENOMEM;
goto exit;
}
@@ -541,7 +539,7 @@ static int nfcwilink_probe(struct platform_device *pdev)

rc = nci_register_device(drv->ndev);
if (rc < 0) {
- nfc_dev_err(&pdev->dev, "nci_register_device failed %d", rc);
+ nfc_err(&pdev->dev, "nci_register_device failed %d\n", rc);
goto free_dev_exit;
}

diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index e2956a6..714b4ec 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -534,8 +534,8 @@ static void pn533_recv_response(struct urb *urb)
goto sched_wq;
case -ESHUTDOWN:
default:
- nfc_dev_err(&dev->interface->dev,
- "Urb failure (status %d)", urb->status);
+ nfc_err(&dev->interface->dev, "Urb failure (status %d)\n",
+ urb->status);
dev->wq_in_error = urb->status;
goto sched_wq;
}
@@ -547,14 +547,14 @@ static void pn533_recv_response(struct urb *urb)
in_frame, dev->ops->rx_frame_size(in_frame), false);

if (!dev->ops->rx_is_frame_valid(in_frame)) {
- nfc_dev_err(&dev->interface->dev, "Received an invalid frame");
+ nfc_err(&dev->interface->dev, "Received an invalid frame\n");
dev->wq_in_error = -EIO;
goto sched_wq;
}

if (!pn533_rx_frame_is_cmd_response(dev, in_frame)) {
- nfc_dev_err(&dev->interface->dev,
- "It it not the response to the last command");
+ nfc_err(&dev->interface->dev,
+ "It it not the response to the last command\n");
dev->wq_in_error = -EIO;
goto sched_wq;
}
@@ -590,8 +590,8 @@ static void pn533_recv_ack(struct urb *urb)
goto sched_wq;
case -ESHUTDOWN:
default:
- nfc_dev_err(&dev->interface->dev,
- "Urb failure (status %d)", urb->status);
+ nfc_err(&dev->interface->dev, "Urb failure (status %d)\n",
+ urb->status);
dev->wq_in_error = urb->status;
goto sched_wq;
}
@@ -599,15 +599,15 @@ static void pn533_recv_ack(struct urb *urb)
in_frame = dev->in_urb->transfer_buffer;

if (!pn533_rx_frame_is_ack(in_frame)) {
- nfc_dev_err(&dev->interface->dev, "Received an invalid ack");
+ nfc_err(&dev->interface->dev, "Received an invalid ack\n");
dev->wq_in_error = -EIO;
goto sched_wq;
}

rc = pn533_submit_urb_for_response(dev, GFP_ATOMIC);
if (rc) {
- nfc_dev_err(&dev->interface->dev,
- "usb_submit_urb failed with result %d", rc);
+ nfc_err(&dev->interface->dev,
+ "usb_submit_urb failed with result %d\n", rc);
dev->wq_in_error = rc;
goto sched_wq;
}
@@ -975,8 +975,8 @@ static void pn533_send_complete(struct urb *urb)
break;
case -ESHUTDOWN:
default:
- nfc_dev_err(&dev->interface->dev,
- "Urb failure (status %d)", urb->status);
+ nfc_err(&dev->interface->dev, "Urb failure (status %d)\n",
+ urb->status);
}
}

@@ -1256,8 +1256,8 @@ static int pn533_target_found(struct pn533 *dev, u8 tg, u8 *tgdata,
rc = pn533_target_found_type_b(&nfc_tgt, tgdata, tgdata_len);
break;
default:
- nfc_dev_err(&dev->interface->dev,
- "Unknown current poll modulation");
+ nfc_err(&dev->interface->dev,
+ "Unknown current poll modulation\n");
return -EPROTO;
}

@@ -1473,8 +1473,8 @@ static int pn533_init_target_complete(struct pn533 *dev, struct sk_buff *resp)
rc = nfc_tm_activated(dev->nfc_dev, NFC_PROTO_NFC_DEP_MASK,
comm_mode, gb, gb_len);
if (rc < 0) {
- nfc_dev_err(&dev->interface->dev,
- "Error when signaling target activation");
+ nfc_err(&dev->interface->dev,
+ "Error when signaling target activation\n");
return rc;
}

@@ -1507,8 +1507,8 @@ static int pn533_poll_complete(struct pn533 *dev, void *arg,
if (IS_ERR(resp)) {
rc = PTR_ERR(resp);

- nfc_dev_err(&dev->interface->dev, "%s Poll complete error %d",
- __func__, rc);
+ nfc_err(&dev->interface->dev, "%s Poll complete error %d\n",
+ __func__, rc);

if (rc == -ENOENT) {
if (dev->poll_mod_count != 0)
@@ -1516,8 +1516,8 @@ static int pn533_poll_complete(struct pn533 *dev, void *arg,
else
goto stop_poll;
} else if (rc < 0) {
- nfc_dev_err(&dev->interface->dev,
- "Error %d when running poll", rc);
+ nfc_err(&dev->interface->dev,
+ "Error %d when running poll\n", rc);
goto stop_poll;
}
}
@@ -1543,7 +1543,7 @@ done:
return rc;

stop_poll:
- nfc_dev_err(&dev->interface->dev, "Polling operation has been stopped");
+ nfc_err(&dev->interface->dev, "Polling operation has been stopped\n");

pn533_poll_reset_mod_list(dev);
dev->poll_protocols = 0;
@@ -1585,7 +1585,7 @@ static int pn533_send_poll_frame(struct pn533 *dev)
}

if (!skb) {
- nfc_dev_err(&dev->interface->dev, "Failed to allocate skb.");
+ nfc_err(&dev->interface->dev, "Failed to allocate skb\n");
return -ENOMEM;
}

@@ -1593,7 +1593,7 @@ static int pn533_send_poll_frame(struct pn533 *dev)
NULL);
if (rc < 0) {
dev_kfree_skb(skb);
- nfc_dev_err(&dev->interface->dev, "Polling loop error %d", rc);
+ nfc_err(&dev->interface->dev, "Polling loop error %d\n", rc);
}

return rc;
@@ -1636,14 +1636,14 @@ static int pn533_start_poll(struct nfc_dev *nfc_dev,
__func__, im_protocols, tm_protocols);

if (dev->tgt_active_prot) {
- nfc_dev_err(&dev->interface->dev,
- "Cannot poll with a target already activated");
+ nfc_err(&dev->interface->dev,
+ "Cannot poll with a target already activated\n");
return -EBUSY;
}

if (dev->tgt_mode) {
- nfc_dev_err(&dev->interface->dev,
- "Cannot poll while already being activated");
+ nfc_err(&dev->interface->dev,
+ "Cannot poll while already being activated\n");
return -EBUSY;
}

@@ -1727,35 +1727,35 @@ static int pn533_activate_target(struct nfc_dev *nfc_dev,
__func__, protocol);

if (dev->poll_mod_count) {
- dev_err(&dev->interface->dev,
+ nfc_err(&dev->interface->dev,
"Cannot activate while polling\n");
return -EBUSY;
}

if (dev->tgt_active_prot) {
- nfc_dev_err(&dev->interface->dev,
- "There is already an active target");
+ nfc_err(&dev->interface->dev,
+ "There is already an active target\n");
return -EBUSY;
}

if (!dev->tgt_available_prots) {
- nfc_dev_err(&dev->interface->dev,
- "There is no available target to activate");
+ nfc_err(&dev->interface->dev,
+ "There is no available target to activate\n");
return -EINVAL;
}

if (!(dev->tgt_available_prots & (1 << protocol))) {
- nfc_dev_err(&dev->interface->dev,
- "Target doesn't support requested proto %u",
- protocol);
+ nfc_err(&dev->interface->dev,
+ "Target doesn't support requested proto %u\n",
+ protocol);
return -EINVAL;
}

if (protocol == NFC_PROTO_NFC_DEP) {
rc = pn533_activate_target_nfcdep(dev);
if (rc) {
- nfc_dev_err(&dev->interface->dev,
- "Activating target with DEP failed %d", rc);
+ nfc_err(&dev->interface->dev,
+ "Activating target with DEP failed %d\n", rc);
return rc;
}
}
@@ -1777,7 +1777,7 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,
int rc;

if (!dev->tgt_active_prot) {
- nfc_dev_err(&dev->interface->dev, "There is no active target");
+ nfc_err(&dev->interface->dev, "There is no active target\n");
return;
}

@@ -1796,8 +1796,8 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,

rc = resp->data[0] & PN533_CMD_RET_MASK;
if (rc != PN533_CMD_RET_SUCCESS)
- nfc_dev_err(&dev->interface->dev,
- "Error 0x%x when releasing the target", rc);
+ nfc_err(&dev->interface->dev,
+ "Error 0x%x when releasing the target\n", rc);

dev_kfree_skb(resp);
return;
@@ -1819,8 +1819,8 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,

if (dev->tgt_available_prots &&
!(dev->tgt_available_prots & (1 << NFC_PROTO_NFC_DEP))) {
- nfc_dev_err(&dev->interface->dev,
- "The target does not support DEP");
+ nfc_err(&dev->interface->dev,
+ "The target does not support DEP\n");
rc = -EINVAL;
goto error;
}
@@ -1829,8 +1829,8 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,

rc = rsp->status & PN533_CMD_RET_MASK;
if (rc != PN533_CMD_RET_SUCCESS) {
- nfc_dev_err(&dev->interface->dev,
- "Bringing DEP link up failed %d", rc);
+ nfc_err(&dev->interface->dev,
+ "Bringing DEP link up failed %d\n", rc);
goto error;
}

@@ -1891,21 +1891,21 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
u8 passive_data[PASSIVE_DATA_LEN] = {0x00, 0xff, 0xff, 0x00, 0x3};

if (dev->poll_mod_count) {
- nfc_dev_err(&dev->interface->dev,
- "Cannot bring the DEP link up while polling");
+ nfc_err(&dev->interface->dev,
+ "Cannot bring the DEP link up while polling\n");
return -EBUSY;
}

if (dev->tgt_active_prot) {
- nfc_dev_err(&dev->interface->dev,
- "There is already an active target");
+ nfc_err(&dev->interface->dev,
+ "There is already an active target\n");
return -EBUSY;
}

baud = pn533_mod_to_baud(dev);
if (baud < 0) {
- nfc_dev_err(&dev->interface->dev,
- "Invalid curr modulation %d", dev->poll_mod_curr);
+ nfc_err(&dev->interface->dev,
+ "Invalid curr modulation %d\n", dev->poll_mod_curr);
return baud;
}

@@ -2035,9 +2035,8 @@ static int pn533_data_exchange_complete(struct pn533 *dev, void *_arg,
skb_pull(resp, sizeof(status));

if (ret != PN533_CMD_RET_SUCCESS) {
- nfc_dev_err(&dev->interface->dev,
- "PN533 reported error %d when exchanging data",
- ret);
+ nfc_err(&dev->interface->dev,
+ "PN533 reported error %d when exchanging data\n", ret);
rc = -EIO;
goto error;
}
@@ -2077,16 +2076,16 @@ static int pn533_transceive(struct nfc_dev *nfc_dev,

if (skb->len > PN533_CMD_DATAEXCH_DATA_MAXLEN) {
/* TODO: Implement support to multi-part data exchange */
- nfc_dev_err(&dev->interface->dev,
- "Data length greater than the max allowed: %d",
- PN533_CMD_DATAEXCH_DATA_MAXLEN);
+ nfc_err(&dev->interface->dev,
+ "Data length greater than the max allowed: %d\n",
+ PN533_CMD_DATAEXCH_DATA_MAXLEN);
rc = -ENOSYS;
goto error;
}

if (!dev->tgt_active_prot) {
- nfc_dev_err(&dev->interface->dev,
- "Can't exchange data if there is no active target");
+ nfc_err(&dev->interface->dev,
+ "Can't exchange data if there is no active target\n");
rc = -EINVAL;
goto error;
}
@@ -2162,9 +2161,9 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
int rc;

if (skb->len > PN533_CMD_DATAEXCH_DATA_MAXLEN) {
- nfc_dev_err(&dev->interface->dev,
- "Data length greater than the max allowed: %d",
- PN533_CMD_DATAEXCH_DATA_MAXLEN);
+ nfc_err(&dev->interface->dev,
+ "Data length greater than the max allowed: %d\n",
+ PN533_CMD_DATAEXCH_DATA_MAXLEN);
return -ENOSYS;
}

@@ -2213,8 +2212,8 @@ static void pn533_wq_mi_recv(struct work_struct *work)
if (rc == 0) /* success */
return;

- nfc_dev_err(&dev->interface->dev,
- "Error %d when trying to perform data_exchange", rc);
+ nfc_err(&dev->interface->dev,
+ "Error %d when trying to perform data_exchange\n", rc);

dev_kfree_skb(skb);
kfree(dev->cmd_complete_arg);
@@ -2338,16 +2337,16 @@ static int pn533_setup(struct pn533 *dev)
break;

default:
- nfc_dev_err(&dev->interface->dev, "Unknown device type %d\n",
- dev->device_type);
+ nfc_err(&dev->interface->dev, "Unknown device type %d\n",
+ dev->device_type);
return -EINVAL;
}

rc = pn533_set_configuration(dev, PN533_CFGITEM_MAX_RETRIES,
(u8 *)&max_retries, sizeof(max_retries));
if (rc) {
- nfc_dev_err(&dev->interface->dev,
- "Error on setting MAX_RETRIES config");
+ nfc_err(&dev->interface->dev,
+ "Error on setting MAX_RETRIES config\n");
return rc;
}

@@ -2355,8 +2354,7 @@ static int pn533_setup(struct pn533 *dev)
rc = pn533_set_configuration(dev, PN533_CFGITEM_TIMING,
(u8 *)&timing, sizeof(timing));
if (rc) {
- nfc_dev_err(&dev->interface->dev,
- "Error on setting RF timings");
+ nfc_err(&dev->interface->dev, "Error on setting RF timings\n");
return rc;
}

@@ -2370,8 +2368,8 @@ static int pn533_setup(struct pn533 *dev)
rc = pn533_set_configuration(dev, PN533_CFGITEM_PASORI,
pasori_cfg, 3);
if (rc) {
- nfc_dev_err(&dev->interface->dev,
- "Error while settings PASORI config");
+ nfc_err(&dev->interface->dev,
+ "Error while settings PASORI config\n");
return rc;
}

@@ -2416,8 +2414,8 @@ static int pn533_probe(struct usb_interface *interface,
}

if (!in_endpoint || !out_endpoint) {
- nfc_dev_err(&interface->dev,
- "Could not find bulk-in or bulk-out endpoint");
+ nfc_err(&interface->dev,
+ "Could not find bulk-in or bulk-out endpoint\n");
rc = -ENODEV;
goto error;
}
@@ -2467,8 +2465,8 @@ static int pn533_probe(struct usb_interface *interface,
break;

default:
- nfc_dev_err(&dev->interface->dev, "Unknown device type %d\n",
- dev->device_type);
+ nfc_err(&dev->interface->dev, "Unknown device type %d\n",
+ dev->device_type);
rc = -EINVAL;
goto destroy_wq;
}
@@ -2478,9 +2476,9 @@ static int pn533_probe(struct usb_interface *interface,
if (rc < 0)
goto destroy_wq;

- nfc_dev_info(&dev->interface->dev,
- "NXP PN533 firmware ver %d.%d now attached",
- fw_ver.ver, fw_ver.rev);
+ nfc_info(&dev->interface->dev,
+ "NXP PN533 firmware ver %d.%d now attached\n",
+ fw_ver.ver, fw_ver.rev);


dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols,
@@ -2548,7 +2546,7 @@ static void pn533_disconnect(struct usb_interface *interface)
usb_free_urb(dev->out_urb);
kfree(dev);

- nfc_dev_info(&interface->dev, "NXP PN533 NFC device disconnected");
+ nfc_info(&interface->dev, "NXP PN533 NFC device disconnected\n");
}

static struct usb_driver pn533_driver = {
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 3448f09..853ff83 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -28,8 +28,8 @@
#include <linux/device.h>
#include <linux/skbuff.h>

-#define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg)
-#define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg)
+#define nfc_info(dev, fmt, ...) dev_info((dev), "NFC: " fmt, ##__VA_ARGS__)
+#define nfc_err(dev, fmt, ...) dev_err((dev), "NFC: " fmt, ##__VA_ARGS__)

struct nfc_dev;

--
1.8.1.2.459.gbcd45b4.dirty

2013-04-05 19:28:23

by Joe Perches

[permalink] [raw]
Subject: [PATCH 3/3] nfc: Standardize logging style

Use standardized styles to minimize coding defects.

Always use nfc_<level> where feasible.
Add \n to formats where appropriate.
Tyop "it it" correction.
Add #define pr_fmt where appropriate.
Remove function tracing logging messages.
Remove OOM messages.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/nfc/microread/i2c.c | 32 +++++++++++---------------------
drivers/nfc/microread/mei.c | 20 +++++---------------
drivers/nfc/microread/microread.c | 7 ++++---
drivers/nfc/nfcwilink.c | 2 +-
drivers/nfc/pn533.c | 7 +++----
drivers/nfc/pn544/i2c.c | 38 +++++++++++++++-----------------------
drivers/nfc/pn544/pn544.c | 13 +++++++------
7 files changed, 46 insertions(+), 73 deletions(-)

diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c
index 1010894..696e346 100644
--- a/drivers/nfc/microread/i2c.c
+++ b/drivers/nfc/microread/i2c.c
@@ -18,6 +18,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/delay.h>
@@ -95,12 +97,8 @@ static int check_crc(struct sk_buff *skb)
crc = crc ^ skb->data[i];

if (crc != skb->data[skb->len-1]) {
- pr_err(MICROREAD_I2C_DRIVER_NAME
- ": CRC error 0x%x != 0x%x\n",
- crc, skb->data[skb->len-1]);
-
- pr_info(DRIVER_DESC ": %s : BAD CRC\n", __func__);
-
+ pr_err("CRC error 0x%x != 0x%x\n", crc, skb->data[skb->len-1]);
+ pr_info("%s: BAD CRC\n", __func__);
return -EPERM;
}

@@ -160,18 +158,15 @@ static int microread_i2c_read(struct microread_i2c_phy *phy,
u8 tmp[MICROREAD_I2C_LLC_MAX_SIZE - 1];
struct i2c_client *client = phy->i2c_dev;

- pr_debug("%s\n", __func__);
-
r = i2c_master_recv(client, &len, 1);
if (r != 1) {
- dev_err(&client->dev, "cannot read len byte\n");
+ nfc_err(&client->dev, "cannot read len byte\n");
return -EREMOTEIO;
}

if ((len < MICROREAD_I2C_LLC_MIN_SIZE) ||
(len > MICROREAD_I2C_LLC_MAX_SIZE)) {
- dev_err(&client->dev, "invalid len byte\n");
- pr_err("invalid len byte\n");
+ nfc_err(&client->dev, "invalid len byte\n");
r = -EBADMSG;
goto flush;
}
@@ -228,7 +223,6 @@ static irqreturn_t microread_i2c_irq_thread_fn(int irq, void *phy_id)
}

client = phy->i2c_dev;
- dev_dbg(&client->dev, "IRQ\n");

if (phy->hard_fault != 0)
return IRQ_HANDLED;
@@ -263,20 +257,18 @@ static int microread_i2c_probe(struct i2c_client *client,
dev_get_platdata(&client->dev);
int r;

- dev_dbg(&client->dev, "client %p", client);
+ dev_dbg(&client->dev, "client %p\n", client);

if (!pdata) {
- dev_err(&client->dev, "client %p: missing platform data",
+ nfc_err(&client->dev, "client %p: missing platform data\n",
client);
return -EINVAL;
}

phy = devm_kzalloc(&client->dev, sizeof(struct microread_i2c_phy),
GFP_KERNEL);
- if (!phy) {
- dev_err(&client->dev, "Can't allocate microread phy");
+ if (!phy)
return -ENOMEM;
- }

i2c_set_clientdata(client, phy);
phy->i2c_dev = client;
@@ -285,7 +277,7 @@ static int microread_i2c_probe(struct i2c_client *client,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
MICROREAD_I2C_DRIVER_NAME, phy);
if (r) {
- dev_err(&client->dev, "Unable to register IRQ handler");
+ nfc_err(&client->dev, "Unable to register IRQ handler\n");
return r;
}

@@ -296,7 +288,7 @@ static int microread_i2c_probe(struct i2c_client *client,
if (r < 0)
goto err_irq;

- dev_info(&client->dev, "Probed");
+ nfc_info(&client->dev, "Probed");

return 0;

@@ -310,8 +302,6 @@ static int microread_i2c_remove(struct i2c_client *client)
{
struct microread_i2c_phy *phy = i2c_get_clientdata(client);

- dev_dbg(&client->dev, "%s\n", __func__);
-
microread_remove(phy->hdev);

free_irq(client->irq, phy);
diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c
index 13bde92..dbad24b 100644
--- a/drivers/nfc/microread/mei.c
+++ b/drivers/nfc/microread/mei.c
@@ -18,6 +18,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
@@ -77,8 +79,6 @@ static int microread_mei_enable(void *phy_id)
{
struct microread_mei_phy *phy = phy_id;

- pr_info(DRIVER_DESC ": %s\n", __func__);
-
phy->powered = 1;

return 0;
@@ -88,8 +88,6 @@ static void microread_mei_disable(void *phy_id)
{
struct microread_mei_phy *phy = phy_id;

- pr_info(DRIVER_DESC ": %s\n", __func__);
-
phy->powered = 0;
}

@@ -155,20 +153,16 @@ static int microread_mei_probe(struct mei_device *device,
struct microread_mei_phy *phy;
int r;

- pr_info("Probing NFC microread\n");
-
phy = kzalloc(sizeof(struct microread_mei_phy), GFP_KERNEL);
- if (!phy) {
- pr_err("Cannot allocate memory for microread mei phy.\n");
+ if (!phy)
return -ENOMEM;
- }

phy->device = device;
mei_set_clientdata(device, phy);

r = mei_register_event_cb(device, microread_event_cb, phy);
if (r) {
- pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n");
+ pr_err("event cb registration failed\n");
goto err_out;
}

@@ -190,8 +184,6 @@ static int microread_mei_remove(struct mei_device *device)
{
struct microread_mei_phy *phy = mei_get_clientdata(device);

- pr_info("Removing microread\n");
-
microread_remove(phy->hdev);

if (phy->powered)
@@ -223,11 +215,9 @@ static int microread_mei_init(void)
{
int r;

- pr_debug(DRIVER_DESC ": %s\n", __func__);
-
r = mei_driver_register(&microread_driver);
if (r) {
- pr_err(MICROREAD_DRIVER_NAME ": driver registration failed\n");
+ pr_err("driver registration failed\n");
return r;
}

diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c
index 3420d83..2e24373 100644
--- a/drivers/nfc/microread/microread.c
+++ b/drivers/nfc/microread/microread.c
@@ -18,6 +18,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/slab.h>
@@ -546,7 +548,7 @@ exit:
kfree_skb(skb);

if (r)
- pr_err("Failed to handle discovered target err=%d", r);
+ pr_err("Failed to handle discovered target err=%d\n", r);
}

static int microread_event_received(struct nfc_hci_dev *hdev, u8 gate,
@@ -656,7 +658,6 @@ int microread_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,

info = kzalloc(sizeof(struct microread_info), GFP_KERNEL);
if (!info) {
- pr_err("Cannot allocate memory for microread_info.\n");
r = -ENOMEM;
goto err_info_alloc;
}
@@ -688,7 +689,7 @@ int microread_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
MICROREAD_CMD_TAILROOM,
phy_payload);
if (!info->hdev) {
- pr_err("Cannot allocate nfc hdev.\n");
+ pr_err("Cannot allocate nfc hdev\n");
r = -ENOMEM;
goto err_alloc_hdev;
}
diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
index f58b390..9b259b1 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -173,7 +173,7 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
comp_ret);
if (comp_ret == 0) {
- dev_err(&drv->pdev->dev,
+ nfc_err(&drv->pdev->dev,
"timeout on wait_for_completion_timeout\n");
return -ETIMEDOUT;
}
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 714b4ec..35a2753 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -554,7 +554,7 @@ static void pn533_recv_response(struct urb *urb)

if (!pn533_rx_frame_is_cmd_response(dev, in_frame)) {
nfc_err(&dev->interface->dev,
- "It it not the response to the last command\n");
+ "It is not the response to the last command\n");
dev->wq_in_error = -EIO;
goto sched_wq;
}
@@ -1233,7 +1233,7 @@ static int pn533_target_found(struct pn533 *dev, u8 tg, u8 *tgdata,
struct nfc_target nfc_tgt;
int rc;

- dev_dbg(&dev->interface->dev, "%s - modulation=%d\n",
+ dev_dbg(&dev->interface->dev, "%s: modulation=%d\n",
__func__, dev->poll_mod_curr);

if (tg != 1)
@@ -1723,8 +1723,7 @@ static int pn533_activate_target(struct nfc_dev *nfc_dev,
struct pn533 *dev = nfc_get_drvdata(nfc_dev);
int rc;

- dev_dbg(&dev->interface->dev, "%s - protocol=%u\n",
- __func__, protocol);
+ dev_dbg(&dev->interface->dev, "%s: protocol=%u\n", __func__, protocol);

if (dev->poll_mod_count) {
nfc_err(&dev->interface->dev,
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 8cf64c1..abc22e0 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -18,6 +18,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/crc-ccitt.h>
#include <linux/module.h>
#include <linux/i2c.h>
@@ -85,8 +87,7 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
char rset_cmd[] = { 0x05, 0xF9, 0x04, 0x00, 0xC3, 0xE5 };
int count = sizeof(rset_cmd);

- pr_info(DRIVER_DESC ": %s\n", __func__);
- dev_info(&phy->i2c_dev->dev, "Detecting nfc_en polarity\n");
+ nfc_info(&phy->i2c_dev->dev, "Detecting nfc_en polarity\n");

/* Disable fw download */
gpio_set_value(phy->gpio_fw, 0);
@@ -107,7 +108,7 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
dev_dbg(&phy->i2c_dev->dev, "Sending reset cmd\n");
ret = i2c_master_send(phy->i2c_dev, rset_cmd, count);
if (ret == count) {
- dev_info(&phy->i2c_dev->dev,
+ nfc_info(&phy->i2c_dev->dev,
"nfc_en polarity : active %s\n",
(polarity == 0 ? "low" : "high"));
goto out;
@@ -115,7 +116,7 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
}
}

- dev_err(&phy->i2c_dev->dev,
+ nfc_err(&phy->i2c_dev->dev,
"Could not detect nfc_en polarity, fallback to active high\n");

out:
@@ -126,8 +127,6 @@ static int pn544_hci_i2c_enable(void *phy_id)
{
struct pn544_i2c_phy *phy = phy_id;

- pr_info(DRIVER_DESC ": %s\n", __func__);
-
gpio_set_value(phy->gpio_fw, 0);
gpio_set_value(phy->gpio_en, phy->en_polarity);
usleep_range(10000, 15000);
@@ -141,8 +140,6 @@ static void pn544_hci_i2c_disable(void *phy_id)
{
struct pn544_i2c_phy *phy = phy_id;

- pr_info(DRIVER_DESC ": %s\n", __func__);
-
gpio_set_value(phy->gpio_fw, 0);
gpio_set_value(phy->gpio_en, !phy->en_polarity);
usleep_range(10000, 15000);
@@ -225,11 +222,9 @@ static int check_crc(u8 *buf, int buflen)
crc = ~crc;

if (buf[len - 2] != (crc & 0xff) || buf[len - 1] != (crc >> 8)) {
- pr_err(PN544_HCI_I2C_DRIVER_NAME
- ": CRC error 0x%x != 0x%x 0x%x\n",
+ pr_err("CRC error 0x%x != 0x%x 0x%x\n",
crc, buf[len - 1], buf[len - 2]);
-
- pr_info(DRIVER_DESC ": %s : BAD CRC\n", __func__);
+ pr_info("%s: BAD CRC\n", __func__);
print_hex_dump(KERN_DEBUG, "crc: ", DUMP_PREFIX_NONE,
16, 2, buf, buflen, false);
return -EPERM;
@@ -255,13 +250,13 @@ static int pn544_hci_i2c_read(struct pn544_i2c_phy *phy, struct sk_buff **skb)

r = i2c_master_recv(client, &len, 1);
if (r != 1) {
- dev_err(&client->dev, "cannot read len byte\n");
+ nfc_err(&client->dev, "cannot read len byte\n");
return -EREMOTEIO;
}

if ((len < (PN544_HCI_I2C_LLC_MIN_SIZE - 1)) ||
(len > (PN544_HCI_I2C_LLC_MAX_SIZE - 1))) {
- dev_err(&client->dev, "invalid len byte\n");
+ nfc_err(&client->dev, "invalid len byte\n");
r = -EBADMSG;
goto flush;
}
@@ -372,35 +367,32 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
dev_dbg(&client->dev, "IRQ: %d\n", client->irq);

if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
- dev_err(&client->dev, "Need I2C_FUNC_I2C\n");
+ nfc_err(&client->dev, "Need I2C_FUNC_I2C\n");
return -ENODEV;
}

phy = devm_kzalloc(&client->dev, sizeof(struct pn544_i2c_phy),
GFP_KERNEL);
- if (!phy) {
- dev_err(&client->dev,
- "Cannot allocate memory for pn544 i2c phy.\n");
+ if (!phy)
return -ENOMEM;
- }

phy->i2c_dev = client;
i2c_set_clientdata(client, phy);

pdata = client->dev.platform_data;
if (pdata == NULL) {
- dev_err(&client->dev, "No platform data\n");
+ nfc_err(&client->dev, "No platform data\n");
return -EINVAL;
}

if (pdata->request_resources == NULL) {
- dev_err(&client->dev, "request_resources() missing\n");
+ nfc_err(&client->dev, "request_resources() missing\n");
return -EINVAL;
}

r = pdata->request_resources(client);
if (r) {
- dev_err(&client->dev, "Cannot get platform resources\n");
+ nfc_err(&client->dev, "Cannot get platform resources\n");
return r;
}

@@ -414,7 +406,7 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
PN544_HCI_I2C_DRIVER_NAME, phy);
if (r < 0) {
- dev_err(&client->dev, "Unable to register IRQ handler\n");
+ nfc_err(&client->dev, "Unable to register IRQ handler\n");
goto err_rti;
}

diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c
index 9c5f16e..a6c6b95 100644
--- a/drivers/nfc/pn544/pn544.c
+++ b/drivers/nfc/pn544/pn544.c
@@ -18,6 +18,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/module.h>
@@ -395,7 +397,7 @@ static int pn544_hci_start_poll(struct nfc_hci_dev *hdev,
if ((im_protocols | tm_protocols) & NFC_PROTO_NFC_DEP_MASK) {
hdev->gb = nfc_get_local_general_bytes(hdev->ndev,
&hdev->gb_len);
- pr_debug("generate local bytes %p", hdev->gb);
+ pr_debug("generate local bytes %p\n", hdev->gb);
if (hdev->gb == NULL || hdev->gb_len == 0) {
im_protocols &= ~NFC_PROTO_NFC_DEP_MASK;
tm_protocols &= ~NFC_PROTO_NFC_DEP_MASK;
@@ -692,7 +694,7 @@ static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb)
static int pn544_hci_check_presence(struct nfc_hci_dev *hdev,
struct nfc_target *target)
{
- pr_debug("supported protocol %d", target->supported_protocols);
+ pr_debug("supported protocol %d\b", target->supported_protocols);
if (target->supported_protocols & (NFC_PROTO_ISO14443_MASK |
NFC_PROTO_ISO14443_B_MASK)) {
return nfc_hci_send_cmd(hdev, target->hci_reader_gate,
@@ -732,7 +734,7 @@ static int pn544_hci_event_received(struct nfc_hci_dev *hdev, u8 gate, u8 event,
struct sk_buff *rgb_skb = NULL;
int r;

- pr_debug("hci event %d", event);
+ pr_debug("hci event %d\n", event);
switch (event) {
case PN544_HCI_EVT_ACTIVATED:
if (gate == PN544_RF_READER_NFCIP1_INITIATOR_GATE) {
@@ -763,7 +765,7 @@ static int pn544_hci_event_received(struct nfc_hci_dev *hdev, u8 gate, u8 event,
}

if (skb->data[0] != 0) {
- pr_debug("data0 %d", skb->data[0]);
+ pr_debug("data0 %d\n", skb->data[0]);
r = -EPROTO;
goto exit;
}
@@ -807,7 +809,6 @@ int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,

info = kzalloc(sizeof(struct pn544_hci_info), GFP_KERNEL);
if (!info) {
- pr_err("Cannot allocate memory for pn544_hci_info.\n");
r = -ENOMEM;
goto err_info_alloc;
}
@@ -841,7 +842,7 @@ int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
phy_headroom + PN544_CMDS_HEADROOM,
phy_tailroom, phy_payload);
if (!info->hdev) {
- pr_err("Cannot allocate nfc hdev.\n");
+ pr_err("Cannot allocate nfc hdev\n");
r = -ENOMEM;
goto err_alloc_hdev;
}
--
1.8.1.2.459.gbcd45b4.dirty

2013-08-27 13:42:57

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 0/3] nfc: standardize logging styles

Hi Joe,

On Fri, Apr 05, 2013 at 12:27:36PM -0700, Joe Perches wrote:
> Fix some defects in the logging too
>
> Joe Perches (3):
> nfc: Replace nfc_dev_dbg with dev_dbg, remove function tracing
> nfc: Convert nfc_dev_info and nfc_dev_err to nfc_<level>
> nfc: Standardize logging style
All 3 patches applied, sorry for missing those ones.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/