lkml.org 
[lkml]   [2005]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [2.6 patch] drivers/ieee1394/csr1212.c: remove dead code
On Mon, Nov 21, 2005 at 08:45:29PM +0100, Stefan Richter wrote:

> Or for better yet, we should use _csr1212_read_keyval() instead so that
> we get more sensible error codes.

Good idea. How about:


csr1212: check results of keyval reads

csr1212_parse_csr() did not properly check return values when reading
keyvals. Fix this by using _csr1212_read_keyval() instead of
csr1212_get_keyval() and checking the return code.

Signed-off-by: Jody McIntyre <scjody@steamballoon.com>

Index: linux/drivers/ieee1394/csr1212.c
===================================================================
--- linux.orig/drivers/ieee1394/csr1212.c
+++ linux/drivers/ieee1394/csr1212.c
@@ -1610,16 +1610,16 @@ int csr1212_parse_csr(struct csr1212_csr
csr->root_kv->valid = 0;
csr->root_kv->next = csr->root_kv;
csr->root_kv->prev = csr->root_kv;
- csr1212_get_keyval(csr, csr->root_kv);
+ if (_csr1212_read_keyval(csr, csr->root_kv) != CSR1212_SUCCESS)
+ return ret;

/* Scan through the Root directory finding all extended ROM regions
* and make cache regions for them */
for (dentry = csr->root_kv->value.directory.dentries_head;
dentry; dentry = dentry->next) {
if (dentry->kv->key.id == CSR1212_KV_ID_EXTENDED_ROM) {
- csr1212_get_keyval(csr, dentry->kv);
-
- if (ret != CSR1212_SUCCESS)
+ if (_csr1212_read_keyval(csr, dentry->kv) !=
+ CSR1212_SUCCESS)
return ret;
}
}
> --
> Stefan Richter
> -=====-=-=-= =-== =-=-=
> http://arcgraph.de/sr/
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
> Register for a JBoss Training Course. Free Certification Exam
> for All Training Attendees Through End of 2005. For more info visit:
> http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
> _______________________________________________
> mailing list linux1394-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux1394-devel

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-21 22:50    [from the cache]
©2003-2011 Jasper Spaans