From: Robert Love <robert.w.love@intel.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 07/10] [FCoE] Remove ASSERTs from fcoe
Date: Tue, 22 Jan 2008 16:37:11 -0800 [thread overview]
Message-ID: <20080123003711.8469.99478.stgit@fritz> (raw)
In-Reply-To: <20080123003523.8469.62236.stgit@fritz>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/ofc/fcoe/fcoe_def.h | 1 -
drivers/scsi/ofc/fcoe/fcoe_dev.c | 16 ++++++----------
drivers/scsi/ofc/fcoe/fcoe_if.c | 4 ----
drivers/scsi/ofc/fcoe/fcoeinit.c | 1 -
drivers/scsi/ofc/fcoe/fcoeioctl.c | 1 -
5 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/ofc/fcoe/fcoe_def.h b/drivers/scsi/ofc/fcoe/fcoe_def.h
index 22c5934..867ae55 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_def.h
+++ b/drivers/scsi/ofc/fcoe/fcoe_def.h
@@ -93,7 +93,6 @@ struct fcoe_rcv_info {
*/
static inline struct fcoe_rcv_info *fcoe_dev_from_skb(struct sk_buff *skb)
{
- ASSERT(sizeof(struct fcoe_rcv_info) <= sizeof(skb->cb));
return ((struct fcoe_rcv_info *) skb->cb);
}
diff --git a/drivers/scsi/ofc/fcoe/fcoe_dev.c b/drivers/scsi/ofc/fcoe/fcoe_dev.c
index f37bd2c..0beb78e 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_dev.c
+++ b/drivers/scsi/ofc/fcoe/fcoe_dev.c
@@ -36,7 +36,6 @@
#include <scsi/scsi_transport_fc.h>
#include <net/rtnetlink.h>
-#include "sa_assert.h"
#include "fc_types.h"
#include "fc_frame.h"
#include "fc_print.h"
@@ -178,7 +177,7 @@ static void fcoe_skb_destroy(struct sk_buff *skb)
struct fcdev *fdev = (struct fcdev *)fp->fr_dev;
struct fcoe_softc *fc = NULL;
- ASSERT(fp->fr_free_priv == skb);
+ WARN_ON(fp->fr_free_priv != skb);
if (fdev)
fc = (struct fcoe_softc *)fdev->drv_priv;
@@ -201,7 +200,7 @@ struct fc_frame *fcoe_frame_alloc(size_t len)
struct fc_frame *fp;
struct sk_buff *skb;
- ASSERT((len % sizeof(uint32_t)) == 0);
+ WARN_ON((len % sizeof(uint32_t)) != 0);
len += sizeof(struct fc_frame_header);
skb = dev_alloc_skb(len + sizeof(*fp) +
FC_FRAME_HEADROOM + FC_FRAME_TAILROOM);
@@ -245,7 +244,7 @@ int fcoe_xmit(struct fcdev *fc_dev, struct fc_frame *fp)
if (unlikely(debug_fcoe))
fc_print_frame_hdr("fcoe_xmit", fp);
- ASSERT((fp->fr_len % sizeof(uint32_t)) == 0);
+ WARN_ON((fp->fr_len % sizeof(uint32_t)) != 0);
fc = (struct fcoe_softc *)fc_dev->drv_priv;
/*
@@ -272,9 +271,9 @@ int fcoe_xmit(struct fcdev *fc_dev, struct fc_frame *fp)
}
}
- ASSERT(fp->fr_free == fcoe_frame_free); /* allocated by us */
+ WARN_ON(fp->fr_free != fcoe_frame_free); /* allocated by us */
skb = (struct sk_buff *)fp->fr_free_priv;
- ASSERT(skb->data == (unsigned char *)fp->fr_hdr);
+ WARN_ON(skb->data != (unsigned char *)fp->fr_hdr);
sof = fp->fr_sof;
eof = fp->fr_eof;
@@ -394,7 +393,6 @@ int fcoe_xmit(struct fcdev *fc_dev, struct fc_frame *fp)
} else {
struct fcoe_hdr_old *ohp;
- ASSERT(hlen == sizeof(*ohp));
ohp = (struct fcoe_hdr_old *)(eh + 1);
net16_put(&ohp->fcoe_plen, FC_FCOE_ENCAPS_LEN_SOF(wlen, sof));
}
@@ -502,7 +500,6 @@ int fcoe_percpu_receive_thread(void *arg)
struct fcoe_hdr_old *fchp;
u_int len;
- ASSERT(hlen == sizeof(*fchp));
fchp = (struct fcoe_hdr_old *)skb->data;
len = net16_get(&fchp->fcoe_plen);
skb_pull(skb, sizeof(*fchp));
@@ -548,7 +545,6 @@ int fcoe_percpu_receive_thread(void *arg)
* and it'll be more cache-efficient.
*/
fh = fc_frame_header_get(fp);
- ASSERT(fh);
if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA &&
fh->fh_type == FC_TYPE_FCP) {
fp->fr_flags |= FCPHF_CRC_UNCHECKED;
@@ -568,7 +564,7 @@ int fcoe_percpu_receive_thread(void *arg)
stats->ErrorFrames++;
fc_frame_free(fp);
}
- ASSERT(fc_frame_freed_static(fp));
+ WARN_ON(!fc_frame_freed_static(fp));
kfree_skb(skb);
}
return 0;
diff --git a/drivers/scsi/ofc/fcoe/fcoe_if.c b/drivers/scsi/ofc/fcoe/fcoe_if.c
index 9963593..f3e323d 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_if.c
+++ b/drivers/scsi/ofc/fcoe/fcoe_if.c
@@ -40,7 +40,6 @@
/*
* Non Linux header definitions
*/
-#include "sa_assert.h"
#include "fc_types.h"
#include "fc_frame.h"
#include "fc_print.h"
@@ -102,8 +101,6 @@ int fcoe_destroy_interface(struct fcdev *fd)
net8_t flogi_maddr[ETH_ALEN];
#endif
- ASSERT(fd != NULL);
-
openfc_unregister(fd);
fc = (struct fcoe_softc *)fd->drv_priv;
@@ -222,7 +219,6 @@ int fcoe_create_interface(struct fcoe_info *fci, void *ptr)
net8_t flogi_maddr[ETH_ALEN];
#endif
- ASSERT(fci != NULL);
fdev = openfc_alloc_dev(&fcoe_port_ops, sizeof(struct fcoe_softc));
if (unlikely(!fdev)) {
OFC_DBG("couldn't allocate space for hba struct");
diff --git a/drivers/scsi/ofc/fcoe/fcoeinit.c b/drivers/scsi/ofc/fcoe/fcoeinit.c
index 1ac7d69..a39f451 100644
--- a/drivers/scsi/ofc/fcoe/fcoeinit.c
+++ b/drivers/scsi/ofc/fcoe/fcoeinit.c
@@ -29,7 +29,6 @@
#include <linux/if_ether.h>
#include <linux/fs.h>
-#include "sa_assert.h"
#include "fc_types.h"
#include "fc_frame.h"
#include "fcdev.h"
diff --git a/drivers/scsi/ofc/fcoe/fcoeioctl.c b/drivers/scsi/ofc/fcoe/fcoeioctl.c
index a2f8a25..8621cff 100644
--- a/drivers/scsi/ofc/fcoe/fcoeioctl.c
+++ b/drivers/scsi/ofc/fcoe/fcoeioctl.c
@@ -22,7 +22,6 @@
#include <linux/kernel.h>
#include <linux/fs.h>
-#include "sa_assert.h"
#include "fc_types.h"
#include "fc_frame.h"
#include "fcdev.h"
next prev parent reply other threads:[~2008-01-23 0:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-23 0:35 [PATCH 00/10] [FCoE] This patch set removes the ASSERT code in Open-FCoE Robert Love
2008-01-23 0:35 ` [PATCH 01/10] [FCoE] Changing all ASSERT_NOTIMPL to WARN_ON(1) Robert Love
2008-01-23 0:35 ` [PATCH 02/10] [FCoE] Convert one ASSERT_NOTREACHED " Robert Love
2008-01-23 0:36 ` [PATCH 03/10] [FCoE] Remove DEBUG_ASSERTS statements Robert Love
2008-01-23 0:36 ` [PATCH 04/10] [FCoE] Remove ASSERTs from libfc Robert Love
2008-01-23 0:36 ` [PATCH 05/10] [FCoE] Remove ASSERTs from libsa Robert Love
2008-01-23 0:36 ` [PATCH 06/10] [FCoE] Remove ASSERTs from openfc Robert Love
2008-01-23 0:37 ` Robert Love [this message]
2008-01-23 0:37 ` [PATCH 08/10] [FCoE] Remove ASSERTs from frame headers Robert Love
2008-01-23 0:37 ` [PATCH 09/10] [FCoE] Remove sa_assert files Robert Love
2008-01-23 0:37 ` [PATCH 10/10] [FCoE] Removing unused defines Robert Love
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=20080123003711.8469.99478.stgit@fritz \
--to=robert.w.love@intel.com \
--cc=linux-scsi@vger.kernel.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 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.