From: Vandana BN <bnvandana@gmail.com>
To: dan.carpenter@oracle.com, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
lukas.bulwahn@gmail.com
Cc: skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linuxfoundation.org,
Vandana BN <bnvandana@gmail.com>
Subject: [PATCH v4 8/8] Staging: kpc2000: kpc_dma: Resolve cast warning and use const for file_operation
Date: Mon, 13 May 2019 19:13:27 +0530 [thread overview]
Message-ID: <20190513134327.26320-8-bnvandana@gmail.com> (raw)
In-Reply-To: <20190513134327.26320-1-bnvandana@gmail.com>
This Patch resolves unnecessary cast warning and const file_operations
reported by checkpath.pl
WARNING: unnecessary cast may hide bugs
WARNING: struct file_operations should normally be const
Signed-off-by: Vandana BN <bnvandana@gmail.com>
---
v2 - split changes to multiple patches
v3 - edit commit message, subject line
v4 - edit commit message
drivers/staging/kpc2000/kpc_dma/fileops.c | 4 ++--
drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index c21672ea2b4f..54a1419728ce 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -59,7 +59,7 @@ int kpc_dma_transfer(struct dev_private_data *priv, struct kiocb *kcb, unsigned
dev_dbg(&priv->ldev->pldev->dev, "%s(priv = [%p], kcb = [%p], iov_base = [%p], iov_len = %ld) ldev = [%p]\n", __func__, priv, kcb, (void *)iov_base, iov_len, ldev);
- acd = (struct aio_cb_data *) kzalloc(sizeof(struct aio_cb_data), GFP_KERNEL);
+ acd = kzalloc(sizeof(struct aio_cb_data), GFP_KERNEL);
if (!acd) {
dev_err(&priv->ldev->pldev->dev, "Couldn't kmalloc space for for the aio data\n");
return -ENOMEM;
@@ -418,7 +418,7 @@ long kpc_dma_ioctl(struct file *filp, unsigned int ioctl_num, unsigned long ioc
return -ENOTTY;
}
-struct file_operations kpc_dma_fops = {
+const struct file_operations kpc_dma_fops = {
.owner = THIS_MODULE,
.open = kpc_dma_open,
.release = kpc_dma_close,
diff --git a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h
index cf781940ac1b..ee47f43e71cf 100644
--- a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h
+++ b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h
@@ -57,7 +57,7 @@ struct dev_private_data {
struct kpc_dma_device *kpc_dma_lookup_device(int minor);
-extern struct file_operations kpc_dma_fops;
+extern const struct file_operations kpc_dma_fops;
#define ENG_CAP_PRESENT 0x00000001
#define ENG_CAP_DIRECTION 0x00000002
--
2.17.1
prev parent reply other threads:[~2019-05-13 13:44 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 19:38 [PATCH] Staging: kpc2000: kpc_dma: resolve checkpath errors and warnings Vandana BN
2019-05-10 20:34 ` [Linux-kernel-mentees] " Lukas Bulwahn
2019-05-12 15:48 ` Vandana BN
2019-05-11 6:04 ` Greg KH
2019-05-12 23:39 ` [PATCH v2 1/8] Staging: kpc2000: kpc_dma: resolve trailing whitespace error reported by checkpatch Vandana BN
2019-05-12 23:39 ` [PATCH v2 2/8] Staging: kpc2000: kpc_dma: Resolve coding style errors " Vandana BN
2019-05-13 8:42 ` Greg KH
2019-05-13 10:43 ` Vandana BN
2019-05-12 23:39 ` [PATCH v2 3/8] " Vandana BN
2019-05-12 23:39 ` [PATCH v2 4/8] Staging: kpc2000: kpc_dma: Resolve code indent error " Vandana BN
2019-05-12 23:39 ` [PATCH v2 5/8] Staging: kpc2000: kpc_dma: Resolve coding style " Vandana BN
2019-05-12 23:39 ` [PATCH v2 6/8] Staging: kpc2000: kpc_dma: Resolve coding style warning " Vandana BN
2019-05-12 23:39 ` [PATCH v2 7/8] " Vandana BN
2019-05-12 23:40 ` [PATCH v2 8/8] " Vandana BN
2019-05-13 10:26 ` [PATCH v3 1/8] Staging: kpc2000: kpc_dma: Resolve trailing whitespace error " Vandana BN
2019-05-13 10:26 ` [PATCH v3 2/8] Staging: kpc2000: kpc_dma: Resolve space errors around pointers and function declarations " Vandana BN
2019-05-13 10:26 ` [PATCH v3 3/8] Staging: kpc2000: kpc_dma: Resolve checkpatch space errors around brace '{','!' and open paranthesis '(' Vandana BN
2019-05-13 10:26 ` [PATCH v3 4/8] Staging: kpc2000: kpc_dma: Resolve code indent and trailing statements on next line errors reported by checkpatch Vandana BN
2019-05-13 10:26 ` [PATCH v3 5/8] Staging: kpc2000: kpc_dma: Resolve checkpath errors Macros in paranthesis & trailing statements on next line Vandana BN
2019-05-13 10:26 ` [PATCH v3 6/8] Staging: kpc2000: kpc_dma: Resolve warning Missing blank line after declarations & labels not to be indented Vandana BN
2019-05-13 10:26 ` [PATCH v3 7/8] Staging: kpc2000: kpc_dma: Resolve warning to use __func__ insted of funtion name reported by checkpatch Vandana BN
2019-05-13 10:26 ` [PATCH v3 8/8] Staging: kpc2000: kpc_dma: Resolve cast warning and use const for file_operation Vandana BN
2019-05-13 10:49 ` [PATCH v3 1/8] Staging: kpc2000: kpc_dma: Resolve trailing whitespace error reported by checkpatch Dan Carpenter
2019-05-13 12:00 ` Vandana BN
2019-05-13 13:43 ` [PATCH v4 " Vandana BN
2019-05-13 13:43 ` [PATCH v4 2/8] Staging: kpc2000: kpc_dma: Resolve space errors around pointers and function declarations " Vandana BN
2019-05-13 13:43 ` [PATCH v4 3/8] Staging: kpc2000: kpc_dma: Resolve checkpatch space errors around brace '{','!' and open paranthesis '(' Vandana BN
2019-05-13 13:43 ` [PATCH v4 4/8] Staging: kpc2000: kpc_dma: Resolve code indent and trailing statements on next line errors reported by checkpatch Vandana BN
2019-05-13 13:43 ` [PATCH v4 5/8] Staging: kpc2000: kpc_dma: Resolve checkpath errors Macros in paranthesis & trailing statements on next line Vandana BN
2019-05-13 13:43 ` [PATCH v4 6/8] Staging: kpc2000: kpc_dma: Resolve warning Missing blank line after declarations & labels not to be indented Vandana BN
2019-05-13 13:43 ` [PATCH v4 7/8] Staging: kpc2000: kpc_dma: Resolve warning to use __func__ insted of funtion name reported by checkpatch Vandana BN
2019-05-13 13:43 ` Vandana BN [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=20190513134327.26320-8-bnvandana@gmail.com \
--to=bnvandana@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=skhan@linuxfoundation.org \
/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®