[PATCH] staging: lustre: Remove typedef and update cfs_hash_bucket struct

2013-10-21 Thread Lisa Nguyen
Remove typedef keyword and rename the cfs_hash_bucket_t struct to
cfs_hash_bucket in libcfs_hash.h. These changes resolve the
Do not add new typedefs warning generated by checkpatch.pl and
meet kernel coding style.

The struct variables in hash.c are updated to reflect this change
as well.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../lustre/include/linux/libcfs/libcfs_hash.h  | 12 ++--
 drivers/staging/lustre/lustre/libcfs/hash.c| 22 +++---
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index b06505d..26c10d9 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -97,20 +97,20 @@ union cfs_hash_lock {
  *   which depends on requirement of user
  * - some extra bytes (caller can require it while creating hash)
  */
-typedef struct cfs_hash_bucket {
+struct cfs_hash_bucket {
union cfs_hash_lock hsb_lock;   /** bucket lock */
__u32   hsb_count;  /** current entries */
__u32   hsb_version;/** change version */
unsigned inthsb_index;  /** index of bucket */
int hsb_depmax; /** max depth on bucket */
longhsb_head[0];/** hash-head array */
-} cfs_hash_bucket_t;
+};
 
 /**
  * cfs_hash bucket descriptor, it's normally in stack of caller
  */
 typedef struct cfs_hash_bd {
-   cfs_hash_bucket_t *bd_bucket;  /** address of bucket */
+   struct cfs_hash_bucket  *bd_bucket;  /** address of bucket */
unsigned intbd_offset;  /** offset in bucket */
 } cfs_hash_bd_t;
 
@@ -221,7 +221,7 @@ typedef struct cfs_hash {
/** hash list operations */
struct cfs_hash_hlist_ops  *hs_hops;
/** hash buckets-table */
-   cfs_hash_bucket_t**hs_buckets;
+   struct cfs_hash_bucket   **hs_buckets;
/** total number of items on this hash-table */
atomic_ths_count;
/** hash flags, see cfs_hash_tag for detail */
@@ -255,7 +255,7 @@ typedef struct cfs_hash {
/** refcount on this hash table */
atomic_ths_refcount;
/** rehash buckets-table */
-   cfs_hash_bucket_t**hs_rehash_buckets;
+   struct cfs_hash_bucket   **hs_rehash_buckets;
 #if CFS_HASH_DEBUG_LEVEL = CFS_HASH_DEBUG_1
/** serialize debug members */
spinlock_t  hs_dep_lock;
@@ -451,7 +451,7 @@ cfs_hash_is_iterating(cfs_hash_t *hs)
 static inline int
 cfs_hash_bkt_size(cfs_hash_t *hs)
 {
-   return offsetof(cfs_hash_bucket_t, hsb_head[0]) +
+   return offsetof(struct cfs_hash_bucket, hsb_head[0]) +
   hs-hs_hops-hop_hhead_size(hs) * CFS_HASH_BKT_NHLIST(hs) +
   hs-hs_extra_bytes;
 }
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c 
b/drivers/staging/lustre/lustre/libcfs/hash.c
index b0b8e3f..c3cb1c0 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -469,7 +469,7 @@ cfs_hash_hlist_setup(cfs_hash_t *hs)
 }
 
 static void
-cfs_hash_bd_from_key(cfs_hash_t *hs, cfs_hash_bucket_t **bkts,
+cfs_hash_bd_from_key(cfs_hash_t *hs, struct cfs_hash_bucket **bkts,
 unsigned int bits, const void *key, cfs_hash_bd_t *bd)
 {
unsigned int index = cfs_hash_id(hs, key, (1U  bits) - 1);
@@ -563,8 +563,8 @@ void
 cfs_hash_bd_move_locked(cfs_hash_t *hs, cfs_hash_bd_t *bd_old,
cfs_hash_bd_t *bd_new, struct hlist_node *hnode)
 {
-   cfs_hash_bucket_t *obkt = bd_old-bd_bucket;
-   cfs_hash_bucket_t *nbkt = bd_new-bd_bucket;
+   struct cfs_hash_bucket *obkt = bd_old-bd_bucket;
+   struct cfs_hash_bucket *nbkt = bd_new-bd_bucket;
int rc;
 
if (cfs_hash_bd_compare(bd_old, bd_new) == 0)
@@ -698,7 +698,7 @@ static void
 cfs_hash_multi_bd_lock(cfs_hash_t *hs, cfs_hash_bd_t *bds,
   unsigned n, int excl)
 {
-   cfs_hash_bucket_t *prev = NULL;
+   struct cfs_hash_bucket *prev = NULL;
int i;
 
/**
@@ -721,7 +721,7 @@ static void
 cfs_hash_multi_bd_unlock(cfs_hash_t *hs, cfs_hash_bd_t *bds,
 unsigned n, int excl)
 {
-   cfs_hash_bucket_t *prev = NULL;
+   struct cfs_hash_bucket *prev = NULL;
int i;
 
cfs_hash_for_each_bd(bds, n, i) {
@@ -884,7 +884,7 @@ cfs_hash_dual_bd_finddel_locked(cfs_hash_t *hs, 
cfs_hash_bd_t *bds,
 EXPORT_SYMBOL(cfs_hash_dual_bd_finddel_locked);
 
 static void
-cfs_hash_buckets_free(cfs_hash_bucket_t **buckets,
+cfs_hash_buckets_free(struct cfs_hash_bucket **buckets,
  int bkt_size, int prev_size, int size)
 {
int i;
@@ 

[PATCH] drivers: staging: bcm: removed a developer debug message per the TODO list.

2013-10-21 Thread Chuong Ngo
Removed a debug message as outlined in the TODO list.
---
 drivers/staging/bcm/Bcmchar.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c
index f91bc1f..526594b 100644
--- a/drivers/staging/bcm/Bcmchar.c
+++ b/drivers/staging/bcm/Bcmchar.c
@@ -50,8 +50,6 @@ static int bcm_char_release(struct inode *inode, struct file 
*filp)
pTarang = (struct bcm_tarang_data *)filp-private_data;
 
if (pTarang == NULL) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
-   ptarang is null\n);
return 0;
}
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Staging: zram: Fix variable dereferenced before check

2013-10-21 Thread Minchan Kim
On Sat, Oct 19, 2013 at 01:59:05PM -0700, Greg KH wrote:
 On Sat, Oct 19, 2013 at 10:01:42PM +0530, Rashika Kheria wrote:
  This patch fixes the following Smatch warning in zram_drv.c-
  ~/git/kernels/linux/drivers/staging/zram/zram_drv.c:663
  reset_store() warn: variable dereferenced before check 'bdev' (see line 652)
  ~/git/kernels/linux/drivers/staging/zram/zram_drv.c:899
  destroy_device() warn: variable dereferenced before check 'zram-disk' (see 
  line 896)
  
  Signed-off-by: Rashika Kheria rashika.khe...@gmail.com
 
 zram is messy, tricky, and I hate it.  Seriously, I which I had never
 taken it into the staging tree...
 
 Anyway, I want the existing zram developers/maintainers to review this
 patch before I can accept it, as I don't trust anything that is ever
 done in that code, especially as I don't test it :)
 
 Minchan, Jiang, Nitin, what do you think of the patch below?  Can I get
 your ack on it so that I can apply it?

Hello Greg,

I will review he send v3 again if anybody doesn't review it.
Hope that Jerome or someone could review because I'm in LinuxCon now and
totally fail to adjust time zone.
So, Please understand late reply.

Thanks.

 
 thanks,
 
 greg k-h
 
  ---
  
  This revision fixes the following issues of the previous revision-
  Incorrect Correction of Sparse Warning
  
   drivers/staging/zram/zram_drv.c |8 +++-
   1 file changed, 3 insertions(+), 5 deletions(-)
  
  diff --git a/drivers/staging/zram/zram_drv.c 
  b/drivers/staging/zram/zram_drv.c
  index 2c4ed52..a74108a 100644
  --- a/drivers/staging/zram/zram_drv.c
  +++ b/drivers/staging/zram/zram_drv.c
  @@ -660,8 +660,7 @@ static ssize_t reset_store(struct device *dev,
  return -EINVAL;
   
  /* Make sure all pending I/O is finished */
  -   if (bdev)
  -   fsync_bdev(bdev);
  +   fsync_bdev(bdev);
   
  zram_reset_device(zram, true);
  return len;
  @@ -893,10 +892,9 @@ out:
   
   static void destroy_device(struct zram *zram)
   {
  -   sysfs_remove_group(disk_to_dev(zram-disk)-kobj,
  -   zram_disk_attr_group);
  -
  if (zram-disk) {
  +   sysfs_remove_group(disk_to_dev(zram-disk)-kobj,
  +   zram_disk_attr_group);
  del_gendisk(zram-disk);
  put_disk(zram-disk);
  }
  -- 
  1.7.9.5
  
  -- 
  You received this message because you are subscribed to the Google Groups 
  opw-kernel group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to opw-kernel+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

-- 
Kind regards,
Minchan Kim
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 08/11] staging: comedi: s626: make CRA and CRB setup conversions more readable

2013-10-21 Thread Ian Abbott
Use the new macros defined in s626.h for constructing and decomposing
'CRA', 'CRB' and standardized encoder setup values to make the
conversions between standardized encoder setup values, and CRA/CRB
register values easier to follow.

There is some messing about with the 'IndxSrc' values which are 1-bit
wide in the standardized encoder setup, and 2-bit wide in the 'CRA' and
'CRB' register values.  This will be addressed by a later patch.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com
---
v2: fix possibly uninitialized `clkpol` in `s626_get_mode_b()` (spotted
by Hartley Sweeten).
Note: patches 01 to 07/11 already applied.
---
 drivers/staging/comedi/drivers/s626.c | 317 --
 1 file changed, 151 insertions(+), 166 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c 
b/drivers/staging/comedi/drivers/s626.c
index 92062ed..3fd5447 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -656,7 +656,7 @@ static void s626_set_latch_source(struct comedi_device *dev,
 {
s626_debi_replace(dev, k-my_crb,
  ~(S626_CRBMSK_INTCTRL | S626_CRBMSK_LATCHSRC),
- value  S626_CRBBIT_LATCHSRC);
+ S626_SET_CRB_LATCHSRC(value));
 }
 
 /*
@@ -678,14 +678,16 @@ static void s626_reset_cap_flags_a(struct comedi_device 
*dev,
   const struct s626_enc_info *k)
 {
s626_debi_replace(dev, k-my_crb, ~S626_CRBMSK_INTCTRL,
- S626_CRBMSK_INTRESETCMD | S626_CRBMSK_INTRESET_A);
+ (S626_SET_CRB_INTRESETCMD(1) |
+  S626_SET_CRB_INTRESET_A(1)));
 }
 
 static void s626_reset_cap_flags_b(struct comedi_device *dev,
   const struct s626_enc_info *k)
 {
s626_debi_replace(dev, k-my_crb, ~S626_CRBMSK_INTCTRL,
- S626_CRBMSK_INTRESETCMD | S626_CRBMSK_INTRESET_B);
+ (S626_SET_CRB_INTRESETCMD(1) |
+  S626_SET_CRB_INTRESET_B(1)));
 }
 
 /*
@@ -698,6 +700,7 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev,
uint16_t cra;
uint16_t crb;
uint16_t setup;
+   unsigned cntsrc, clkmult, clkpol, encmode;
 
/* Fetch CRA and CRB register images. */
cra = s626_debi_read(dev, k-my_cra);
@@ -707,44 +710,41 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev,
 * Populate the standardized counter setup bit fields.
 * Note: IndexSrc is restricted to ENC_X or IndxPol.
 */
-   setup = (cra  S626_STDMSK_LOADSRC) |   /* LoadSrc  = LoadSrcA. */
-   ((crb  (S626_STDBIT_LATCHSRC - S626_CRBBIT_LATCHSRC)) 
-S626_STDMSK_LATCHSRC) |/* LatchSrc = LatchSrcA. */
-   ((cra  (S626_STDBIT_INTSRC - S626_CRABIT_INTSRC_A)) 
-S626_STDMSK_INTSRC) |  /* IntSrc   = IntSrcA. */
-   ((cra  (S626_STDBIT_INDXSRC - (S626_CRABIT_INDXSRC_A + 1))) 
-S626_STDMSK_INDXSRC) | /* IndxSrc  = IndxSrcA1. */
-   ((cra  (S626_CRABIT_INDXPOL_A - S626_STDBIT_INDXPOL)) 
-S626_STDMSK_INDXPOL) | /* IndxPol  = IndxPolA. */
-   ((crb  (S626_CRBBIT_CLKENAB_A - S626_STDBIT_CLKENAB)) 
-S626_STDMSK_CLKENAB);  /* ClkEnab  = ClkEnabA. */
+   setup =
+   /* LoadSrc  = LoadSrcA. */
+   S626_SET_STD_LOADSRC(S626_GET_CRA_LOADSRC_A(cra)) |
+   /* LatchSrc = LatchSrcA. */
+   S626_SET_STD_LATCHSRC(S626_GET_CRB_LATCHSRC(crb)) |
+   /* IntSrc   = IntSrcA. */
+   S626_SET_STD_INTSRC(S626_GET_CRA_INTSRC_A(cra)) |
+   /* IndxSrc  = IndxSrcA1. */
+   S626_SET_STD_INDXSRC(S626_GET_CRA_INDXSRC_A(cra)  1) |
+   /* IndxPol  = IndxPolA. */
+   S626_SET_STD_INDXPOL(S626_GET_CRA_INDXPOL_A(cra)) |
+   /* ClkEnab  = ClkEnabA. */
+   S626_SET_STD_CLKENAB(S626_GET_CRB_CLKENAB_A(crb));
 
/* Adjust mode-dependent parameters. */
-   if (cra  (S626_CNTSRC_SYSCLK  S626_CRABIT_CNTSRC_A)) {
+   cntsrc = S626_GET_CRA_CNTSRC_A(cra);
+   if (cntsrc  S626_CNTSRC_SYSCLK) {
/* Timer mode (CntSrcA1 == 1): */
-   /* Indicate Timer mode. */
-   setup |= S626_ENCMODE_TIMER  S626_STDBIT_ENCMODE;
+   encmode = S626_ENCMODE_TIMER;
/* Set ClkPol to indicate count direction (CntSrcA0). */
-   setup |= (cra  (S626_STDBIT_CLKPOL - S626_CRABIT_CNTSRC_A)) 
-S626_STDMSK_CLKPOL;
+   clkpol = cntsrc  1;
/* ClkMult must be 1x in Timer mode. */
-   setup |= S626_MULT_X1  S626_STDBIT_CLKMULT;
+   clkmult = S626_MULT_X1;
} else {
/* 

[PATCH v2 11/11] staging: comedi: s626: replace S626_MULT_X? values

2013-10-21 Thread Ian Abbott
Replace the use of the `S626_MULT_X1`, `S626_MULT_X2` and `S626_MULT_X4`
clock multiplier values with the equivalent `S626_CLKMULT_1X`,
`S626_CLKMULT_2X` and `S626_CLKMULT_4X` values to avoid duplication.
Replace the use of `S626_MULT_X0` with a new macro
`S626_CLKMULT_SPECIAL` (this is treated specially by the
'ClkMultA'/'ClkMultB' field of the 'CRA'/'CRB' register).  Remove the
now unused `S626_MULT_X?` macros.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com
---
v2: rebase, resend
---
 drivers/staging/comedi/drivers/s626.c | 28 ++--
 drivers/staging/comedi/drivers/s626.h | 12 +---
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c 
b/drivers/staging/comedi/drivers/s626.c
index c2837da..6815cfe 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -731,7 +731,7 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev,
/* Set ClkPol to indicate count direction (CntSrcA0). */
clkpol = cntsrc  1;
/* ClkMult must be 1x in Timer mode. */
-   clkmult = S626_MULT_X1;
+   clkmult = S626_CLKMULT_1X;
} else {
/* Counter mode (CntSrcA1 == 0): */
encmode = S626_ENCMODE_COUNTER;
@@ -739,8 +739,8 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev,
clkpol = S626_GET_CRA_CLKPOL_A(cra);
/* Force ClkMult to 1x if not legal, else pass through. */
clkmult = S626_GET_CRA_CLKMULT_A(cra);
-   if (clkmult == S626_MULT_X0)
-   clkmult = S626_MULT_X1;
+   if (clkmult == S626_CLKMULT_SPECIAL)
+   clkmult = S626_CLKMULT_1X;
}
setup |= S626_SET_STD_ENCMODE(encmode) | S626_SET_STD_CLKMULT(clkmult) |
 S626_SET_STD_CLKPOL(clkpol);
@@ -781,18 +781,18 @@ static uint16_t s626_get_mode_b(struct comedi_device *dev,
/* Adjust mode-dependent parameters. */
cntsrc = S626_GET_CRA_CNTSRC_B(cra);
clkmult = S626_GET_CRB_CLKMULT_B(crb);
-   if (clkmult == S626_MULT_X0) {
-   /* Extender mode (ClkMultB == S626_MULT_X0): */
+   if (clkmult == S626_CLKMULT_SPECIAL) {
+   /* Extender mode (ClkMultB == S626_CLKMULT_SPECIAL): */
encmode = S626_ENCMODE_EXTENDER;
/* Indicate multiplier is 1x. */
-   clkmult = S626_MULT_X1;
+   clkmult = S626_CLKMULT_1X;
/* Set ClkPol equal to Timer count direction (CntSrcB0). */
clkpol = cntsrc  1;
} else if (cntsrc  S626_CNTSRC_SYSCLK) {
/* Timer mode (CntSrcB1 == 1): */
encmode = S626_ENCMODE_TIMER;
/* Indicate multiplier is 1x. */
-   clkmult = S626_MULT_X1;
+   clkmult = S626_CLKMULT_1X;
/* Set ClkPol equal to Timer count direction (CntSrcB0). */
clkpol = cntsrc  1;
} else {
@@ -853,7 +853,7 @@ static void s626_set_mode_a(struct comedi_device *dev,
/* ClkPolA behaves as always-on clock enable. */
clkpol = 1;
/* ClkMult must be 1x. */
-   clkmult = S626_MULT_X1;
+   clkmult = S626_CLKMULT_1X;
break;
default:/* Counter Mode: */
/* Select ENC_C and ENC_D as clock/direction inputs. */
@@ -861,8 +861,8 @@ static void s626_set_mode_a(struct comedi_device *dev,
/* Clock polarity is passed through. */
/* Force multiplier to x1 if not legal, else pass through. */
clkmult = S626_GET_STD_CLKMULT(setup);
-   if (clkmult == S626_MULT_X0)
-   clkmult = S626_MULT_X1;
+   if (clkmult == S626_CLKMULT_SPECIAL)
+   clkmult = S626_CLKMULT_1X;
break;
}
cra |= S626_SET_CRA_CNTSRC_A(cntsrc) | S626_SET_CRA_CLKPOL_A(clkpol) |
@@ -927,7 +927,7 @@ static void s626_set_mode_b(struct comedi_device *dev,
/* ClkPolB behaves as always-on clock enable. */
clkpol = 1;
/* ClkMultB must be 1x. */
-   clkmult = S626_MULT_X1;
+   clkmult = S626_CLKMULT_1X;
break;
case S626_ENCMODE_EXTENDER: /* Extender Mode: */
/* CntSrcB source is OverflowA (same as timer) */
@@ -937,7 +937,7 @@ static void s626_set_mode_b(struct comedi_device *dev,
/* ClkPolB controls IndexB -- always set to active. */
clkpol = 1;
/* ClkMultB selects OverflowA as the clock source. */
-   clkmult = S626_MULT_X0;
+   clkmult = S626_CLKMULT_SPECIAL;
break;
default:/* Counter Mode: */
   

[PATCH v3] Staging: zram: Fix variable dereferenced before check

2013-10-21 Thread Rashika Kheria
This patch fixes the following Smatch warning in zram_drv.c-
drivers/staging/zram/zram_drv.c:663
reset_store() warn: variable dereferenced before check 'bdev' (see line 652)
drivers/staging/zram/zram_drv.c:899
destroy_device() warn: variable dereferenced before check 'zram-disk' (see 
line 896)

Signed-off-by: Rashika Kheria rashika.khe...@gmail.com
---

This revision fixes the following issues of the previous revision-
Not included null check

 drivers/staging/zram/zram_drv.c |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 2c4ed52..5594d5b 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -648,6 +648,9 @@ static ssize_t reset_store(struct device *dev,
zram = dev_to_zram(dev);
bdev = bdget_disk(zram-disk, 0);
 
+   if (!bdev)
+   return -EBUSY;
+
/* Do not reset an active device! */
if (bdev-bd_holders)
return -EBUSY;
@@ -660,8 +663,7 @@ static ssize_t reset_store(struct device *dev,
return -EINVAL;
 
/* Make sure all pending I/O is finished */
-   if (bdev)
-   fsync_bdev(bdev);
+   fsync_bdev(bdev);
 
zram_reset_device(zram, true);
return len;
@@ -893,10 +895,9 @@ out:
 
 static void destroy_device(struct zram *zram)
 {
-   sysfs_remove_group(disk_to_dev(zram-disk)-kobj,
-   zram_disk_attr_group);
-
if (zram-disk) {
+   sysfs_remove_group(disk_to_dev(zram-disk)-kobj,
+   zram_disk_attr_group);
del_gendisk(zram-disk);
put_disk(zram-disk);
}
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: lustre: Remove typedef and update cfs_hash_bd struct

2013-10-21 Thread Lisa Nguyen
Remove typedef keyword and rename the cfs_hash_bd_t struct to
cfs_hash_bd in libcfs_hash.h. These changes resolve the
Do not add new typedefs warning generated by checkpatch.pl
and meet kernel coding style.

Struct variables in other header and source files that depend
on libcfs_hash.h are updated as well.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../lustre/include/linux/libcfs/libcfs_hash.h  |  76 +++---
 drivers/staging/lustre/lustre/include/lu_object.h  |   2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |   4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  18 ++--
 drivers/staging/lustre/lustre/libcfs/hash.c| 114 ++---
 drivers/staging/lustre/lustre/llite/vvp_dev.c  |   2 +-
 .../lustre/lustre/obdclass/lprocfs_status.c|   4 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  24 ++---
 9 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 26c10d9..61e4fca 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -109,10 +109,10 @@ struct cfs_hash_bucket {
 /**
  * cfs_hash bucket descriptor, it's normally in stack of caller
  */
-typedef struct cfs_hash_bd {
+struct cfs_hash_bd {
struct cfs_hash_bucket  *bd_bucket;  /** address of bucket */
unsigned intbd_offset;  /** offset in bucket */
-} cfs_hash_bd_t;
+};
 
 #define CFS_HASH_NAME_LEN 16  /** default name length */
 #define CFS_HASH_BIGNAME_LEN   64  /** bigname for param tree */
@@ -287,15 +287,15 @@ typedef struct cfs_hash_lock_ops {
 
 typedef struct cfs_hash_hlist_ops {
/** return hlist_head of hash-head of @bd */
-   struct hlist_head *(*hop_hhead)(cfs_hash_t *hs, cfs_hash_bd_t *bd);
+   struct hlist_head *(*hop_hhead)(cfs_hash_t *hs, struct cfs_hash_bd *bd);
/** return hash-head size */
int (*hop_hhead_size)(cfs_hash_t *hs);
/** add @hnode to hash-head of @bd */
int (*hop_hnode_add)(cfs_hash_t *hs,
-cfs_hash_bd_t *bd, struct hlist_node *hnode);
+struct cfs_hash_bd *bd, struct hlist_node *hnode);
/** remove @hnode from hash-head of @bd */
int (*hop_hnode_del)(cfs_hash_t *hs,
-cfs_hash_bd_t *bd, struct hlist_node *hnode);
+struct cfs_hash_bd *bd, struct hlist_node *hnode);
 } cfs_hash_hlist_ops_t;
 
 typedef struct cfs_hash_ops {
@@ -539,13 +539,13 @@ static inline int cfs_hash_dec_and_lock(cfs_hash_t *hs,
 }
 
 static inline void cfs_hash_bd_lock(cfs_hash_t *hs,
-   cfs_hash_bd_t *bd, int excl)
+   struct cfs_hash_bd *bd, int excl)
 {
hs-hs_lops-hs_bkt_lock(bd-bd_bucket-hsb_lock, excl);
 }
 
 static inline void cfs_hash_bd_unlock(cfs_hash_t *hs,
- cfs_hash_bd_t *bd, int excl)
+ struct cfs_hash_bd *bd, int excl)
 {
hs-hs_lops-hs_bkt_unlock(bd-bd_bucket-hsb_lock, excl);
 }
@@ -554,56 +554,56 @@ static inline void cfs_hash_bd_unlock(cfs_hash_t *hs,
  * operations on cfs_hash bucket (bd: bucket descriptor),
  * they are normally for hash-table without rehash
  */
-void cfs_hash_bd_get(cfs_hash_t *hs, const void *key, cfs_hash_bd_t *bd);
+void cfs_hash_bd_get(cfs_hash_t *hs, const void *key, struct cfs_hash_bd *bd);
 
 static inline void cfs_hash_bd_get_and_lock(cfs_hash_t *hs, const void *key,
-   cfs_hash_bd_t *bd, int excl)
+   struct cfs_hash_bd *bd, int excl)
 {
cfs_hash_bd_get(hs, key, bd);
cfs_hash_bd_lock(hs, bd, excl);
 }
 
-static inline unsigned cfs_hash_bd_index_get(cfs_hash_t *hs, cfs_hash_bd_t *bd)
+static inline unsigned cfs_hash_bd_index_get(cfs_hash_t *hs, struct 
cfs_hash_bd *bd)
 {
return bd-bd_offset | (bd-bd_bucket-hsb_index  hs-hs_bkt_bits);
 }
 
 static inline void cfs_hash_bd_index_set(cfs_hash_t *hs,
-unsigned index, cfs_hash_bd_t *bd)
+unsigned index, struct cfs_hash_bd *bd)
 {
bd-bd_bucket = hs-hs_buckets[index  hs-hs_bkt_bits];
bd-bd_offset = index  (CFS_HASH_BKT_NHLIST(hs) - 1U);
 }
 
 static inline void *
-cfs_hash_bd_extra_get(cfs_hash_t *hs, cfs_hash_bd_t *bd)
+cfs_hash_bd_extra_get(cfs_hash_t *hs, struct cfs_hash_bd *bd)
 {
return (void *)bd-bd_bucket +
   cfs_hash_bkt_size(hs) - hs-hs_extra_bytes;
 }
 
 static inline __u32
-cfs_hash_bd_version_get(cfs_hash_bd_t *bd)
+cfs_hash_bd_version_get(struct cfs_hash_bd *bd)
 {
/* need hold cfs_hash_bd_lock */

[PATCH 1/3] staging: lustre: Remove typedef and update cfs_debug_limit_state struct

2013-10-21 Thread Lisa Nguyen
Removed typedef keyword and rename the cfs_debug_limit_state_t
struct to cfs_debug_limit_state in libcfs_debug.h. These changes
resolve the Do not add new typedefs warning generated by
checkpatch.pl and meet kernel coding style.

Struct variables in other header and source files
that depend on libcfs_debug.h are updated as well.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h | 8 
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h | 2 +-
 drivers/staging/lustre/lustre/libcfs/tracefile.c   | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index e6439d1..40282b7 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -165,11 +165,11 @@ struct ptldebug_header {
 #define CDEBUG_DEFAULT_MAX_DELAY (cfs_time_seconds(600))/* jiffies */
 #define CDEBUG_DEFAULT_MIN_DELAY ((cfs_time_seconds(1) + 1) / 2) /* jiffies */
 #define CDEBUG_DEFAULT_BACKOFF   2
-typedef struct {
+struct cfs_debug_limit_state {
cfs_time_t  cdls_next;
unsigned intcdls_delay;
int  cdls_count;
-} cfs_debug_limit_state_t;
+};
 
 struct libcfs_debug_msg_data {
const char *msg_file;
@@ -177,7 +177,7 @@ struct libcfs_debug_msg_data {
int   msg_subsys;
int   msg_line;
int   msg_mask;
-   cfs_debug_limit_state_t  *msg_cdls;
+   struct cfs_debug_limit_state  *msg_cdls;
 };
 
 #define LIBCFS_DEBUG_MSG_DATA_INIT(data, mask, cdls)   \
@@ -226,7 +226,7 @@ do {
\
 
 #define CDEBUG_LIMIT(mask, format, ...) \
 do {   \
-   static cfs_debug_limit_state_t cdls;\
+   static struct cfs_debug_limit_state cdls;\
\
__CDEBUG(cdls, mask, format, ## __VA_ARGS__);\
 } while (0)
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 7020d9c..122441f 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -1083,7 +1083,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
  * Rate-limited version of lock printing function.
  */
 #define LDLM_DEBUG_LIMIT(mask, lock, fmt, a...) do {\
-   static cfs_debug_limit_state_t _ldlm_cdls; \
+   static struct cfs_debug_limit_state _ldlm_cdls;\
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, _ldlm_cdls);   \
ldlm_lock_debug(msgdata, mask, _ldlm_cdls, lock, ###  fmt , ##a);\
 } while (0)
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index e947002..cf2b90d 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -2206,7 +2206,7 @@ do {  
  \
 #define DEBUG_REQ(level, req, fmt, args...)   \
 do { \
if ((level)  (D_ERROR | D_WARNING)) {  \
-   static cfs_debug_limit_state_t cdls;  \
+   static struct cfs_debug_limit_state cdls;   
  \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, cdls);  \
debug_req(msgdata, level, cdls, req, @@@ fmt , ## args);\
} else {  \
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c 
b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index 357f400..f71a3cc 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -276,7 +276,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data 
*msgdata,
int remain;
int mask = msgdata-msg_mask;
const char  *file = kbasename(msgdata-msg_file);
-   cfs_debug_limit_state_t   *cdls = msgdata-msg_cdls;
+   struct cfs_debug_limit_state   *cdls = msgdata-msg_cdls;
 
tcd = cfs_trace_get_tcd();
 
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: lustre: lnet: Remove unnecessary spaces in lib-lnet.h

2013-10-21 Thread Lisa Nguyen
Remove spaces between function names and open parentheses to
meet kernel coding style and eliminate extra space warnings
generated by checkpatch.pl

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../staging/lustre/include/linux/lnet/lib-lnet.h   | 78 +++---
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 59bff0b..8869f10 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -79,20 +79,20 @@ extern lnet_t  the_lnet;/* THE network 
*/
 /** exclusive lock */
 #define LNET_LOCK_EX   CFS_PERCPT_LOCK_EX
 
-static inline int lnet_is_wire_handle_none (lnet_handle_wire_t *wh)
+static inline int lnet_is_wire_handle_none(lnet_handle_wire_t *wh)
 {
return (wh-wh_interface_cookie == LNET_WIRE_HANDLE_COOKIE_NONE 
wh-wh_object_cookie == LNET_WIRE_HANDLE_COOKIE_NONE);
 }
 
-static inline int lnet_md_exhausted (lnet_libmd_t *md)
+static inline int lnet_md_exhausted(lnet_libmd_t *md)
 {
return (md-md_threshold == 0 ||
((md-md_options  LNET_MD_MAX_SIZE) != 0 
 md-md_offset + md-md_max_size  md-md_length));
 }
 
-static inline int lnet_md_unlinkable (lnet_libmd_t *md)
+static inline int lnet_md_unlinkable(lnet_libmd_t *md)
 {
/* Should unlink md when its refcount is 0 and either:
 *  - md has been flagged for deletion (by auto unlink or 
LNetM[DE]Unlink,
@@ -193,31 +193,31 @@ int lnet_freelist_init(lnet_freelist_t *fl, int n, int 
size);
 void lnet_freelist_fini(lnet_freelist_t *fl);
 
 static inline void *
-lnet_freelist_alloc (lnet_freelist_t *fl)
+lnet_freelist_alloc(lnet_freelist_t *fl)
 {
/* ALWAYS called with liblock held */
lnet_freeobj_t *o;
 
-   if (list_empty (fl-fl_list))
+   if (list_empty(fl-fl_list))
return (NULL);
 
-   o = list_entry (fl-fl_list.next, lnet_freeobj_t, fo_list);
-   list_del (o-fo_list);
+   o = list_entry(fl-fl_list.next, lnet_freeobj_t, fo_list);
+   list_del(o-fo_list);
return ((void *)o-fo_contents);
 }
 
 static inline void
-lnet_freelist_free (lnet_freelist_t *fl, void *obj)
+lnet_freelist_free(lnet_freelist_t *fl, void *obj)
 {
/* ALWAYS called with liblock held */
-   lnet_freeobj_t *o = list_entry (obj, lnet_freeobj_t, fo_contents);
+   lnet_freeobj_t *o = list_entry(obj, lnet_freeobj_t, fo_contents);
 
-   list_add (o-fo_list, fl-fl_list);
+   list_add(o-fo_list, fl-fl_list);
 }
 
 
 static inline lnet_eq_t *
-lnet_eq_alloc (void)
+lnet_eq_alloc(void)
 {
/* NEVER called with resource lock held */
struct lnet_res_container *rec = the_lnet.ln_eq_container;
@@ -251,7 +251,7 @@ lnet_eq_free(lnet_eq_t *eq)
 }
 
 static inline lnet_libmd_t *
-lnet_md_alloc (lnet_md_t *umd)
+lnet_md_alloc(lnet_md_t *umd)
 {
/* NEVER called with resource lock held */
struct lnet_res_container *rec = the_lnet.ln_md_containers[0];
@@ -322,7 +322,7 @@ lnet_me_free(lnet_me_t *me)
 }
 
 static inline lnet_msg_t *
-lnet_msg_alloc (void)
+lnet_msg_alloc(void)
 {
/* NEVER called with network lock held */
struct lnet_msg_container *msc = the_lnet.ln_msg_containers[0];
@@ -353,7 +353,7 @@ lnet_msg_free_locked(lnet_msg_t *msg)
 }
 
 static inline void
-lnet_msg_free (lnet_msg_t *msg)
+lnet_msg_free(lnet_msg_t *msg)
 {
lnet_net_lock(0);
lnet_msg_free_locked(msg);
@@ -363,7 +363,7 @@ lnet_msg_free (lnet_msg_t *msg)
 #else /* !LNET_USE_LIB_FREELIST */
 
 static inline lnet_eq_t *
-lnet_eq_alloc (void)
+lnet_eq_alloc(void)
 {
/* NEVER called with liblock held */
lnet_eq_t *eq;
@@ -380,7 +380,7 @@ lnet_eq_free(lnet_eq_t *eq)
 }
 
 static inline lnet_libmd_t *
-lnet_md_alloc (lnet_md_t *umd)
+lnet_md_alloc(lnet_md_t *umd)
 {
/* NEVER called with liblock held */
lnet_libmd_t *md;
@@ -423,7 +423,7 @@ lnet_md_free(lnet_libmd_t *md)
 }
 
 static inline lnet_me_t *
-lnet_me_alloc (void)
+lnet_me_alloc(void)
 {
/* NEVER called with liblock held */
lnet_me_t *me;
@@ -479,7 +479,7 @@ lnet_res_lh_invalidate(lnet_libhandle_t *lh)
 }
 
 static inline void
-lnet_eq2handle (lnet_handle_eq_t *handle, lnet_eq_t *eq)
+lnet_eq2handle(lnet_handle_eq_t *handle, lnet_eq_t *eq)
 {
if (eq == NULL) {
LNetInvalidateHandle(handle);
@@ -503,7 +503,7 @@ lnet_handle2eq(lnet_handle_eq_t *handle)
 }
 
 static inline void
-lnet_md2handle (lnet_handle_md_t *handle, lnet_libmd_t *md)
+lnet_md2handle(lnet_handle_md_t *handle, lnet_libmd_t *md)
 {
handle-cookie = md-md_lh.lh_cookie;
 }
@@ -544,7 +544,7 @@ lnet_wire_handle2md(lnet_handle_wire_t *wh)
 }
 
 static inline void
-lnet_me2handle (lnet_handle_me_t *handle, lnet_me_t *me)
+lnet_me2handle(lnet_handle_me_t *handle, lnet_me_t *me)
 {

[PATCH 3/3] staging: lustre: lnet: Reformat pointer variable in lib-lnet.h

2013-10-21 Thread Lisa Nguyen
Reformat a pointer variable in lib-lnet.h to meet kernel
coding style and eliminate pointer format warning
generated by checkpatch.pl

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 0eb2e06..bf30104 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -749,7 +749,7 @@ void lnet_msg_containers_destroy(void);
 int lnet_msg_containers_create(void);
 
 char *lnet_msgtyp2str(int type);
-void lnet_print_hdr(lnet_hdr_t * hdr);
+void lnet_print_hdr(lnet_hdr_t *hdr);
 int lnet_fail_nid(lnet_nid_t nid, unsigned int threshold);
 
 void lnet_counters_get(lnet_counters_t *counters);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel