From: Minfei Huang <mnghuan@gmail.com>
To: bart.vanassche@sandisk.com, dledford@redhat.com,
sean.hefty@intel.com, hal.rosenstock@gmail.com
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Minfei Huang <mnghuan@gmail.com>
Subject: [PATCH] ib_srp: Let compiler ignore the useless debug code
Date: Fri, 24 Feb 2017 16:44:51 +0800 [thread overview]
Message-ID: <20170224084451.42117-1-mnghuan@gmail.com> (raw)
"if (0)" is used to make this block of debug code not be executed. There
is a more elegant way to let compiler ignore this code, using
"#if 0 .. #endif" instead.
Although it may be optimised by some compilers with specified parameter,
just for readable.
Signed-off-by: Minfei Huang <mnghuan@gmail.com>
---
drivers/infiniband/ulp/srp/ib_srp.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 36529e3..f2d7821 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2023,12 +2023,12 @@ static void srp_recv_done(struct ib_cq *cq, struct ib_wc *wc)
opcode = *(u8 *) iu->buf;
- if (0) {
- shost_printk(KERN_ERR, target->scsi_host,
- PFX "recv completion, opcode 0x%02x\n", opcode);
- print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 8, 1,
- iu->buf, wc->byte_len, true);
- }
+#if 0
+ shost_printk(KERN_ERR, target->scsi_host,
+ PFX "recv completion, opcode 0x%02x\n", opcode);
+ print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 8, 1,
+ iu->buf, wc->byte_len, true);
+#endif
switch (opcode) {
case SRP_RSP:
--
2.10.1 (Apple Git-78)
next reply other threads:[~2017-02-24 8:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-24 8:44 Minfei Huang [this message]
2017-02-24 16:16 ` [PATCH] ib_srp: Let compiler ignore the useless debug code Bart Van Assche
[not found] ` <1487952911.2575.1.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-03-05 8:22 ` Leon Romanovsky
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=20170224084451.42117-1-mnghuan@gmail.com \
--to=mnghuan@gmail.com \
--cc=bart.vanassche@sandisk.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox