From: Naveen Panwar <naveen.panwar27@gmail.com>
To: gregkh@linuxfoundation.org
Cc: mpe@ellerman.id.au, stern@rowland.harvard.edu,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Naveen Panwar <naveen.panwar27@gmail.com>
Subject: [PATCH] Staging: Ralink: ralink-gdma: Fixed codestyle issue and warnings
Date: Mon, 7 Sep 2020 12:27:45 +0530 [thread overview]
Message-ID: <20200907065745.21439-1-naveen.panwar27@gmail.com> (raw)
Fixed checkpatch warnings two warnings still exits about DT
compatible strings appers undocumented. Fixed the other codestyle
errors, and some warnings about use of volatile and un-necessary
out of memory errors.
Signed-off-by: Naveen Panwar <naveen.panwar27@gmail.com>
---
drivers/staging/ralink-gdma/ralink-gdma.c | 29 ++++++++++++-----------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/ralink-gdma/ralink-gdma.c b/drivers/staging/ralink-gdma/ralink-gdma.c
index eabf10933..1c3388b7c 100644
--- a/drivers/staging/ralink-gdma/ralink-gdma.c
+++ b/drivers/staging/ralink-gdma/ralink-gdma.c
@@ -122,7 +122,8 @@ struct gdma_dma_dev {
struct gdma_data *data;
void __iomem *base;
struct tasklet_struct task;
- volatile unsigned long chan_issued;
+
+ unsigned long chan_issued;
atomic_t cnt;
struct gdma_dmaengine_chan chan[];
@@ -135,8 +136,8 @@ struct gdma_data {
int (*start_transfer)(struct gdma_dmaengine_chan *chan);
};
-static struct gdma_dma_dev *gdma_dma_chan_get_dev(
- struct gdma_dmaengine_chan *chan)
+static struct gdma_dma_dev *gdma_dma_chan_get_dev
+ (struct gdma_dmaengine_chan *chan)
{
return container_of(chan->vchan.chan.device, struct gdma_dma_dev,
ddev);
@@ -510,10 +511,10 @@ static void gdma_dma_issue_pending(struct dma_chan *c)
spin_unlock_irqrestore(&chan->vchan.lock, flags);
}
-static struct dma_async_tx_descriptor *gdma_dma_prep_slave_sg(
- struct dma_chan *c, struct scatterlist *sgl,
- unsigned int sg_len, enum dma_transfer_direction direction,
- unsigned long flags, void *context)
+static struct dma_async_tx_descriptor *gdma_dma_prep_slave_sg
+ (struct dma_chan *c, struct scatterlist *sgl,
+ unsigned int sg_len, enum dma_transfer_direction direction,
+ unsigned long flags, void *context)
{
struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
struct gdma_dma_desc *desc;
@@ -522,7 +523,7 @@ static struct dma_async_tx_descriptor *gdma_dma_prep_slave_sg(
desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC);
if (!desc) {
- dev_err(c->device->dev, "alloc sg decs error\n");
+ goto free_rx_tx;
return NULL;
}
desc->residue = 0;
@@ -558,9 +559,9 @@ static struct dma_async_tx_descriptor *gdma_dma_prep_slave_sg(
return NULL;
}
-static struct dma_async_tx_descriptor *gdma_dma_prep_dma_memcpy(
- struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
- size_t len, unsigned long flags)
+static struct dma_async_tx_descriptor *gdma_dma_prep_dma_memcpy
+ (struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
+ size_t len, unsigned long flags)
{
struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
struct gdma_dma_desc *desc;
@@ -577,7 +578,7 @@ static struct dma_async_tx_descriptor *gdma_dma_prep_dma_memcpy(
desc = kzalloc(struct_size(desc, sg, num_periods), GFP_ATOMIC);
if (!desc) {
- dev_err(c->device->dev, "alloc memcpy decs error\n");
+ goto free_rx_tx;
return NULL;
}
desc->residue = len;
@@ -601,8 +602,8 @@ static struct dma_async_tx_descriptor *gdma_dma_prep_dma_memcpy(
return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
}
-static struct dma_async_tx_descriptor *gdma_dma_prep_dma_cyclic(
- struct dma_chan *c, dma_addr_t buf_addr, size_t buf_len,
+static struct dma_async_tx_descriptor *gdma_dma_prep_dma_cyclic
+ (struct dma_chan *c, dma_addr_t buf_addr, size_t buf_len,
size_t period_len, enum dma_transfer_direction direction,
unsigned long flags)
{
--
2.17.1
next reply other threads:[~2020-09-07 6:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 6:57 Naveen Panwar [this message]
2020-09-07 7:01 ` Greg KH
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=20200907065745.21439-1-naveen.panwar27@gmail.com \
--to=naveen.panwar27@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®