#error CHIP is not defined
#endif
+/* The UNUSED annotation tells the compiler or lint not to complain
+ * about an unused variable or function parameter.
+ *
+ * A number of different annotations are used, depending on the
+ * compiler or checker that is looking at the code.
+ *
+ * Note that some variants rename the parameter, so if you use
+ * the parameter after all, you'll get a complaint about a missing
+ * variable.
+ *
+ * You use it like this:
+ *
+ * void foo(int UNUSED(x)){}
+ */
+
+#ifndef UNUSED
+#if defined(__GNUC__)
+# define UNUSED(v) UNUSED_ ## v __attribute((unused))
+#elif defined _lint
+# define UNUSED(v) /*lint -e(715)*/ v
+#elif defined __LCLINT__
+# define UNUSED(v) /*@unused@*/ v
+#else
+# define UNUSED(v) _UNUSED_ ## v
+#endif
+#endif
+
#define EXTERN extern /* used in *.h files */
#define PRIVATE static /* PRIVATE x limits the scope of x */
#define PUBLIC /* PUBLIC is the opposite of PRIVATE */
#define DEFAULT_HZ 60 /* clock freq (software settable on IBM-PC) */
-#define SUPER_USER (uid_t) 0 /* uid_t of superuser */
+#define SUPER_USER ((uid_t) 0) /* uid_t of superuser */
#define NULL ((void *)0) /* null pointer */
#define SCPVEC_NR 64 /* max # of entries in a SYS_VSAFECOPY* request */
}
-PUBLIC void procexit (char *name)
+PUBLIC void procexit (char *UNUSED(name))
{
u64_t stop, spent;
/*===========================================================================*
* sef_cb_init_fresh_null *
*===========================================================================*/
-PUBLIC int sef_cb_init_fresh_null(int type, sef_init_info_t *info)
+PUBLIC int sef_cb_init_fresh_null(int UNUSED(type),
+ sef_init_info_t *UNUSED(info))
{
return(OK);
}
/*===========================================================================*
* sef_cb_init_lu_null *
*===========================================================================*/
-PUBLIC int sef_cb_init_lu_null(int type, sef_init_info_t *info)
+PUBLIC int sef_cb_init_lu_null(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
return(OK);
}
/*===========================================================================*
* sef_cb_init_restart_null *
*===========================================================================*/
-PUBLIC int sef_cb_init_restart_null(int type, sef_init_info_t *info)
+PUBLIC int sef_cb_init_restart_null(int UNUSED(type),
+ sef_init_info_t *UNUSED(info))
{
return(OK);
}
/*===========================================================================*
* sef_cb_init_restart_fail *
*===========================================================================*/
-PUBLIC int sef_cb_init_restart_fail(int type, sef_init_info_t *info)
+PUBLIC int sef_cb_init_restart_fail(int UNUSED(type),
+ sef_init_info_t *UNUSED(info))
{
return(ENOSYS);
}
/*===========================================================================*
* sef_cb_lu_prepare_null *
*===========================================================================*/
-PUBLIC void sef_cb_lu_prepare_null(int state)
+PUBLIC void sef_cb_lu_prepare_null(int UNUSED(state))
{
}
/*===========================================================================*
* sef_cb_lu_state_isvalid_null *
*===========================================================================*/
-PUBLIC int sef_cb_lu_state_isvalid_null(int state)
+PUBLIC int sef_cb_lu_state_isvalid_null(int UNUSED(state))
{
return FALSE;
}
/*===========================================================================*
* sef_cb_lu_state_changed_null *
*===========================================================================*/
-PUBLIC void sef_cb_lu_state_changed_null(int old_state, int state)
+PUBLIC void sef_cb_lu_state_changed_null(int UNUSED(old_state),
+ int UNUSED(state))
{
}
/*===========================================================================*
* sef_cb_lu_state_dump_null *
*===========================================================================*/
-PUBLIC void sef_cb_lu_state_dump_null(int state)
+PUBLIC void sef_cb_lu_state_dump_null(int UNUSED(state))
{
sef_lu_dprint("NULL\n");
}
/*===========================================================================*
* sef_cb_lu_ready_pre_null *
*===========================================================================*/
-PUBLIC int sef_cb_lu_ready_pre_null(int result)
+PUBLIC int sef_cb_lu_ready_pre_null(int UNUSED(result))
{
return(OK);
}
/*===========================================================================*
* sef_cb_lu_prepare_always_ready *
*===========================================================================*/
-PUBLIC void sef_cb_lu_prepare_always_ready(int state)
+PUBLIC void sef_cb_lu_prepare_always_ready(int UNUSED(state))
{
sef_lu_ready(OK);
}
/*===========================================================================*
* sef_cb_ping_reply_null *
*===========================================================================*/
-PUBLIC void sef_cb_ping_reply_null(message *m_ptr)
+PUBLIC void sef_cb_ping_reply_null(message *UNUSED(m_ptr))
{
}
/* Get HZ. */
if((r=sys_getinfo(GET_HZ, &Hz, sizeof(Hz), 0, 0)) != OK) {
Hz = DEFAULT_HZ;
- printf("sys_hz: %d: reverting to HZ = %d\n", r, Hz);
+ printf("sys_hz: can not get HZ: error %d.\nUsing default HZ = %u\n",
+ r, (unsigned int) Hz);
}
}
return ticks;
}
-