[PATCH] staging: drm/imx: fix return value check in imx_drm_init()

2013-10-25 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun 
---
 drivers/staging/imx-drm/imx-drm-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index a2e52a0..835a1b1 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -837,8 +837,8 @@ static int __init imx_drm_init(void)
INIT_LIST_HEAD(&imx_drm_device->encoder_list);
 
imx_drm_pdev = platform_device_register_simple("imx-drm", -1, NULL, 0);
-   if (!imx_drm_pdev) {
-   ret = -EINVAL;
+   if (IS_ERR(imx_drm_pdev)) {
+   ret = PTR_ERR(imx_drm_pdev);
goto err_pdev;
}
 

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


Re: [PATCH v4 2/2] Staging: zram: Fix decrement of variable by calling bdput()

2013-10-25 Thread Minchan Kim
On Tue, Oct 22, 2013 at 07:04:37PM +0530, Rashika Kheria wrote:
> As suggested by Jerome Marchand "The code in reset_store get the block device
> (bdget_disk()) but it does not put it (bdput()) when it's done using it.
> The usage count is therefor incremented but never decremented."
> 
> Hence, this patch introduces a call to bdput() to decrement the variable 
> after usage.
> 
> Signed-off-by: Rashika Kheria 
> ---
>  drivers/staging/zram/zram_drv.c |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 8679a06..2cb33ab 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -664,6 +664,7 @@ static ssize_t reset_store(struct device *dev,
>  
>   /* Make sure all pending I/O is finished */
>   fsync_bdev(bdev);
> + bdput(bdev);

We should handle error case, too.
And please put this bug fix patch ahead of [1/2] because this patch is
more real bug fix than [1/2] which is just warning of smatch.

Thanks.

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


Re: [PATCH v4 1/2] Staging: zram: Fix variable dereferenced before check

2013-10-25 Thread Minchan Kim
Hello Rashika,

First of all, thanks for looking this!

On Tue, Oct 22, 2013 at 07:00:57PM +0530, Rashika Kheria wrote:
> 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 
> ---
> 
> This revision fixes the following issues of the previous revision:
> Remove unnecessary checks
> 
>  drivers/staging/zram/zram_drv.c |   16 +++-
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 2c4ed52..8679a06 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;
> +

I'd like to look into that when bdget_disk could fail but I don't have a time
so sorry. I will review it when I return back to the office in next week.

Thanks!

>   /* 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;
> @@ -895,14 +897,10 @@ static void destroy_device(struct zram *zram)
>  {
>   sysfs_remove_group(&disk_to_dev(zram->disk)->kobj,
>   &zram_disk_attr_group);
> + del_gendisk(zram->disk);
> + put_disk(zram->disk);
>  
> - if (zram->disk) {
> - del_gendisk(zram->disk);
> - put_disk(zram->disk);
> - }
> -
> - if (zram->queue)
> - blk_cleanup_queue(zram->queue);
> + blk_cleanup_queue(zram->queue);
>  }
>  
>  static int __init zram_init(void)
> -- 
> 1.7.9.5
> 

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


Re: [PATCH v4 2/2] Staging: zram: Fix decrement of variable by calling bdput()

2013-10-25 Thread Minchan Kim
Hey Rashika,


And please Cc LKML in next.

Thanks!

On Fri, Oct 25, 2013 at 7:13 PM, Minchan Kim  wrote:
> On Tue, Oct 22, 2013 at 07:04:37PM +0530, Rashika Kheria wrote:
>> As suggested by Jerome Marchand "The code in reset_store get the block device
>> (bdget_disk()) but it does not put it (bdput()) when it's done using it.
>> The usage count is therefor incremented but never decremented."
>>
>> Hence, this patch introduces a call to bdput() to decrement the variable 
>> after usage.
>>
>> Signed-off-by: Rashika Kheria 
>> ---
>>  drivers/staging/zram/zram_drv.c |1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/staging/zram/zram_drv.c 
>> b/drivers/staging/zram/zram_drv.c
>> index 8679a06..2cb33ab 100644
>> --- a/drivers/staging/zram/zram_drv.c
>> +++ b/drivers/staging/zram/zram_drv.c
>> @@ -664,6 +664,7 @@ static ssize_t reset_store(struct device *dev,
>>
>>   /* Make sure all pending I/O is finished */
>>   fsync_bdev(bdev);
>> + bdput(bdev);
>
> We should handle error case, too.
> And please put this bug fix patch ahead of [1/2] because this patch is
> more real bug fix than [1/2] which is just warning of smatch.
>
> Thanks.
>
> --
> Kind regards,
> Minchan Kim



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


Re: [PATCHv4 06/16] staging: usbip: Add proper error reporting

2013-10-25 Thread Dan Carpenter
On Sat, Oct 19, 2013 at 04:39:09PM +0200, Dominik Paulus wrote:
> +const char *usbip_net_strerror(int status)
> +{
> + static const char *const errs[] = {
> + /* ERR_OK */ "Success",
> + /* ERR_NA */ "Command failed",
> + /* ERR_MISMATCH */ "Protocol version mismatch",
> + /* ERR_SYSERR */ "System error",
> + /* ERR_UNEXPECTED */ "Unexpected opcode received",
> + /* ERR_AUTHREQ */ "Server requires authentication",
> + /* ERR_PERM */ "Permission denied",
> + /* ERR_NOTFOUND */ "Requested device not found",
> + /* ERR_NOAUTH */ "Server doesn't support authentication"
> + };
> + if (status < 0)
> + status = -status;
> + if (status >= (int) (sizeof(errs) / sizeof(*errs)))

Not a big deal, but for future reference, the cast here is unneeded.

> + return "Invalid";
> + return errs[status];
>  }

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


Re: [PATCHv4 10/16] staging: usbip: TLS for all userspace communication

2013-10-25 Thread Dan Carpenter
On Sat, Oct 19, 2013 at 04:39:13PM +0200, Dominik Paulus wrote:
> @@ -104,8 +105,10 @@ static int import_device(int sockfd, struct 
> usbip_usb_device *udev)
>   return -1;
>   }
>  
> - rc = usbip_vhci_attach_device(port, sockfd, udev->busnum,
> + usbip_net_bye(conn);
> + rc = usbip_vhci_attach_device(port, conn->sockfd, udev->busnum,
> udev->devnum, udev->speed);
> +
>   if (rc < 0) {

Don't put a blank line between the function call and the check.  They
logically are one idea.

>  
> - rc = usbip_net_recv(sockfd, (void *) &reply, sizeof(reply));
> + rc = usbip_net_recv(conn, (void *) &reply, sizeof(reply));

There is no need to cast to void here, btw.  That's just noise.

>   do {
> - if (sending)
> - nbytes = send(sockfd, buff, bufflen, 0);
> + if (!conn->have_crypto && sending)
> + nbytes = send(conn->sockfd, buff, bufflen, 0);
> + else if (!conn->have_crypto && !sending)
> + nbytes = recv(conn->sockfd, buff, bufflen, MSG_WAITALL);
> +#ifdef HAVE_GNUTLS
> + else if (sending)
> + nbytes = gnutls_record_send(conn->session, buff, 
> bufflen);
>   else
> - nbytes = recv(sockfd, buff, bufflen, MSG_WAITALL);
> + nbytes = gnutls_record_recv(conn->session, buff, 
> bufflen);
> +#else
> + /*
> +  * Assertion to let gcc be able to infer proper initialization
> +  * of nbytes.
> +  */
> + assert(!conn->have_crypto);
> +#endif

This is messy and I feel like it should be abstracted into a function
so we can hide the ifdef in a header file.

if (sending)
nbytes = usbip_send(conn, buff, bufflen, 0);
else
nbytes = usbip_recv(...

We'd still have the ifdef but hidden away.


> +int usbip_net_srp_server_handshake(struct usbip_connection *conn)
> +{
> + int ret;
> +
> + if (gnutls_init(&conn->session, GNUTLS_SERVER) != 0)
> + return -1;
> + gnutls_priority_set_direct(conn->session, "NORMAL:-KX-ALL:+SRP", NULL);
> + if (gnutls_credentials_set(conn->session, GNUTLS_CRD_SRP,
> + usbip_net_srp_cred) != 0)
> + return -1;
> +

Kernel style is more beautiful:

ret = gnutls_credentials_set(conn->session, GNUTLS_CRD_SRP,
 usbip_net_srp_cred);
if (ret)
return ret;

> +void usbip_net_bye(struct usbip_connection *conn)
> +{
> +#ifdef HAVE_GNUTLS
> + if (conn->have_crypto) {
> + gnutls_bye(conn->session, GNUTLS_SHUT_RDWR);
> +
> + gnutls_deinit(conn->session);
> + if (!conn->server)
> + 
> gnutls_srp_free_client_credentials(conn->srp_client_cred);
> +
> + conn->have_crypto = 0;
> + }
> +#else
> + (void)conn;

What is this about?  I assume that GCC warns, but which version of GCC
are you using because that sounds horrible.

> +#endif

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


Re: [PATCHv4 12/16] staging: usbip: Pass session keys to the kernel

2013-10-25 Thread Dan Carpenter
On Sat, Oct 19, 2013 at 04:39:15PM +0200, Dominik Paulus wrote:
> @@ -367,10 +367,17 @@ int usbip_host_export_device(struct 
> usbip_exported_device *edev,
>   return -1;
>   }
>  
> - snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", conf->sockfd);
> - dbg("write: %s", sockfd_buff);
> + {
> + char key1[33], key2[33];
> + snprintf(sockfd_buff, sizeof(sockfd_buff), "%d %d %s %s\n",
> + conf->sockfd, conf->use_crypto,
> + keytohex(conf->key2, key2),
> + keytohex(conf->key1, key1));
> + dbg("write: %s", sockfd_buff);
> + }

This is gross.  Don't do that.  My gut says to just delete the debug
code but I hate debug code by default.

> - ret = sysfs_write_attribute(attr, sockfd_buff, strlen(sockfd_buff));
> + ret = sysfs_write_attribute(attr, (const char *) sockfd_buff,

Don't put a space between the cast and the variable.

ret = sysfs_write_attribute(attr, (const char *)sockfd_buff,

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


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

2013-10-25 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 
---
 .../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 2/4] staging: lustre: Remove typedef and update cfs_debug_limit_state struct

2013-10-25 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 
---
 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/4] staging: lustre: Remove typedef and update cfs_hash_bucket struct

2013-10-25 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 
---
 .../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;
@@ -902,1

[PATCH 2/3] staging: lustre: lnet: Remove unnecessary () from return statements

2013-10-25 Thread Lisa Nguyen
Remove unnecessary parentheses from return statements in lib-lnet.h
to meet kernel coding style.

Signed-off-by: Lisa Nguyen 
---
 drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 8869f10..0eb2e06 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -199,11 +199,11 @@ lnet_freelist_alloc(lnet_freelist_t *fl)
lnet_freeobj_t *o;
 
if (list_empty(&fl->fl_list))
-   return (NULL);
+   return NULL;
 
o = list_entry(fl->fl_list.next, lnet_freeobj_t, fo_list);
list_del(&o->fo_list);
-   return ((void *)&o->fo_contents);
+   return (void *)&o->fo_contents;
 }
 
 static inline void
@@ -369,7 +369,7 @@ lnet_eq_alloc(void)
lnet_eq_t *eq;
 
LIBCFS_ALLOC(eq, sizeof(*eq));
-   return (eq);
+   return eq;
 }
 
 static inline void
@@ -405,7 +405,7 @@ lnet_md_alloc(lnet_md_t *umd)
INIT_LIST_HEAD(&md->md_list);
}
 
-   return (md);
+   return md;
 }
 
 static inline void
@@ -429,7 +429,7 @@ lnet_me_alloc(void)
lnet_me_t *me;
 
LIBCFS_ALLOC(me, sizeof(*me));
-   return (me);
+   return me;
 }
 
 static inline void
@@ -448,7 +448,7 @@ lnet_msg_alloc(void)
LIBCFS_ALLOC(msg, sizeof(*msg));
 
/* no need to zero, LIBCFS_ALLOC does for us */
-   return (msg);
+   return msg;
 }
 
 static inline void
-- 
1.8.1.2

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


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

2013-10-25 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 
---
 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


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

2013-10-25 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 
---
 .../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)
 {
 

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

2013-10-25 Thread Dan Carpenter
This is for future reference, the current patch seems fine.

On Fri, Oct 25, 2013 at 01:20:56PM -0700, Lisa Nguyen wrote:
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
> @@ -159,7 +159,7 @@ static int lprocfs_ns_resources_seq_show(struct seq_file 
> *m, void *v)
>  {
>   struct ldlm_namespace *ns  = m->private;
>   __u64 res = 0;
> - cfs_hash_bd_t bd;
> + struct cfs_hash_bdbd;
>   int i;

These are badly aligned.  I assume you are using sed.  Also there is an
extra space before the '=' on the first line and "i" is out of
alignment.  So it was pretty ugly to begin with.

Really, don't use tabs, just use a single space.

struct ldlm_namespace *ns = m->private;
u64 res = 0;
struct cfs_hash_bd bd;
int i;

If you do it like that then later when you need to update the types then
you don't need to re-indent everything to match.

The difference between u64 and __u64 is that you have to use __u64 in
headers which are exported to userspace.  This isn't a header so that
doesn't apply.

I haven't totally understood which lustre files are expected to be uapi.
Those should probably be more minimal and maybe in a separate directory.

regards,
dan carpenter


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


[PATCH 10/11] Staging: bcm: Replace PVOID with void * in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replaces "PVOID" with "void *"
in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index 2074c18..c5891dd 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -20,7 +20,7 @@ struct bcm_packettosend {
 } __packed;
 
 struct bcm_control_packet {
-   PVOID   ControlBuff;
+   void *ControlBuff;
unsigned int ControlBuffLen;
struct bcm_control_packet *next;
 } __packed;
@@ -208,9 +208,9 @@ struct bcm_targetdsx_buffer {
BOOLEAN valid;
 };
 
-typedef int (*FP_FLASH_WRITE)(struct bcm_mini_adapter *, unsigned int, PVOID);
+typedef int (*FP_FLASH_WRITE)(struct bcm_mini_adapter *, unsigned int, void *);
 
-typedef int (*FP_FLASH_WRITE_STATUS)(struct bcm_mini_adapter *, unsigned int, 
PVOID);
+typedef int (*FP_FLASH_WRITE_STATUS)(struct bcm_mini_adapter *, unsigned int, 
void *);
 
 /*
  * Driver adapter data structure
@@ -308,22 +308,22 @@ struct bcm_mini_adapter {
/* Driver State for LED Blinking */
enum bcm_led_events DriverState;
/* Interface Specific */
-   PVOID   pvInterfaceAdapter;
-   int (*bcm_file_download)(PVOID,
+   void *pvInterfaceAdapter;
+   int (*bcm_file_download)(void *,
struct file *,
unsigned int);
-   int (*bcm_file_readback_from_chip)(PVOID,
+   int (*bcm_file_readback_from_chip)(void *,
struct file *,
unsigned int);
-   int (*interface_rdm)(PVOID,
+   int (*interface_rdm)(void *,
unsigned int,
-   PVOID,
+   void *,
int);
-   int (*interface_wrm)(PVOID,
+   int (*interface_wrm)(void *,
unsigned int,
-   PVOID,
+   void *,
int);
-   int (*interface_transmit)(PVOID, PVOID , unsigned int);
+   int (*interface_transmit)(void *, void *, unsigned int);
BOOLEAN IdleMode;
BOOLEAN bDregRequestSentInIdleMode;
BOOLEAN bTriedToWakeUpFromlowPowerMode;
-- 
1.7.9.5

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


[PATCH 03/11] Staging: bcm: Replace USHORT with unsigned short in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replace "USHORT" with "unsigned
short" in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index cd224f2..8f0033a 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -8,8 +8,8 @@
 #include "Debug.h"
 
 struct bcm_leader {
-   USHORT  Vcid;
-   USHORT  PLength;
+   unsigned short Vcid;
+   unsigned short PLength;
UCHAR   Status;
UCHAR   Unused[3];
 } __packed;
@@ -64,7 +64,7 @@ struct bcm_classifier_rule {
UCHAR   ucReserved[2];
B_UINT16uiClassifierRuleIndex;
BOOLEAN bUsed;
-   USHORT  usVCID_Value;
+   unsigned short  usVCID_Value;
B_UINT8 u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
union bcm_ip_address stSrcIpAddress;
UCHAR   ucIPSourceAddressLength; /* Ip Source Address Length */
@@ -78,12 +78,12 @@ struct bcm_classifier_rule {
 
UCHAR   ucProtocolLength; /* protocol Length */
UCHAR   ucProtocol[MAX_PROTOCOL_LENGTH]; /* protocol Length */
-   USHORT  usSrcPortRangeLo[MAX_PORT_RANGE];
-   USHORT  usSrcPortRangeHi[MAX_PORT_RANGE];
+   unsigned short  usSrcPortRangeLo[MAX_PORT_RANGE];
+   unsigned short  usSrcPortRangeHi[MAX_PORT_RANGE];
UCHAR   ucSrcPortRangeLength;
 
-   USHORT  usDestPortRangeLo[MAX_PORT_RANGE];
-   USHORT  usDestPortRangeHi[MAX_PORT_RANGE];
+   unsigned short  usDestPortRangeLo[MAX_PORT_RANGE];
+   unsigned short  usDestPortRangeHi[MAX_PORT_RANGE];
UCHAR   ucDestPortRangeLength;
 
BOOLEAN bProtocolValid;
@@ -108,14 +108,14 @@ struct bcm_classifier_rule {
UCHAR   ucEtherTypeLen;
UCHAR   au8EthCSEtherType[NUM_ETHERTYPE_BYTES];
UCHAR   usUserPriority[2];
-   USHORT  usVLANID;
-   USHORT  usValidityBitMap;
+   unsigned short  usVLANID;
+   unsigned short  usValidityBitMap;
 };
 
 struct bcm_fragmented_packet_info {
BOOLEAN bUsed;
ULONG   ulSrcIpAddress;
-   USHORT  usIpIdentification;
+   unsigned short usIpIdentification;
struct bcm_classifier_rule *pstMatchedClassifierEntry;
BOOLEAN bOutOfOrderFragment;
 };
@@ -123,7 +123,7 @@ struct bcm_fragmented_packet_info {
 struct bcm_packet_info {
/* classification extension Rule */
ULONG   ulSFID;
-   USHORT  usVCID_Value;
+   unsigned short  usVCID_Value;
UINTuiThreshold;
/* This field determines the priority of the SF Queues */
B_UINT8 u8TrafficPriority;
@@ -150,7 +150,7 @@ struct bcm_packet_info {
UINTuiMaxAllowedRate;
UINTNumOfPacketsSent;
UCHAR   ucDirection;
-   USHORT  usCID;
+   unsigned short  usCID;
struct bcm_mibs_parameters stMibsExtServiceFlowTable;
UINTuiCurrentRxRate;
UINTuiThisPeriodRxBytes;
@@ -244,8 +244,8 @@ struct bcm_mini_adapter {
/* this to keep track of the Tx and Rx MailBox Registers. */
atomic_tCurrNumFreeTxDesc;
/* to keep track the no of byte received */
-   USHORT  PrevNumRecvDescs;
-   USHORT  CurrNumRecvDescs;
+   unsigned short  PrevNumRecvDescs;
+   unsigned short  CurrNumRecvDescs;
UINTu32TotalDSD;
struct bcm_packet_info  PackInfo[NO_OF_QUEUES];
struct bcm_classifier_rule astClassifierTable[MAX_CLASSIFIERS];
@@ -284,7 +284,7 @@ struct bcm_mini_adapter {
BOOLEAN bBinDownloaded;
BOOLEAN bCfgDownloaded;
BOOLEAN bSyncUpRequestSent;
-   USHORT  usBestEffortQueueIndex;
+   unsigned short  usBestEffortQueueIndex;
wait_queue_head_t   ioctl_fw_dnld_wait_queue;
BOOLEAN waiting_to_fw_download_done;
pid_t   fw_download_process_pid;
@@ -400,7 +400,7 @@ struct bcm_mini_adapter {
 struct bcm_eth_header {
UCHAR   au8DestinationAddress[6];
UCHAR   au8SourceAddress[6];
-   USHORT  u16Etype;
+   unsigned short u16Etype;
 } __packed;
 
 struct bcm_firmware_info {
-- 
1.7.9.5

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


[PATCH 05/11] Staging: bcm: Replace ULONG with unsigned long in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replace "ULONG" with "unsigned
long" in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |   42 -
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index eaf9532..4c9662b 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -37,12 +37,12 @@ struct bcm_link_request {
 
 union bcm_ip_address {
struct {
-   ULONG ulIpv4Addr[MAX_IP_RANGE_LENGTH]; /* Source Ip Address 
Range */
-   ULONG ulIpv4Mask[MAX_IP_RANGE_LENGTH]; /* Source Ip Mask 
Address Range */
+   unsigned long ulIpv4Addr[MAX_IP_RANGE_LENGTH]; /* Source Ip 
Address Range */
+   unsigned long ulIpv4Mask[MAX_IP_RANGE_LENGTH]; /* Source Ip 
Mask Address Range */
};
struct {
-   ULONG ulIpv6Addr[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip Address 
Range */
-   ULONG ulIpv6Mask[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip Mask 
Address Range */
+   unsigned long ulIpv6Addr[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip 
Address Range */
+   unsigned long ulIpv6Mask[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip 
Mask Address Range */
};
struct {
unsigned char ucIpv4Address[MAX_IP_RANGE_LENGTH * 
IP_LENGTH_OF_ADDRESS];
@@ -60,7 +60,7 @@ struct bcm_hdr_suppression_contextinfo {
 };
 
 struct bcm_classifier_rule {
-   ULONG   ulSFID;
+   unsigned long   ulSFID;
unsigned char   ucReserved[2];
B_UINT16uiClassifierRuleIndex;
BOOLEAN bUsed;
@@ -114,7 +114,7 @@ struct bcm_classifier_rule {
 
 struct bcm_fragmented_packet_info {
BOOLEAN bUsed;
-   ULONG   ulSrcIpAddress;
+   unsigned long   ulSrcIpAddress;
unsigned short usIpIdentification;
struct bcm_classifier_rule *pstMatchedClassifierEntry;
BOOLEAN bOutOfOrderFragment;
@@ -122,7 +122,7 @@ struct bcm_fragmented_packet_info {
 
 struct bcm_packet_info {
/* classification extension Rule */
-   ULONG   ulSFID;
+   unsigned long   ulSFID;
unsigned short  usVCID_Value;
UINTuiThreshold;
/* This field determines the priority of the SF Queues */
@@ -199,11 +199,11 @@ struct bcm_tarang_data {
BOOLEAN MacTracingEnabled;
BOOLEAN bApplicationToExit;
struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs;
-   ULONG   RxCntrlMsgBitMask;
+   unsigned long   RxCntrlMsgBitMask;
 };
 
 struct bcm_targetdsx_buffer {
-   ULONG   ulTargetDsxBuffer;
+   unsigned long   ulTargetDsxBuffer;
B_UINT16tid;
BOOLEAN valid;
 };
@@ -253,8 +253,8 @@ struct bcm_mini_adapter {
 
/*** qos **/
BOOLEAN bETHCSEnabled;
-   ULONG   BEBucketSize;
-   ULONG   rtPSBucketSize;
+   unsigned long   BEBucketSize;
+   unsigned long   rtPSBucketSize;
unsigned char   LinkStatus;
BOOLEAN AutoLinkUp;
BOOLEAN AutoSyncup;
@@ -275,9 +275,9 @@ struct bcm_mini_adapter {
struct semaphorerdmwrmsync;
 
struct bcm_targetdsx_buffer 
astTargetDsxBuffer[MAX_TARGET_DSX_BUFFERS];
-   ULONG   ulFreeTargetBufferCnt;
-   ULONG   ulCurrentTargetBuffer;
-   ULONG   ulTotalTargetBuffersAvailable;
+   unsigned long   ulFreeTargetBufferCnt;
+   unsigned long   ulCurrentTargetBuffer;
+   unsigned long   ulTotalTargetBuffersAvailable;
unsigned long   chip_id;
wait_queue_head_t   lowpower_mode_wait_queue;
BOOLEAN bFlashBoot;
@@ -294,7 +294,7 @@ struct bcm_mini_adapter {
BOOLEAN bIsAutoCorrectEnabled;
BOOLEAN bDDRInitDone;
int DDRSetting;
-   ULONG   ulPowerSaveMode;
+   unsigned long   ulPowerSaveMode;
spinlock_t  txtransmitlock;
B_UINT8 txtransmit_running;
/* Thread for control packet handling */
@@ -356,9 +356,9 @@ struct bcm_mini_adapter {
 * Generally it is Active DSD but in case of NVM RD/WR it might be 
different.
 */
UINTulFlashCalStart;
-   ULONG   ulFlashControlSectionStart;
-   ULONG   ulFlashWriteSize;
-   ULONG   ulFlashID;
+   unsigned long   ulFlashControlSectionStart;
+   unsigned long   ulFlashWriteSize;
+   unsigned long   ulFlashID;
FP_FLASH_WRITE  fpFlash

[PATCH 08/11] Staging: bcm: Replace UINT32 with u32 in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replaces "UINT32" with "u32"
in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index 27b5011..a34 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -94,7 +94,7 @@ struct bcm_classifier_rule {
/* For IPv6 Addressing */
unsigned char   ucDirection;
BOOLEAN bIpv6Protocol;
-   UINT32  u32PHSRuleID;
+   u32 u32PHSRuleID;
struct bcm_phs_rule sPhsRule;
unsigned char   u8AssociatedPHSI;
 
@@ -340,11 +340,11 @@ struct bcm_mini_adapter {
BOOLEAN AutoFirmDld;
BOOLEAN bMipsConfig;
BOOLEAN bDPLLConfig;
-   UINT32  aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
-   UINT32  aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
+   u32 aTxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
+   u32 aRxPktSizeHist[MIBS_MAX_HIST_ENTRIES];
struct bcm_fragmented_packet_info 
astFragmentedPktClassifierTable[MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES];
atomic_tuiMBupdate;
-   UINT32  PmuMode;
+   u32 PmuMode;
enum bcm_nvm_type   eNVMType;
UINTuiSectorSize;
UINTuiSectorSizeInCFG;
@@ -388,7 +388,7 @@ struct bcm_mini_adapter {
BOOLEAN bDoSuspend;
UINTsyscfgBefFwDld;
BOOLEAN StopAllXaction;
-   UINT32  liTimeSinceLastNetEntry; /* Used to Support 
extended CAPI requirements from */
+   u32 liTimeSinceLastNetEntry; /* Used to Support 
extended CAPI requirements from */
struct semaphoreLowPowerModeSync;
unsigned long   liDrainCalculated;
UINTgpioBitMap;
-- 
1.7.9.5

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


[PATCH 09/11] Staging: bcm: Replace UINT with unsigned int in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replaces "UINT" with "unsigned
int" in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |   84 -
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index a34..2074c18 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -21,7 +21,7 @@ struct bcm_packettosend {
 
 struct bcm_control_packet {
PVOID   ControlBuff;
-   UINTControlBuffLen;
+   unsigned int ControlBuffLen;
struct bcm_control_packet *next;
 } __packed;
 
@@ -124,7 +124,7 @@ struct bcm_packet_info {
/* classification extension Rule */
unsigned long   ulSFID;
unsigned short  usVCID_Value;
-   UINTuiThreshold;
+   unsigned intuiThreshold;
/* This field determines the priority of the SF Queues */
u8  u8TrafficPriority;
 
@@ -134,29 +134,29 @@ struct bcm_packet_info {
 
u8  u8QueueType; /* BE or rtPS */
 
-   UINTuiMaxBucketSize; /* maximum size of the bucket for the 
queue */
-   UINTuiCurrentQueueDepthOnTarget;
-   UINTuiCurrentBytesOnHost;
-   UINTuiCurrentPacketsOnHost;
-   UINTuiDroppedCountBytes;
-   UINTuiDroppedCountPackets;
-   UINTuiSentBytes;
-   UINTuiSentPackets;
-   UINTuiCurrentDrainRate;
-   UINTuiThisPeriodSentBytes;
+   unsigned intuiMaxBucketSize; /* maximum size of the bucket for the 
queue */
+   unsigned intuiCurrentQueueDepthOnTarget;
+   unsigned intuiCurrentBytesOnHost;
+   unsigned intuiCurrentPacketsOnHost;
+   unsigned intuiDroppedCountBytes;
+   unsigned intuiDroppedCountPackets;
+   unsigned intuiSentBytes;
+   unsigned intuiSentPackets;
+   unsigned intuiCurrentDrainRate;
+   unsigned intuiThisPeriodSentBytes;
LARGE_INTEGER   liDrainCalculated;
-   UINTuiCurrentTokenCount;
+   unsigned intuiCurrentTokenCount;
LARGE_INTEGER   liLastUpdateTokenAt;
-   UINTuiMaxAllowedRate;
-   UINTNumOfPacketsSent;
+   unsigned intuiMaxAllowedRate;
+   unsigned intNumOfPacketsSent;
unsigned char   ucDirection;
unsigned short  usCID;
struct bcm_mibs_parameters stMibsExtServiceFlowTable;
-   UINTuiCurrentRxRate;
-   UINTuiThisPeriodRxBytes;
-   UINTuiTotalRxBytes;
-   UINTuiTotalTxBytes;
-   UINTuiPendedLast;
+   unsigned intuiCurrentRxRate;
+   unsigned intuiThisPeriodRxBytes;
+   unsigned intuiTotalRxBytes;
+   unsigned intuiTotalTxBytes;
+   unsigned intuiPendedLast;
unsigned char   ucIpVersion;
 
union {
@@ -185,7 +185,7 @@ struct bcm_packet_info {
void*pstSFIndication;
struct timeval  stLastUpdateTokenAt;
atomic_tuiPerSFTxResourceCount;
-   UINTuiMaxLatency;
+   unsigned intuiMaxLatency;
unsigned char   bIPCSSupport;
unsigned char   bEthCSSupport;
 };
@@ -208,9 +208,9 @@ struct bcm_targetdsx_buffer {
BOOLEAN valid;
 };
 
-typedef int (*FP_FLASH_WRITE)(struct bcm_mini_adapter *, UINT, PVOID);
+typedef int (*FP_FLASH_WRITE)(struct bcm_mini_adapter *, unsigned int, PVOID);
 
-typedef int (*FP_FLASH_WRITE_STATUS)(struct bcm_mini_adapter *, UINT, PVOID);
+typedef int (*FP_FLASH_WRITE_STATUS)(struct bcm_mini_adapter *, unsigned int, 
PVOID);
 
 /*
  * Driver adapter data structure
@@ -246,7 +246,7 @@ struct bcm_mini_adapter {
/* to keep track the no of byte received */
unsigned short  PrevNumRecvDescs;
unsigned short  CurrNumRecvDescs;
-   UINTu32TotalDSD;
+   unsigned intu32TotalDSD;
struct bcm_packet_info  PackInfo[NO_OF_QUEUES];
struct bcm_classifier_rule astClassifierTable[MAX_CLASSIFIERS];
BOOLEAN TransferMode;
@@ -271,7 +271,7 @@ struct bcm_mini_adapter {
atomic_tindex_app_read_cntrlpkt;
atomic_tindex_wr_txcntrlpkt;
atomic_tindex_rd_txcntrlpkt;
-   UINTindex_datpkt;
+   unsigned intindex_datpkt;
struct semaphorerdmwrmsync;
 
struct bcm_targetdsx_buffer 
astTargetDsxBuffer[MAX_TARGET_DSX_BUFFERS];
@@ -316,14 +316,14 @@ struct bcm_mini_adapter {
struct file *,
unsigned int);
int (*interface_rdm)(PVOID,
-   UINT,
+   unsigned int,
PVOID,
   

[PATCH 01/11] Staging: bcm: Fix WARNING: space prohibited before semicolon.

2013-10-25 Thread Kevin McKinney
This patch removes a space before semicolon as
specified by checkpatch.pl.

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index 1d8bf08..c2c0e6c 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -267,7 +267,7 @@ struct bcm_mini_adapter {
BOOLEAN fw_download_done;
 
char*txctlpacket[MAX_CNTRL_PKTS];
-   atomic_tcntrlpktCnt ;
+   atomic_tcntrlpktCnt;
atomic_tindex_app_read_cntrlpkt;
atomic_tindex_wr_txcntrlpkt;
atomic_tindex_rd_txcntrlpkt;
-- 
1.7.9.5

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


[PATCH 04/11] Staging: bcm: Replace UCHAR with unsigned char in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replace "UCHAR" with "unsigned
char" in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |   82 -
 1 file changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index 8f0033a..eaf9532 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -10,13 +10,13 @@
 struct bcm_leader {
unsigned short Vcid;
unsigned short PLength;
-   UCHAR   Status;
-   UCHAR   Unused[3];
+   unsigned char  Status;
+   unsigned char  Unused[3];
 } __packed;
 
 struct bcm_packettosend {
struct bcm_leader Leader;
-   UCHAR   ucPayload;
+   unsigned char ucPayload;
 } __packed;
 
 struct bcm_control_packet {
@@ -27,7 +27,7 @@ struct bcm_control_packet {
 
 struct bcm_link_request {
struct bcm_leader Leader;
-   UCHAR   szData[4];
+   unsigned char szData[4];
 } __packed;
 
 #define MAX_IP_RANGE_LENGTH 4
@@ -45,46 +45,46 @@ union bcm_ip_address {
ULONG ulIpv6Mask[MAX_IP_RANGE_LENGTH * 4]; /* Source Ip Mask 
Address Range */
};
struct {
-   UCHAR ucIpv4Address[MAX_IP_RANGE_LENGTH * IP_LENGTH_OF_ADDRESS];
-   UCHAR ucIpv4Mask[MAX_IP_RANGE_LENGTH * IP_LENGTH_OF_ADDRESS];
+   unsigned char ucIpv4Address[MAX_IP_RANGE_LENGTH * 
IP_LENGTH_OF_ADDRESS];
+   unsigned char ucIpv4Mask[MAX_IP_RANGE_LENGTH * 
IP_LENGTH_OF_ADDRESS];
};
struct {
-   UCHAR ucIpv6Address[MAX_IP_RANGE_LENGTH * 
IPV6_ADDRESS_SIZEINBYTES];
-   UCHAR ucIpv6Mask[MAX_IP_RANGE_LENGTH * 
IPV6_ADDRESS_SIZEINBYTES];
+   unsigned char ucIpv6Address[MAX_IP_RANGE_LENGTH * 
IPV6_ADDRESS_SIZEINBYTES];
+   unsigned char ucIpv6Mask[MAX_IP_RANGE_LENGTH * 
IPV6_ADDRESS_SIZEINBYTES];
};
 };
 
 struct bcm_hdr_suppression_contextinfo {
-   UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer 
to accumulate pkt Header for PHS */
-   UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; /* 
Intermediate buffer containing pkt Header after PHS */
+   unsigned char ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate 
buffer to accumulate pkt Header for PHS */
+   unsigned char ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; /* 
Intermediate buffer containing pkt Header after PHS */
 };
 
 struct bcm_classifier_rule {
ULONG   ulSFID;
-   UCHAR   ucReserved[2];
+   unsigned char   ucReserved[2];
B_UINT16uiClassifierRuleIndex;
BOOLEAN bUsed;
unsigned short  usVCID_Value;
B_UINT8 u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
union bcm_ip_address stSrcIpAddress;
-   UCHAR   ucIPSourceAddressLength; /* Ip Source Address Length */
+   unsigned char   ucIPSourceAddressLength; /* Ip Source Address Length */
 
union bcm_ip_address stDestIpAddress;
-   UCHAR   ucIPDestinationAddressLength; /* Ip Destination Address 
Length */
-   UCHAR   ucIPTypeOfServiceLength; /* Type of service Length */
-   UCHAR   ucTosLow; /* Tos Low */
-   UCHAR   ucTosHigh; /* Tos High */
-   UCHAR   ucTosMask; /* Tos Mask */
-
-   UCHAR   ucProtocolLength; /* protocol Length */
-   UCHAR   ucProtocol[MAX_PROTOCOL_LENGTH]; /* protocol Length */
+   unsigned char   ucIPDestinationAddressLength; /* Ip Destination Address 
Length */
+   unsigned char   ucIPTypeOfServiceLength; /* Type of service Length */
+   unsigned char   ucTosLow; /* Tos Low */
+   unsigned char   ucTosHigh; /* Tos High */
+   unsigned char   ucTosMask; /* Tos Mask */
+
+   unsigned char   ucProtocolLength; /* protocol Length */
+   unsigned char   ucProtocol[MAX_PROTOCOL_LENGTH]; /* protocol Length */
unsigned short  usSrcPortRangeLo[MAX_PORT_RANGE];
unsigned short  usSrcPortRangeHi[MAX_PORT_RANGE];
-   UCHAR   ucSrcPortRangeLength;
+   unsigned char   ucSrcPortRangeLength;
 
unsigned short  usDestPortRangeLo[MAX_PORT_RANGE];
unsigned short  usDestPortRangeHi[MAX_PORT_RANGE];
-   UCHAR   ucDestPortRangeLength;
+   unsigned char   ucDestPortRangeLength;
 
BOOLEAN bProtocolValid;
BOOLEAN bTOSValid;
@@ -92,22 +92,22 @@ struct bcm_classifier_rule {
BOOLEAN bSrcIpValid;
 
/* For IPv6 Addressing */
-   UCHAR   ucDirection;
+   unsigned char   ucDirection;
BOOLEAN bIpv6Protocol;
UINT32  u32PHSRuleID;
struct bcm_phs_rule sPhsRule;
-   UCHAR   u8AssociatedPHSI;
+   unsigned char   u8AssociatedPHSI;
 
/* Classification fields for ETH CS */
-   UCHAR   ucEthCSSrcMACLen;
-

[PATCH 02/11] Staging: bcm: Remove typedef for _U_IP_ADDRESS and call directly.

2013-10-25 Thread Kevin McKinney
This patch removes typedef for _U_IP_ADDRESS, and
changes the name of the struct to bcm_ip_address. In
addition, any calls to struct "U_IP_ADDRESS" are
changed to call directly.

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index c2c0e6c..cd224f2 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -35,7 +35,7 @@ struct bcm_link_request {
 #define MAX_PROTOCOL_LENGTH   32
 #define IPV6_ADDRESS_SIZEINBYTES 0x10
 
-typedef union _U_IP_ADDRESS {
+union bcm_ip_address {
struct {
ULONG ulIpv4Addr[MAX_IP_RANGE_LENGTH]; /* Source Ip Address 
Range */
ULONG ulIpv4Mask[MAX_IP_RANGE_LENGTH]; /* Source Ip Mask 
Address Range */
@@ -52,7 +52,7 @@ typedef union _U_IP_ADDRESS {
UCHAR ucIpv6Address[MAX_IP_RANGE_LENGTH * 
IPV6_ADDRESS_SIZEINBYTES];
UCHAR ucIpv6Mask[MAX_IP_RANGE_LENGTH * 
IPV6_ADDRESS_SIZEINBYTES];
};
-} U_IP_ADDRESS;
+};
 
 struct bcm_hdr_suppression_contextinfo {
UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer 
to accumulate pkt Header for PHS */
@@ -66,10 +66,10 @@ struct bcm_classifier_rule {
BOOLEAN bUsed;
USHORT  usVCID_Value;
B_UINT8 u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
-   U_IP_ADDRESSstSrcIpAddress;
+   union bcm_ip_address stSrcIpAddress;
UCHAR   ucIPSourceAddressLength; /* Ip Source Address Length */
 
-   U_IP_ADDRESSstDestIpAddress;
+   union bcm_ip_address stDestIpAddress;
UCHAR   ucIPDestinationAddressLength; /* Ip Destination Address 
Length */
UCHAR   ucIPTypeOfServiceLength; /* Type of service Length */
UCHAR   ucTosLow; /* Tos Low */
-- 
1.7.9.5

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


[PATCH 06/11] Staging: bcm: Replace B_UINT16 with u16 in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replace "B_UINT16" with "u16"
in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index 4c9662b..fbd06a1 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -62,7 +62,7 @@ struct bcm_hdr_suppression_contextinfo {
 struct bcm_classifier_rule {
unsigned long   ulSFID;
unsigned char   ucReserved[2];
-   B_UINT16uiClassifierRuleIndex;
+   u16 uiClassifierRuleIndex;
BOOLEAN bUsed;
unsigned short  usVCID_Value;
B_UINT8 u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
@@ -204,7 +204,7 @@ struct bcm_tarang_data {
 
 struct bcm_targetdsx_buffer {
unsigned long   ulTargetDsxBuffer;
-   B_UINT16tid;
+   u16 tid;
BOOLEAN valid;
 };
 
-- 
1.7.9.5

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


[PATCH 07/11] Staging: bcm: Replace B_UINT8 with u8 in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replaces "B_UINT8" with "u8"
in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index fbd06a1..27b5011 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -65,7 +65,7 @@ struct bcm_classifier_rule {
u16 uiClassifierRuleIndex;
BOOLEAN bUsed;
unsigned short  usVCID_Value;
-   B_UINT8 u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
+   u8  u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
union bcm_ip_address stSrcIpAddress;
unsigned char   ucIPSourceAddressLength; /* Ip Source Address Length */
 
@@ -126,13 +126,13 @@ struct bcm_packet_info {
unsigned short  usVCID_Value;
UINTuiThreshold;
/* This field determines the priority of the SF Queues */
-   B_UINT8 u8TrafficPriority;
+   u8  u8TrafficPriority;
 
BOOLEAN bValid;
BOOLEAN bActive;
BOOLEAN bActivateRequestSent;
 
-   B_UINT8 u8QueueType; /* BE or rtPS */
+   u8  u8QueueType; /* BE or rtPS */
 
UINTuiMaxBucketSize; /* maximum size of the bucket for the 
queue */
UINTuiCurrentQueueDepthOnTarget;
@@ -296,7 +296,7 @@ struct bcm_mini_adapter {
int DDRSetting;
unsigned long   ulPowerSaveMode;
spinlock_t  txtransmitlock;
-   B_UINT8 txtransmit_running;
+   u8  txtransmit_running;
/* Thread for control packet handling */
struct task_struct  *control_packet_handler;
/* thread for transmitting packets. */
-- 
1.7.9.5

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


[PATCH 11/11] Staging: bcm: Replace BOOLEAN with bool in Adapter.h

2013-10-25 Thread Kevin McKinney
This patch replaces "BOOLEAN" with "bool"
in Adapter.h

Signed-off-by: Kevin McKinney 
---
 drivers/staging/bcm/Adapter.h |  122 -
 1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h
index c5891dd..ac81954 100644
--- a/drivers/staging/bcm/Adapter.h
+++ b/drivers/staging/bcm/Adapter.h
@@ -63,7 +63,7 @@ struct bcm_classifier_rule {
unsigned long   ulSFID;
unsigned char   ucReserved[2];
u16 uiClassifierRuleIndex;
-   BOOLEAN bUsed;
+   boolbUsed;
unsigned short  usVCID_Value;
u8  u8ClassifierRulePriority; /* This field detemines the 
Classifier Priority */
union bcm_ip_address stSrcIpAddress;
@@ -86,14 +86,14 @@ struct bcm_classifier_rule {
unsigned short  usDestPortRangeHi[MAX_PORT_RANGE];
unsigned char   ucDestPortRangeLength;
 
-   BOOLEAN bProtocolValid;
-   BOOLEAN bTOSValid;
-   BOOLEAN bDestIpValid;
-   BOOLEAN bSrcIpValid;
+   boolbProtocolValid;
+   boolbTOSValid;
+   boolbDestIpValid;
+   boolbSrcIpValid;
 
/* For IPv6 Addressing */
unsigned char   ucDirection;
-   BOOLEAN bIpv6Protocol;
+   boolbIpv6Protocol;
u32 u32PHSRuleID;
struct bcm_phs_rule sPhsRule;
unsigned char   u8AssociatedPHSI;
@@ -113,11 +113,11 @@ struct bcm_classifier_rule {
 };
 
 struct bcm_fragmented_packet_info {
-   BOOLEAN bUsed;
+   boolbUsed;
unsigned long   ulSrcIpAddress;
unsigned short usIpIdentification;
struct bcm_classifier_rule *pstMatchedClassifierEntry;
-   BOOLEAN bOutOfOrderFragment;
+   boolbOutOfOrderFragment;
 };
 
 struct bcm_packet_info {
@@ -128,9 +128,9 @@ struct bcm_packet_info {
/* This field determines the priority of the SF Queues */
u8  u8TrafficPriority;
 
-   BOOLEAN bValid;
-   BOOLEAN bActive;
-   BOOLEAN bActivateRequestSent;
+   boolbValid;
+   boolbActive;
+   boolbActivateRequestSent;
 
u8  u8QueueType; /* BE or rtPS */
 
@@ -170,17 +170,17 @@ struct bcm_packet_info {
};
};
 
-   BOOLEAN bProtocolValid;
-   BOOLEAN bTOSValid;
-   BOOLEAN bDestIpValid;
-   BOOLEAN bSrcIpValid;
+   boolbProtocolValid;
+   boolbTOSValid;
+   boolbDestIpValid;
+   boolbSrcIpValid;
 
-   BOOLEAN bActiveSet;
-   BOOLEAN bAdmittedSet;
-   BOOLEAN bAuthorizedSet;
-   BOOLEAN bClassifierPriority;
+   boolbActiveSet;
+   boolbAdmittedSet;
+   boolbAuthorizedSet;
+   boolbClassifierPriority;
unsigned char   ucServiceClassName[MAX_CLASS_NAME_LENGTH];
-   BOOLEAN bHeaderSuppressionEnabled;
+   boolbHeaderSuppressionEnabled;
spinlock_t  SFQueueLock;
void*pstSFIndication;
struct timeval  stLastUpdateTokenAt;
@@ -196,8 +196,8 @@ struct bcm_tarang_data {
struct sk_buff  *RxAppControlHead;
struct sk_buff  *RxAppControlTail;
int AppCtrlQueueLen;
-   BOOLEAN MacTracingEnabled;
-   BOOLEAN bApplicationToExit;
+   boolMacTracingEnabled;
+   boolbApplicationToExit;
struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs;
unsigned long   RxCntrlMsgBitMask;
 };
@@ -205,7 +205,7 @@ struct bcm_tarang_data {
 struct bcm_targetdsx_buffer {
unsigned long   ulTargetDsxBuffer;
u16 tid;
-   BOOLEAN valid;
+   boolvalid;
 };
 
 typedef int (*FP_FLASH_WRITE)(struct bcm_mini_adapter *, unsigned int, void *);
@@ -221,11 +221,11 @@ struct bcm_mini_adapter {
u32 msg_enable;
CHAR*caDsxReqResp;
atomic_tApplicationRunning;
-   BOOLEAN AppCtrlQueueOverFlow;
+   boolAppCtrlQueueOverFlow;
atomic_tCurrentApplicationCount;
atomic_tRegisteredApplicationCount;
-   BOOLEAN LinkUpStatus;
-   BOOLEAN TimerActive;
+   boolLinkUpStatus;
+   boolTimerActive;
u32 StatisticsPointer;
struct sk_buff  *RxControlHead;
struct sk_buff  *RxControlTail;
@@ -249,22 +249,22 @@