aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2008-10-28 06:10:14 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-10-28 06:12:03 -0400
commit2c78091405d6f54748b1fac78c45f2a799e3073a (patch)
tree89c319b25ad32a0994ae473ac6e817e2ac28f7b3 /drivers
parent7c045aa2c8eb731996b0c5c6552356b8946e6894 (diff)
[S390] qdio: remove incorrect memset
Remove the memset since zeroing the string is not needed and use snprintf instead of sprintf. Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/cio/qdio_debug.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c
index b5390821434f..f05590355be8 100644
--- a/drivers/s390/cio/qdio_debug.c
+++ b/drivers/s390/cio/qdio_debug.c
@@ -20,6 +20,7 @@ static struct dentry *debugfs_root;
20#define MAX_DEBUGFS_QUEUES 32 20#define MAX_DEBUGFS_QUEUES 32
21static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL }; 21static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL };
22static DEFINE_MUTEX(debugfs_mutex); 22static DEFINE_MUTEX(debugfs_mutex);
23#define QDIO_DEBUGFS_NAME_LEN 40
23 24
24void qdio_allocate_do_dbf(struct qdio_initialize *init_data) 25void qdio_allocate_do_dbf(struct qdio_initialize *init_data)
25{ 26{
@@ -152,17 +153,6 @@ static int qstat_seq_open(struct inode *inode, struct file *filp)
152 filp->f_path.dentry->d_inode->i_private); 153 filp->f_path.dentry->d_inode->i_private);
153} 154}
154 155
155static void get_queue_name(struct qdio_q *q, struct ccw_device *cdev, char *name)
156{
157 memset(name, 0, sizeof(name));
158 sprintf(name, "%s", dev_name(&cdev->dev));
159 if (q->is_input_q)
160 sprintf(name + strlen(name), "_input");
161 else
162 sprintf(name + strlen(name), "_output");
163 sprintf(name + strlen(name), "_%d", q->nr);
164}
165
166static void remove_debugfs_entry(struct qdio_q *q) 156static void remove_debugfs_entry(struct qdio_q *q)
167{ 157{
168 int i; 158 int i;
@@ -189,14 +179,17 @@ static struct file_operations debugfs_fops = {
189static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev) 179static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev)
190{ 180{
191 int i = 0; 181 int i = 0;
192 char name[40]; 182 char name[QDIO_DEBUGFS_NAME_LEN];
193 183
194 while (debugfs_queues[i] != NULL) { 184 while (debugfs_queues[i] != NULL) {
195 i++; 185 i++;
196 if (i >= MAX_DEBUGFS_QUEUES) 186 if (i >= MAX_DEBUGFS_QUEUES)
197 return; 187 return;
198 } 188 }
199 get_queue_name(q, cdev, name); 189 snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%s_%d",
190 dev_name(&cdev->dev),
191 q->is_input_q ? "input" : "output",
192 q->nr);
200 debugfs_queues[i] = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, 193 debugfs_queues[i] = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR,
201 debugfs_root, q, &debugfs_fops); 194 debugfs_root, q, &debugfs_fops);
202} 195}