From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: greg@kroah.com, linux-kernel@vger.kernel.org, mark.a.allyn@intel.com
Subject: [PATCH 5/6] sep: NULL out pointers, mark debug code DEBUG to fix warnings
Date: Fri, 10 Feb 2012 13:53:21 +0000 [thread overview]
Message-ID: <20120210135319.12442.82066.stgit@bob.linux.org.uk> (raw)
In-Reply-To: <20120210134929.12442.59041.stgit@bob.linux.org.uk>
From: Mark A. Allyn <mark.a.allyn@intel.com>
[This is picked out of the differences between the upstream driver and
the staging driver. I'm resolving the differences as a series of updates -AC]
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/staging/sep/sep_main.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index db51895..cf420f6 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -40,6 +40,7 @@
/* #define SEP_PERF_DEBUG */
#include <linux/init.h>
+#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
@@ -197,9 +198,9 @@ static int sep_allocate_dmatables_region(struct sep_device *sep,
struct sep_dma_context *dma_ctx,
const u32 table_count)
{
- const size_t new_len = table_count *
- sizeof(struct sep_lli_entry) *
- SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP;
+ const size_t new_len =
+ SYNCHRONIC_DMA_TABLES_AREA_SIZE_BYTES - 1;
+
void *tmp_region = NULL;
dev_dbg(&sep->pdev->dev, "[PID%d] dma_ctx = 0x%p\n",
@@ -230,6 +231,7 @@ static int sep_allocate_dmatables_region(struct sep_device *sep,
if (*dmatables_region) {
memcpy(tmp_region, *dmatables_region, dma_ctx->dmatables_len);
kfree(*dmatables_region);
+ *dmatables_region = NULL;
}
*dmatables_region = tmp_region;
@@ -342,11 +344,12 @@ static void _sep_dump_message(struct sep_device *sep)
u32 *p = sep->shared_addr;
- for (count = 0; count < 40 * 4; count += 4)
+ for (count = 0; count < 10 * 4; count += 4)
dev_dbg(&sep->pdev->dev,
"[PID%d] Word %d of the message is %x\n",
current->pid, count/4, *p++);
}
+
#endif
/**
@@ -384,6 +387,8 @@ static void sep_unmap_and_free_shared_area(struct sep_device *sep)
sep->shared_addr, sep->shared_bus);
}
+#ifdef DEBUG
+
/**
* sep_shared_bus_to_virt - convert bus/virt addresses
* @sep: pointer to struct sep_device
@@ -398,6 +403,8 @@ static void *sep_shared_bus_to_virt(struct sep_device *sep,
return sep->shared_addr + (bus_address - sep->shared_bus);
}
+#endif
+
/**
* sep_open - device open method
* @inode: inode of SEP device
next prev parent reply other threads:[~2012-02-10 13:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 13:52 [PATCH 0/6] SEP resynchronize Alan Cox
2012-02-10 13:52 ` [PATCH 1/6] sep: Add new PCI identifier Alan Cox
2012-02-10 13:52 ` [PATCH 2/6] sep: Basic infrastructure for SEP DMA access to non CPU regions Alan Cox
2012-02-10 13:52 ` [PATCH 3/6] sep: Add interfaces for the new functions Alan Cox
2012-02-10 13:53 ` Hillf Danton
2012-02-10 16:45 ` Alan Cox
2012-02-11 12:22 ` Hillf Danton
2012-02-11 14:06 ` Alan Cox
2012-02-11 14:21 ` Hillf Danton
2012-02-10 13:53 ` [PATCH 4/6] sep: update initialisation Alan Cox
2012-02-10 13:53 ` Alan Cox [this message]
2012-02-10 13:53 ` [PATCH 6/6] sep: reworked crypto layer Alan Cox
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=20120210135319.12442.82066.stgit@bob.linux.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.a.allyn@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;
as well as URLs for NNTP newsgroup(s).