aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRyan S. Arnold <rsa@us.ibm.com>2004-08-22 22:35:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:35:31 -0700
commitc8c90ab10b92df384fcdcd52665ca1436057630d (patch)
treed84143b2936aa8b52211e741c52ee4a155e09f4b /include
parent0463210d76f4b58c6e40ff68b25ffd1bfe767e71 (diff)
downloadhistory-c8c90ab10b92df384fcdcd52665ca1436057630d.tar.gz
[PATCH] HVCS fixes
Here are a set of HVCS (drivers/char/hvcs.c) fixes that were suggested by Jeff Garzik on July 29th in his review of this driver as well as some other fixes for problems I found while reviewing the driver. These are all relatively minor, but necessary. - Cleaned up curly braces on single line conditional blocks. - Replaced debug memset(...,0x3F,...) with memset(...,0x00,...). - Removed explicit '= 0' after static int declarations since these default to zero. - Removed list_for_each_safe() instances and replaced with list_for_each_entry() which cut down on amt of code. The 'safe' version is un-needed now that the driver is using spinlocks. - Changed spin_lock_irqsave() to spin_lock() when locking hvcs_structs_lock and hvcs_pi_lock since these are not touched in an int handler. - changed spin_lock_irqsave() to spin_lock() in interrupt handler. - Initialized hvcs_structs_lock and hvcs_pi_lock to SPIN_LOCK_UNLOCKED at declaration tiem rather than in hvcs_module_init(). - Added spin_lock around list_del() in destroy_hvcs_struct() to protect the list traversal from deletion. The original omission was an oversight. - Removed '= NULL' from pointer declarations since they are initialized NULL by default. - Removed wmb() instance from hvcs_try_write(). They probably aren't needed with locking in place. - Added check and cleanup for hvcs_pi_buff = kmalloc() in hvcs_module_init(). - Exposed hvcs_struct.index via a sysfs attribute so that the coupling between /dev/hvcs* and a vty-server can be systematically determined. - Moved kobject_put() in hvcs_open() outside of the spin_unlock_irqrestore(). - In hvcs_probe() changed kmalloc(sizeof(*hvcsd),...) to kmalloc(sizeof(struct hvcs_struct)) because hvcsd references a NULL pointer at the time of kmalloc. - Incremented the HVCS_DRIVER_VERSION to 1.3.1 arch/ppc64/kernel/hvcserver.c: - Changed function documentation of EXPORTed functions to comply with proper kernel-doc documentation style. - Changed 'unsigned int' types to 'uint32_t' to comply with how unit addresses and partition IDs are handled in other arch/ppc64 vterm code. - Cleaned up curly braces on single line conditional blocks. include/asm-ppc64/hvcserver.h: - Added kernel-doc style documentation for hvcs_partner_info struct. - changed 'unsigned int' types to 'uint32_t' to comply with how unit addresses and partition IDs are handled in other arch/ppc64 vterm code. Signed-off-by: Ryan S. Arnold <rsa@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc64/hvcserver.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/asm-ppc64/hvcserver.h b/include/asm-ppc64/hvcserver.h
index cee9a14a295430..aecba966579690 100644
--- a/include/asm-ppc64/hvcserver.h
+++ b/include/asm-ppc64/hvcserver.h
@@ -27,18 +27,31 @@
/* Converged Location Code length */
#define HVCS_CLC_LENGTH 79
+/**
+ * hvcs_partner_info - an element in a list of partner info
+ * @node: list_head denoting this partner_info struct's position in the list of
+ * partner info.
+ * @unit_address: The partner unit address of this entry.
+ * @partition_ID: The partner partition ID of this entry.
+ * @location_code: The converged location code of this entry + 1 char for the
+ * null-term.
+ *
+ * This structure outlines the format that partner info is presented to a caller
+ * of the hvcs partner info fetching functions. These are strung together into
+ * a list using linux kernel lists.
+ */
struct hvcs_partner_info {
struct list_head node;
- unsigned int unit_address;
- unsigned int partition_ID;
+ uint32_t unit_address;
+ uint32_t partition_ID;
char location_code[HVCS_CLC_LENGTH + 1]; /* CLC + 1 null-term char */
};
extern int hvcs_free_partner_info(struct list_head *head);
-extern int hvcs_get_partner_info(unsigned int unit_address,
+extern int hvcs_get_partner_info(uint32_t unit_address,
struct list_head *head, unsigned long *pi_buff);
-extern int hvcs_register_connection(unsigned int unit_address,
- unsigned int p_partition_ID, unsigned int p_unit_address);
-extern int hvcs_free_connection(unsigned int unit_address);
+extern int hvcs_register_connection(uint32_t unit_address,
+ uint32_t p_partition_ID, uint32_t p_unit_address);
+extern int hvcs_free_connection(uint32_t unit_address);
#endif /* _PPC64_HVCSERVER_H */