From: Shivani Bhardwaj <shivanib134@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] Staging: rdma: mad: Remove explicit cast
Date: Thu, 15 Oct 2015 15:14:41 +0530 [thread overview]
Message-ID: <20151015094441.GA12850@ubuntu> (raw)
Explicit type casting is not required as compiler can type cast
variables implicitly. Therefore, it should be removed.
Semantic patch used:
@@
type T;
T e;
identifier x;
@@
* T x = (T)e;
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
drivers/staging/rdma/hfi1/mad.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rdma/hfi1/mad.c b/drivers/staging/rdma/hfi1/mad.c
index b2c1b72..7944ddf 100644
--- a/drivers/staging/rdma/hfi1/mad.c
+++ b/drivers/staging/rdma/hfi1/mad.c
@@ -1488,7 +1488,7 @@ static int __subn_get_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data,
u32 *resp_len)
{
struct hfi1_ibport *ibp = to_iport(ibdev, port);
- u8 *p = (u8 *)data;
+ u8 *p = data;
size_t size = ARRAY_SIZE(ibp->sl_to_sc); /* == 32 */
unsigned i;
@@ -1511,7 +1511,7 @@ static int __subn_set_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data,
u32 *resp_len)
{
struct hfi1_ibport *ibp = to_iport(ibdev, port);
- u8 *p = (u8 *)data;
+ u8 *p = data;
int i;
if (am) {
@@ -1530,7 +1530,7 @@ static int __subn_get_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data,
u32 *resp_len)
{
struct hfi1_ibport *ibp = to_iport(ibdev, port);
- u8 *p = (u8 *)data;
+ u8 *p = data;
size_t size = ARRAY_SIZE(ibp->sc_to_sl); /* == 32 */
unsigned i;
@@ -1553,7 +1553,7 @@ static int __subn_set_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data,
u32 *resp_len)
{
struct hfi1_ibport *ibp = to_iport(ibdev, port);
- u8 *p = (u8 *)data;
+ u8 *p = data;
int i;
if (am) {
--
2.1.0
reply other threads:[~2015-10-15 9:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20151015094441.GA12850@ubuntu \
--to=shivanib134@gmail.com \
--cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.