Commit b8db8002 authored by Grant Grundler's avatar Grant Grundler Committed by Kyle McMartin

[PARISC] Cleanup whitespace and handle proc_mkdir() failures in pci-dma.c

1) cleanup whitespace and handle proc_mkdir() failures.
   From: Christophe Lucas <clucas@rotomalug.org>

2) rename "dino" entry to "pcxl_dma"...also seems like it's in
   the wrong location.

3) don't dump resource bitmap in /proc/pcxl_dma output

4) fixup compiler warning
Signed-off-by: default avatarGrant Grundler <grundler@parisc-linux.org>
Signed-off-by: default avatarKyle McMartin <kyle@parisc-linux.org>
parent 8054f03f
......@@ -31,7 +31,7 @@
#include <asm/page.h> /* get_order */
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
#include <asm/tlbflush.h> /* for purge_tlb_*() macros */
static struct proc_dir_entry * proc_gsc_root = NULL;
static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);
......@@ -343,7 +343,17 @@ pcxl_dma_init(void)
get_order(pcxl_res_size));
memset(pcxl_res_map, 0, pcxl_res_size);
proc_gsc_root = proc_mkdir("gsc", 0);
create_proc_info_entry("dino", 0, proc_gsc_root, pcxl_proc_info);
if (!proc_gsc_root)
printk(KERN_WARNING
"pcxl_dma_init: Unable to create gsc /proc dir entry\n");
else {
struct proc_dir_entry* ent;
ent = create_proc_info_entry("pcxl_dma", 0,
proc_gsc_root, pcxl_proc_info);
if (!ent)
printk(KERN_WARNING
"pci-dma.c: Unable to create pcxl_dma /proc entry.\n");
}
return 0;
}
......@@ -545,16 +555,16 @@ struct hppa_dma_ops pcx_dma_ops = {
static int pcxl_proc_info(char *buf, char **start, off_t offset, int len)
{
#if 0
u_long i = 0;
unsigned long *res_ptr = (u_long *)pcxl_res_map;
#endif
unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */
sprintf(buf, "\nDMA Mapping Area size : %d bytes (%d pages)\n",
PCXL_DMA_MAP_SIZE,
(pcxl_res_size << 3) ); /* 1 bit per page */
sprintf(buf, "\nDMA Mapping Area size : %d bytes (%ld pages)\n",
PCXL_DMA_MAP_SIZE, total_pages);
sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n",
buf, pcxl_res_size, pcxl_res_size << 3); /* 8 bits per byte */
sprintf(buf, "%sResource bitmap : %d bytes\n", buf, pcxl_res_size);
strcat(buf, " total: free: used: % used:\n");
sprintf(buf, "%sblocks %8d %8ld %8ld %8ld%%\n", buf, pcxl_res_size,
......@@ -565,6 +575,7 @@ static int pcxl_proc_info(char *buf, char **start, off_t offset, int len)
total_pages - pcxl_used_pages, pcxl_used_pages,
(pcxl_used_pages * 100 / total_pages));
#if 0
strcat(buf, "\nResource bitmap:");
for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) {
......@@ -572,6 +583,7 @@ static int pcxl_proc_info(char *buf, char **start, off_t offset, int len)
strcat(buf,"\n ");
sprintf(buf, "%s %08lx", buf, *res_ptr);
}
#endif
strcat(buf, "\n");
return strlen(buf);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment