From 7a4371c4f77a4b2789d0d5d204aa52d7e8061506 Mon Sep 17 00:00:00 2001 From: adilger Date: Sat, 22 Feb 2003 08:53:08 +0000 Subject: [PATCH] Add return value to init_timer() to quiet compiler warning. --- lustre/include/liblustre.h | 105 +++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 41 deletions(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 668d0d5..a27abb9 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -1,3 +1,26 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * Copyright (C) 2001 Cluster File Systems, Inc. + * + * This file is part of Lustre, http://www.lustre.org. + * + * Lustre is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * Lustre is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Lustre; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * User-space Lustre headers. + * + */ #ifndef LIBLUSTRE_H__ #define LIBLUSTRE_H__ @@ -15,11 +38,11 @@ #include #include -/* definitions for liblustre */ +/* definitions for liblustre */ /* always adopt 2.5 definitions */ #define LINUX_VERSION_CODE 1 -#define KERNEL_VERSION(a,b,c) 0 +#define KERNEL_VERSION(a,b,c) 0 static inline void inter_module_put(void *a) { @@ -33,7 +56,7 @@ static inline void *inter_module_get(char *arg) if (strcmp(arg, "tcpnal_ni") == 0 ) return &tcpnal_ni; - else + else return NULL; } @@ -41,14 +64,14 @@ static inline void *inter_module_get(char *arg) /* cheats for now */ -struct work_struct { +struct work_struct { void (*ws_task)(void *arg); void *ws_arg; }; static inline void prepare_work(struct work_struct *q, void (*t)(void *), - void *arg) -{ + void *arg) +{ q->ws_task = t; q->ws_arg = arg; return; @@ -87,27 +110,27 @@ typedef void *write_proc_t; /* modules */ -struct module { +struct module { int count; }; static inline void MODULE_AUTHOR(char *name) -{ +{ printf("%s\n", name); } #define MODULE_DESCRIPTION(name) MODULE_AUTHOR(name) #define MODULE_LICENSE(name) MODULE_AUTHOR(name) #define THIS_MODULE NULL -#define __init +#define __init #define __exit /* devices */ -static inline int misc_register(void *foo) -{ +static inline int misc_register(void *foo) +{ return 0; -} +} #define misc_deregister misc_register #define __MOD_INC_USE_COUNT(m) (m->count++) @@ -126,7 +149,7 @@ extern int echo_client_init(void); /* general stuff */ #define jiffies 0 -#define EXPORT_SYMBOL(S) +#define EXPORT_SYMBOL(S) typedef int spinlock_t; typedef __u64 kdev_t; @@ -146,15 +169,15 @@ static inline void spin_unlock_bh(spinlock_t *l) static inline void spin_lock_irqrestore(a,b) { return; -} +} static inline void spin_unlock_irqrestore(a,b) { return; -} +} static inline void spin_lock_irqsave(a,b) { return; -} +} #define barrier() do {int a= 1; a++; } while (0) @@ -179,21 +202,21 @@ static inline void get_random_bytes(void *ptr, int size) /* memory */ -static inline int copy_from_user(void *a,void *b, int c) -{ +static inline int copy_from_user(void *a,void *b, int c) +{ memcpy(a,b,c); return 0; } -static inline int copy_to_user(void *a,void *b, int c) -{ +static inline int copy_to_user(void *a,void *b, int c) +{ memcpy(a,b,c); return 0; } /* slabs */ -typedef struct { +typedef struct { int size; } kmem_cache_t; #define SLAB_HWCACHE_ALIGN 0 @@ -213,7 +236,7 @@ static inline int kmem_cache_destroy(kmem_cache_t *a) #define PORTAL_SLAB_ALLOC(lock,cache,size) do { lock = kmem_cache_alloc(cache,prio); } while (0) #define PORTAL_SLAB_FREE(lock,cache,size) do { lock = kmem_cache_alloc(cache,prio); } while (0) -struct page { +struct page { void *addr; int index; }; @@ -221,11 +244,11 @@ struct page { #define kmap(page) (page)->addr #define kunmap(a) do { int foo = 1; foo++; } while (0) -static inline struct page *alloc_pages(mask,foo) +static inline struct page *alloc_pages(mask,foo) { struct page *pg = malloc(sizeof(*pg)); - if (!pg) + if (!pg) return NULL; #ifdef MAP_ANONYMOUS pg->addr = mmap(0, PAGE_SIZE, PROT_WRITE, MAP_ANONYMOUS, 0, 0); @@ -234,17 +257,17 @@ static inline struct page *alloc_pages(mask,foo) #endif if (!pg->addr) { - free(pg); + free(pg); return NULL; } return pg; } -static inline void __free_pages(struct page *pg, int what) +static inline void __free_pages(struct page *pg, int what) { #ifdef MAP_ANONYMOUS munmap(pg->addr, PAGE_SIZE); -#else +#else free(pg->addr); #endif free(pg); @@ -254,18 +277,18 @@ static inline void __free_pages(struct page *pg, int what) #define do_div(a,b) (a)/(b) /* dentries / intents */ -struct lookup_intent { +struct lookup_intent { void *it_iattr; }; -struct iattr { +struct iattr { int mode; }; -struct dentry { +struct dentry { int d_count; }; -struct file { +struct file { struct dentry *f_dentry; void *private_data; } ; @@ -276,7 +299,7 @@ struct vfsmount { #define cpu_to_le32(x) ((__u32)(x)) /* semaphores */ -struct semaphore { +struct semaphore { int count; }; @@ -284,20 +307,20 @@ struct semaphore { #define up(a) do {(a)->count--;} while (0) #define sema_init(a,b) do { (a)->count = b; } while (0) -typedef struct { +typedef struct { struct list_head sleepers; } wait_queue_head_t; -typedef struct { +typedef struct { struct list_head sleeping; void *process; } wait_queue_t; -struct signal { +struct signal { int signal; }; -struct task_struct { +struct task_struct { int state; struct signal pending; char comm[32]; @@ -333,7 +356,7 @@ static inline int schedule_timeout(t) #define daemonize(l) do { int a; a++; } while (0) #define sigfillset(l) do { int a; a++; } while (0) #define recalc_sigpending(l) do { int a; a++; } while (0) -#define kernel_thread(l,m,n) +#define kernel_thread(l,m,n) static inline int call_usermodehelper(char *prog, char **argv, char **evnp) { @@ -342,11 +365,11 @@ static inline int call_usermodehelper(char *prog, char **argv, char **evnp) -#define KERN_INFO +#define KERN_INFO -struct timer_list { +struct timer_list { struct list_head tl_list; void (*function)(unsigned long unused); void *data; @@ -357,19 +380,19 @@ static inline int timer_pending(struct timer_list *l) { if (l->expires > jiffies) return 1; - else + else return 0; } static inline int init_timer(struct timer_list *l) { INIT_LIST_HEAD(&l->tl_list); + return 0; } static inline void mod_timer(struct timer_list *l, int thetime) { l->expires = thetime; - } static inline void del_timer(struct timer_list *l) -- 1.8.3.1