aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/csr1212.h
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-13 19:20:53 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-04-29 18:00:28 -0400
commitc1a37f2c6572031203243dd083585aa4a1c138d5 (patch)
treec25654f20ed42e5432f4306c90b170d5f0ddc3ae /drivers/ieee1394/csr1212.h
parent64ff712321875c2457d3a77d3fc4ab4989f7a8c0 (diff)
ieee1394: de-inline some functions
This small reorganization of public csr1212 functions saves one exported symbol and a few bytes in the driver modules. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/csr1212.h')
-rw-r--r--drivers/ieee1394/csr1212.h28
1 files changed, 5 insertions, 23 deletions
diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h
index 4ef0949589c7..655827527ecc 100644
--- a/drivers/ieee1394/csr1212.h
+++ b/drivers/ieee1394/csr1212.h
@@ -313,15 +313,11 @@ extern int csr1212_parse_keyval(struct csr1212_keyval *kv,
313 struct csr1212_csr_rom_cache *cache); 313 struct csr1212_csr_rom_cache *cache);
314extern int csr1212_parse_csr(struct csr1212_csr *csr); 314extern int csr1212_parse_csr(struct csr1212_csr *csr);
315 315
316/* These are internal functions referenced by inline functions below. */
317extern int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv);
318extern void _csr1212_destroy_keyval(struct csr1212_keyval *kv);
319
320 316
321/* This function allocates a new cache which may be used for either parsing or 317/* This function allocates a new cache which may be used for either parsing or
322 * generating sub-sets of Configuration ROM images. */ 318 * generating sub-sets of Configuration ROM images. */
323static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u32 offset, 319static inline struct csr1212_csr_rom_cache *
324 size_t size) 320csr1212_rom_cache_malloc(u32 offset, size_t size)
325{ 321{
326 struct csr1212_csr_rom_cache *cache; 322 struct csr1212_csr_rom_cache *cache;
327 323
@@ -345,16 +341,8 @@ static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u32 offset,
345 341
346/* This function ensures that a keyval contains data when referencing a keyval 342/* This function ensures that a keyval contains data when referencing a keyval
347 * created by parsing a Configuration ROM. */ 343 * created by parsing a Configuration ROM. */
348static inline struct csr1212_keyval *csr1212_get_keyval(struct csr1212_csr *csr, 344extern struct csr1212_keyval *
349 struct csr1212_keyval *kv) 345csr1212_get_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv);
350{
351 if (!kv)
352 return NULL;
353 if (!kv->valid)
354 if (_csr1212_read_keyval(csr, kv) != CSR1212_SUCCESS)
355 return NULL;
356 return kv;
357}
358 346
359 347
360/* This function increments the reference count for a keyval should there be a 348/* This function increments the reference count for a keyval should there be a
@@ -369,13 +357,7 @@ static inline void csr1212_keep_keyval(struct csr1212_keyval *kv)
369 * keyval when there are no more users of the keyval. This should be called by 357 * keyval when there are no more users of the keyval. This should be called by
370 * any code that calls csr1212_keep_keyval() or any of the keyval creation 358 * any code that calls csr1212_keep_keyval() or any of the keyval creation
371 * routines csr1212_new_*(). */ 359 * routines csr1212_new_*(). */
372static inline void csr1212_release_keyval(struct csr1212_keyval *kv) 360extern void csr1212_release_keyval(struct csr1212_keyval *kv);
373{
374 if (kv->refcnt > 1)
375 kv->refcnt--;
376 else
377 _csr1212_destroy_keyval(kv);
378}
379 361
380 362
381/* 363/*