[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1399531250.4146.12.camel@joe-AO725>
Date: Wed, 07 May 2014 23:40:50 -0700
From: Joe Perches <joe@...ches.com>
To: Adithya K <linux.challenge1@...il.com>
Cc: standby24x7@...il.com, dan.carpenter@...cle.com,
khoroshilov@...ras.ru, arnd@...db.de, burzalodowa@...il.com,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
gregkh@...uxfoundation.org
Subject: Re: [PATCH] Staging: gdm72xx Fix minor coding style problems
On Thu, 2014-05-08 at 11:53 +0530, Adithya K wrote:
> This is patch for fixing of minor coding style problems.
[]
> diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
[]
> @@ -229,6 +229,7 @@ static u32 extract_qos_list(struct nic *nic, struct list_head *head)
> entry = list_entry(
> qcb->qos_list[i].prev,
> struct qos_entry_s, list);
> +
> list_move_tail(&entry->list, head);
That one is a checkpatch defect.
The list_entry( use is really ugly too
with bad indentation on the following line.
Look at the entire function:
static u32 extract_qos_list(struct nic *nic, struct list_head *head)
{
struct qos_cb_s *qcb = &nic->qos;
struct qos_entry_s *entry;
int i;
INIT_LIST_HEAD(head);
for (i = 0; i < QOS_MAX; i++) {
if (qcb->csr[i].enabled) {
if (qcb->csr[i].qos_buf_count < qcb->qos_limit_size) {
if (!list_empty(&qcb->qos_list[i])) {
entry = list_entry(
qcb->qos_list[i].prev,
struct qos_entry_s, list);
list_move_tail(&entry->list, head);
qcb->csr[i].qos_buf_count++;
if (!list_empty(&qcb->qos_list[i]))
netdev_warn(nic->netdev,
"Index(%d) is piled!!\n",
i);
}
}
}
}
return 0;
}
Please consider rewriting the function
to reduce unnecessary indentation.
Something like:
static u32 extract_qos_list(struct nic *nic, struct list_head *head)
{
struct qos_cb_s *qcb = &nic->qos;
int i;
INIT_LIST_HEAD(head);
for (i = 0; i < QOS_MAX; i++) {
if (!qcb->csr[i].enabled ||
qcb->csr[i].qos_buf_count >= qcb->qos_limit_size)
continue;
if (!list_empty(&qcb->qos_list[i])) {
struct qos_entry_s *entry;
entry = list_entry(qcb->qos_list[i].prev,
struct qos_entry_s, list);
list_move_tail(&entry->list, head);
qcb->csr[i].qos_buf_count++;
if (!list_empty(&qcb->qos_list[i]))
netdev_warn(nic->netdev, "Index(%d) is piled!!\n",
i);
}
}
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists