Re: rtlwifi: rtl8723be: Fix bug in ant_sel code from commit c18d8f509571

2016-11-18 Thread Kalle Valo
Larry Finger  wrote:
> From: Ping-Ke Shih 
> 
> In commit c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module
> parameter"), wifi was fixed for those laptops that have only a single
> antenna but have an incorrectly coded EEPROM. This error causes the
> driver to select the wrong antenna. In that commit, one necessary change
> that affects Bluetooth operation was missed.
> 
> Fixes: c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module 
> parameter")
> Signed-off-by: Ping-Ke Shih 
> Signed-off-by: Larry Finger 
> Cc: Stable 

Requested by Larry

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/patch/9434985/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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


[PATCH v2 2/2] staging: dgnc: dgnc_sysfs.c Delete blank line

2016-11-18 Thread Walt Feasel
Make modification to remove extra blank line

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_sysfs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 6e8c53b..d41517c 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -701,4 +701,3 @@ void dgnc_remove_tty_sysfs(struct device *c)
 {
sysfs_remove_group(&c->kobj, &dgnc_tty_attribute_group);
 }
-
-- 
2.1.4

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


[PATCH v2 1/2] staging: dgnc: dgnc_sysfs.c Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications to comment style

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 290bf6e..6e8c53b 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -334,7 +334,8 @@ static ssize_t ports_txcount_show(struct device *p,
 }
 static DEVICE_ATTR_RO(ports_txcount);
 
-/* this function creates the sys files that will export each signal status
+/*
+ * this function creates the sys files that will export each signal status
  * to sysfs each value will be put in a separate filename
  */
 void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
-- 
2.1.4

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


[PATCH v2 0/2] staging: dgnc: dgnc_sysfs.c checkpatch modifications

2016-11-18 Thread Walt Feasel
Make Linux kernel coding style modifications for dgnc_sysfs.c to include:

Comment style modifications
Remove blank line 

Walt Feasel (2):
  staging: dgnc: dgnc_sysfs.c Comment style modifications
  staging: dgnc: dgnc_sysfs.c Delete blank line

 drivers/staging/dgnc/dgnc_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
v2 makes changes to correct for email format patch submission 
2.1.4

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


[PATCH 1/2] staging: dgnc: dgnc_neo.h Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications for comment style

Signed-off-by: Walt Feasel 
---
 drivers/staging/dgnc/dgnc_neo.h | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h
index 97f0386..1aa9325 100644
--- a/drivers/staging/dgnc/dgnc_neo.h
+++ b/drivers/staging/dgnc/dgnc_neo.h
@@ -18,14 +18,13 @@
 
 #include "dgnc_driver.h"
 
-/
- * Per channel/port NEO UART structure *
- 
- * Base Structure Entries Usage Meanings to Host   *
- * *
- * W = read write  R = read only   *
- * U = Unused. *
- /
+/*
+ * Per channel/port NEO UART structure
+ * Base Structure Entries Usage Meanings to Host
+ *
+ * W = read write  R = read only
+ * U = Unused.
+ */
 
 struct neo_uart_struct {
u8 txrx;/* WR  RHR/THR - Holding Reg */
@@ -48,9 +47,9 @@ struct neo_uart_struct {
u8 xonchar2;/* WR  XON 2 - XOn Character 2 Reg */
 
u8 reserved1[0x2ff - 0x200]; /* U   Reserved by Exar */
-   u8 txrxburst[64];   /* RW  64 bytes of RX/TX FIFO Data */
+   u8 txrxburst[64];/* RW  64 bytes of RX/TX FIFO Data */
u8 reserved2[0x37f - 0x340]; /* U   Reserved by Exar */
-   u8 rxburst_with_errors[64]; /* R  64 bytes of RX FIFO Data + LSR */
+   u8 rxburst_with_errors[64];  /* R  64 bytes of RX FIFO Data + LSR */
 };
 
 /* Where to read the extended interrupt register (32bits instead of 8bits) */
@@ -152,9 +151,8 @@ struct neo_uart_struct {
 #define UART_17158_IER_RTSDTR  0x40/* Output Interrupt Enable */
 #define UART_17158_IER_CTSDSR  0x80/* Input Interrupt Enable */
 
-/*
- * Our Global Variables
- */
+/* Our Global Variables */
+
 extern struct board_ops dgnc_neo_ops;
 
 #endif
-- 
2.1.4

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


[PATCH 2/2] staging: dgnc: dgnc_neo.h Spelling correction

2016-11-18 Thread Walt Feasel
Make spelling correction for 'control'

Signed-off-by: Walt Feasel 
---
 drivers/staging/dgnc/dgnc_neo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h
index 1aa9325..77ecd9b 100644
--- a/drivers/staging/dgnc/dgnc_neo.h
+++ b/drivers/staging/dgnc/dgnc_neo.h
@@ -137,7 +137,7 @@ struct neo_uart_struct {
 #define UART_17158_EFR_IXON0x2 /* Receiver compares Xon1/Xoff1 */
 #define UART_17158_EFR_IXOFF   0x8 /* Transmit Xon1/Xoff1 */
 #define UART_17158_EFR_RTSDTR  0x40/* Auto RTS/DTR Flow Control Enable */
-#define UART_17158_EFR_CTSDSR  0x80/* Auto CTS/DSR Flow COntrol Enable */
+#define UART_17158_EFR_CTSDSR  0x80/* Auto CTS/DSR Flow Control Enable */
 
 #define UART_17158_XOFF_DETECT 0x1 /* Indicates whether chip saw an
 * incoming XOFF char
-- 
2.1.4

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


[PATCH 0/2] staging: dgnc: dgnc_neo.h checkpatch modifications

2016-11-18 Thread Walt Feasel
Make Linux kernel coding style modifications for dgnc_neo.h to include:

Spelling correction
Comment style modifications

Walt Feasel (2):
  staging: dgnc: dgnc_neo.h Comment style modifications
  staging: dgnc: dgnc_neo.h Spelling correction

 drivers/staging/dgnc/dgnc_neo.h | 26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

-- 
2.1.4

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


[PATCH v2] staging: dgnc: dgnc_neo.c Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications for comment style

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_neo.c | 111 +++-
 1 file changed, 54 insertions(+), 57 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 5becb37..3eefefe 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -107,7 +107,8 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Because Exar's spec says we have to zero it
+   /*
+* Why? Because Exar's spec says we have to zero it
 * out before setting it
 */
writeb(0, &ch->ch_neo_uart->efr);
@@ -145,7 +146,8 @@ static inline void neo_set_rts_flow_control(struct 
channel_t *ch)
ier &= ~UART_17158_IER_XOFF;
efr &= ~UART_17158_EFR_IXOFF;
 
-   /* Why? Because Exar's spec says we have to zero it
+   /*
+* Why? Because Exar's spec says we have to zero it
 * out before setting it
 */
writeb(0, &ch->ch_neo_uart->efr);
@@ -185,7 +187,8 @@ static inline void neo_set_ixon_flow_control(struct 
channel_t *ch)
/* Turn on auto Xon flow control */
efr |= (UART_17158_EFR_ECB | UART_17158_EFR_IXON);
 
-   /* Why? Because Exar's spec says we have to zero it
+   /*
+* Why? Because Exar's spec says we have to zero it
 * out before setting it
 */
writeb(0, &ch->ch_neo_uart->efr);
@@ -225,7 +228,8 @@ static inline void neo_set_ixoff_flow_control(struct 
channel_t *ch)
ier |= UART_17158_IER_XOFF;
efr |= (UART_17158_EFR_ECB | UART_17158_EFR_IXOFF);
 
-   /* Why? Because Exar's spec says we have to zero it
+   /*
+* Why? Because Exar's spec says we have to zero it
 * out before setting it
 */
writeb(0, &ch->ch_neo_uart->efr);
@@ -268,7 +272,8 @@ static inline void neo_set_no_input_flow_control(struct 
channel_t *ch)
else
efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXOFF);
 
-   /* Why? Because Exar's spec says we have to zero
+   /*
+* Why? Because Exar's spec says we have to zero
 * it out before setting it
 */
writeb(0, &ch->ch_neo_uart->efr);
@@ -308,7 +313,8 @@ static inline void neo_set_no_output_flow_control(struct 
channel_t *ch)
else
efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXON);
 
-   /* Why? Because Exar's spec says we have to zero it
+   /*
+* Why? Because Exar's spec says we have to zero it
 * out before setting it
 */
writeb(0, &ch->ch_neo_uart->efr);
@@ -351,9 +357,8 @@ static inline void neo_set_new_start_stop_chars(struct 
channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
 }
 
-/*
- * No locks are assumed to be held when calling this function.
- */
+/* No locks are assumed to be held when calling this function. */
+
 static inline void neo_clear_break(struct channel_t *ch, int force)
 {
unsigned long flags;
@@ -381,9 +386,8 @@ static inline void neo_clear_break(struct channel_t *ch, 
int force)
spin_unlock_irqrestore(&ch->ch_lock, flags);
 }
 
-/*
- * Parse the ISR register.
- */
+/* Parse the ISR register. */
+
 static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
 {
struct channel_t *ch;
@@ -412,8 +416,8 @@ static inline void neo_parse_isr(struct dgnc_board *brd, 
uint port)
if (isr & (UART_17158_IIR_RDI_TIMEOUT | UART_IIR_RDI)) {
/* Read data from uart -> queue */
neo_copy_data_from_uart_to_queue(ch);
-
-   /* Call our tty layer to enforce queue
+   /*
+* Call our tty layer to enforce queue
 * flow control if needed.
 */
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -438,7 +442,8 @@ static inline void neo_parse_isr(struct dgnc_board *brd, 
uint port)
 * one it was, so we can suspend or resume data flow.
 */
if (cause == UART_17158_XON_DETECT) {
-   /* Is output stopped right now, if so,
+   /*
+* Is output stopped right now, if so,
 * resume it
 */
if (brd->channels[port]->ch_flags & CH_STOP) {
@@ -609,9 +614,8 @@ static void neo_param(struct tty_struct *tty)
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return;
 
-   /*
-* If baud rate is zero, flush queues, and set mval to drop DTR.
-*/
+   /* If baud rate is zero, flush queues, and set mval to d

[PATCH] staging: dgnc: dgnc_mgmt.c Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications for comment style

Signed-off-by: Walt Feasel 
---
 drivers/staging/dgnc/dgnc_mgmt.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 683c098..9d9b15d 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -13,13 +13,11 @@
  * PURPOSE.  See the GNU General Public License for more details.
  */
 
-/
- *
+/*
  * This file implements the mgmt functionality for the
  * Neo and ClassicBoard based product lines.
- *
- 
  */
+
 #include 
 #include 
 #include/* For jiffies, task states */
-- 
2.1.4

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


[PATCH v2 3/3] staging: dgnc: dgnc_driver.h Spelling correction

2016-11-18 Thread Walt Feasel
Make spelling correction for 'statements'

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 44662d5..63b50bf 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -27,7 +27,7 @@
 
 /* Driver defines */
 
-/* Driver identification and error statments */
+/* Driver identification and error statements */
 #definePROCSTR "dgnc"  /* /proc entries */
 #defineDEVSTR  "/dev/dg/dgnc"  /* /dev entries */
 #defineDRVSTR  "dgnc"  /* Driver name string */
-- 
2.1.4

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


[PATCH v2 0/3] checkpatch modifications dgnc_driver.h

2016-11-18 Thread Walt Feasel
Make Linux kernel coding style modifications for dgnc_driver.h to include:

Spelling correction
Comment style modifications
Align columns

Walt Feasel (3):
  staging: dgnc: dgnc_driver.h Comment style modifications
  staging: dgnc: dgnc_driver.h Align columns
  staging: dgnc: dgnc_driver.h Spelling correction

 drivers/staging/dgnc/dgnc_driver.h | 188 -
 1 file changed, 82 insertions(+), 106 deletions(-)

-- 
v2 makes changes to correct for email format patch submission
2.1.4

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


[PATCH v2 2/3] staging: dgnc: dgnc_driver.h Align columns

2016-11-18 Thread Walt Feasel
Make modifications to align columns

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_driver.h | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index aa95bbb..44662d5 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -251,7 +251,7 @@ struct un_t {
 #define CH_TX_FIFO_EMPTY 0x0400/* TX Fifo is completely empty 
*/
 #define CH_TX_FIFO_LWM  0x0800 /* TX Fifo is below Low Water */
 #define CH_BREAK_SENDING 0x1000/* Break is being sent */
-#define CH_LOOPBACK 0x2000 /* Channel is in lookback mode */
+#define CH_LOOPBACK0x2000  /* Channel is in lookback mode */
 #define CH_BAUD0   0x08000 /* Used for checking B0 transitions */
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped */
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped */
@@ -267,7 +267,7 @@ struct un_t {
 /* Channel information structure. */
 struct channel_t {
int magic;  /* Channel Magic Number */
-   struct dgnc_board   *ch_bd; /* Board structure pointer */
+   struct dgnc_board *ch_bd;   /* Board structure pointer */
struct digi_t   ch_digi;/* Transparent Print structure  */
struct un_t ch_tun; /* Terminal unit info */
struct un_t ch_pun; /* Printer unit info */
@@ -297,8 +297,8 @@ struct channel_t {
 
uintch_wopen;   /* Waiting for open process cnt */
 
-   unsigned char   ch_mostat;  /* FEP output modem status */
-   unsigned char   ch_mistat;  /* FEP input modem status */
+   unsigned char   ch_mostat;  /* FEP output modem status */
+   unsigned char   ch_mistat;  /* FEP input modem status */
 
struct neo_uart_struct __iomem *ch_neo_uart;/* Pointer to the
 * "mapped" UART struct
@@ -324,10 +324,10 @@ struct channel_t {
ulong   ch_rxcount; /* total of data received so far */
ulong   ch_txcount; /* total of data transmitted so far */
 
-   unsigned char   ch_r_tlevel;/* Receive Trigger level */
-   unsigned char   ch_t_tlevel;/* Transmit Trigger level */
+   unsigned char   ch_r_tlevel;/* Receive Trigger level */
+   unsigned char   ch_t_tlevel;/* Transmit Trigger level */
 
-   unsigned char   ch_r_watermark; /* Receive Watermark */
+   unsigned char   ch_r_watermark; /* Receive Watermark */
 
ulong   ch_stop_sending_break;  /* Time we should STOP
 * sending a break
@@ -358,8 +358,8 @@ extern int  dgnc_poll_tick; /* Poll 
interval - 20 ms */
 extern spinlock_t  dgnc_global_lock;   /* Driver global spinlock */
 extern spinlock_t  dgnc_poll_lock; /* Poll scheduling lock */
 extern uintdgnc_num_boards;/* Total number of boards */
-extern struct dgnc_board   *dgnc_board[MAXBOARDS]; /* Array of board
-* structs
-*/
+extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of board
+* structs
+*/
 
 #endif
-- 
2.1.4

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


[PATCH v2 1/3] staging: dgnc: dgnc_driver.h Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications to comment style

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_driver.h | 170 -
 1 file changed, 73 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 8792026..aa95bbb 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -12,11 +12,8 @@
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
  *
- *
- *
  * Driver includes
- *
- */
+ */
 
 #ifndef __DGNC_DRIVER_H
 #define __DGNC_DRIVER_H
@@ -28,17 +25,13 @@
 #include "digi.h"  /* Digi specific ioctl header */
 #include "dgnc_sysfs.h"/* Support for SYSFS */
 
-/*
- *
- * Driver defines
- *
- */
+/* Driver defines */
 
 /* Driver identification and error statments */
-#definePROCSTR "dgnc"  /* /proc entries
 */
-#defineDEVSTR  "/dev/dg/dgnc"  /* /dev entries 
 */
-#defineDRVSTR  "dgnc"  /* Driver name string   
 */
-#defineDG_PART "40002369_F"/* RPM part number  
 */
+#definePROCSTR "dgnc"  /* /proc entries */
+#defineDEVSTR  "/dev/dg/dgnc"  /* /dev entries */
+#defineDRVSTR  "dgnc"  /* Driver name string */
+#defineDG_PART "40002369_F"/* RPM part number */
 
 #define TRC_TO_CONSOLE 1
 
@@ -61,7 +54,8 @@
 #define PORT_NUM(dev)  ((dev) & 0x7f)
 #define IS_PRINT(dev)  (((dev) & 0xff) >= 0x80)
 
-/* MAX number of stop characters we will send
+/*
+ *MAX number of stop characters we will send
  * when our read queue is getting full
  */
 #define MAX_STOPS_SENT 5
@@ -88,35 +82,28 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-/*
- * All the possible states the driver can be while being loaded.
- */
+/* All the possible states the driver can be while being loaded. */
+
 enum {
DRIVER_INITIALIZED = 0,
DRIVER_READY
 };
 
-/*
- * All the possible states the board can be while booting up.
- */
+/* All the possible states the board can be while booting up. */
+
 enum {
BOARD_FAILED = 0,
BOARD_FOUND,
BOARD_READY
 };
 
-/*
- *
- * Structures and closely related defines.
- *
- */
+/* Structures and closely related defines. */
 
 struct dgnc_board;
 struct channel_t;
 
-/
- * Per board operations structure *
- /
+/* Per board operations structure */
+
 struct board_ops {
void (*tasklet)(unsigned long data);
irqreturn_t (*intr)(int irq, void *voidbrd);
@@ -138,16 +125,14 @@ struct board_ops {
void (*send_immediate_char)(struct channel_t *ch, unsigned char);
 };
 
-/
- * Device flag definitions for bd_flags.
- /
+/* Device flag definitions for bd_flags. */
+
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-/*
- * Per-board information
- */
+/* Per-board information */
+
 struct dgnc_board {
-   int magic;  /* Board Magic number.  */
+   int magic;  /* Board Magic number. */
int boardnum;   /* Board number: 0-32 */
 
int type;   /* Type of board */
@@ -220,62 +205,56 @@ struct dgnc_board {
 
 };
 
-/
- * Unit flag definitions for un_flags.
- /
-#define UN_ISOPEN  0x0001  /* Device is open   */
-#define UN_CLOSING 0x0002  /* Line is being closed */
-#define UN_IMM 0x0004  /* Service immediately  */
-#define UN_BUSY0x0008  /* Some work this channel   
*/
-#define UN_BREAKI  0x0010  /* Input break received */
+/* Unit flag definitions for un_flags. */
+#define UN_ISOPEN  0x0001  /* Device is open */
+#define UN_CLOSING 0x0002  /* Line is being closed */
+#define UN_IMM

Follow up on Ion from LPC

2016-11-18 Thread Laura Abbott
Hi,

At LPC, I proposed a moratorium on new Ion features because of issues
preventing Ion ever moving out of staging. Among other problems,
the Ion caching model hasn't made much progress to a solution that
is widely accepted and there are still problems with devicetree
support. There were no strong objections to this proposal so I
propose continuing with a moratorium for at least the next 6 months
to a year to actually work on a new architecture. If this hasn't
made much progress by then I plan to hand off Ion to someone else
to try other approaches.

There's been some discussion about a Unix Device Memory Allocator
https://github.com/cubanismo/allocator . Ideally, this would be
a complete replacement for Ion. This means capturing Ion or
Ion-like requirements. The current proposal mostly focuses on
userspace requirements and assumes Ion is just acting as an
enumerator of various memory to allocate. This is a good direction.
Ideally some of the Ion kernel code could be leveraged for a 'generic
device memory allocator'. This device allocator should also be
support use cases such as the SMAF (secure memory allocation
framework) which has also been a work in progress.

One of the big open problems, as mentioned above, is the caching
model. Specifying an uncached buffer at allocation time requires
doing cache operations outside of the DMA framework which makes
a bunch of maintainers unhappy. None of the arguments I've given
for justification have really stuck which is a good sign that Ion
should probably not be doing cache operations. If we ignore the Ion
page pooling feature, this could be fixed by requiring that drivers
call dma_buf_map and calling dma_map there. This gets tricker when
drivers want to call mmap from userspace before passing the buffer
down to ensure coherency. This model will need some more thought
and possibly integration with Android.

I'd like to keep using linaro-mm-sig as a mailing list for Ion
discussion as well as drivers-devel. If it would help to have
another place for tracking/discussion I can see about setting
that up as well.

Thanks,
Laura

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


[PATCH v2 0/3] staging: dgnc: dgnc_driver.c checkpatch modifications

2016-11-18 Thread Walt Feasel
Make Linux kernel coding style modifications for dgnc_driver.c to include:
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary before a close brace '}'
Comment style modifications

Walt Feasel (3):
  staging: dgnc: dgnc_driver.c Comment style modifications
  staging: dgnc: dgnc_driver.c Remove blank lines
  staging: dgnc: dgnc_driver.c Blank line before }

 drivers/staging/dgnc/dgnc_driver.c | 60 --
 1 file changed, 19 insertions(+), 41 deletions(-)

-- 
v2 makes changes to correct for email format patch submission
2.1.4

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


[PATCH v2 1/3] staging: dgnc: dgnc_driver.c Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications to comment styles

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_driver.c | 57 +-
 1 file changed, 20 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 6f2bffa..d232dd2 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -31,9 +31,8 @@ MODULE_AUTHOR("Digi International, http://www.digi.com";);
 MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI 
based product line");
 MODULE_SUPPORTED_DEVICE("dgnc");
 
-/*
- * File operations permitted on Control/Management major.
- */
+/* File operations permitted on Control/Management major. */
+
 static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
@@ -41,9 +40,8 @@ static const struct file_operations dgnc_board_fops = {
.release=   dgnc_mgmt_close
 };
 
-/*
- * Globals
- */
+/* Globals */
+
 uint   dgnc_num_boards;
 struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
@@ -51,14 +49,12 @@ DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
 uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
-/*
- * Static vars.
- */
+/* Static vars. */
+
 static struct class *dgnc_class;
 
-/*
- * Poller stuff
- */
+/* Poller stuff */
+
 static ulong   dgnc_poll_time; /* Time of next poll */
 static uintdgnc_poll_stop; /* Used to tell poller to stop */
 static struct timer_list dgnc_poll_timer;
@@ -101,9 +97,8 @@ static const struct board_id dgnc_ids[] = {
 
 
 
-/*
- * Remap PCI memory.
- */
+/* Remap PCI memory. */
+
 static int dgnc_do_remap(struct dgnc_board *brd)
 {
int rc = 0;
@@ -321,7 +316,6 @@ static void dgnc_free_irq(struct dgnc_board *brd)
 }
 
 /*
- *
  * Function:
  *
  *dgnc_poll_handler
@@ -343,7 +337,6 @@ static void dgnc_free_irq(struct dgnc_board *brd)
  *As each timer expires, it determines (a) whether the "transmit"
  *waiter needs to be woken up, and (b) whether the poller needs to
  *be rescheduled.
- *
  */
 
 static void dgnc_poll_handler(ulong dummy)
@@ -371,9 +364,8 @@ static void dgnc_poll_handler(ulong dummy)
spin_unlock_irqrestore(&brd->bd_lock, flags);
}
 
-   /*
-* Schedule ourself back at the nominal wakeup interval.
-*/
+   /* Schedule ourself back at the nominal wakeup interval. */
+
spin_lock_irqsave(&dgnc_poll_lock, flags);
dgnc_poll_time += dgnc_jiffies_from_ms(dgnc_poll_tick);
 
@@ -406,9 +398,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
if (IS_ERR(brd))
return PTR_ERR(brd);
 
-   /*
-* Do tty device initialization.
-*/
+   /* Do tty device initialization. */
 
rc = dgnc_tty_register(brd);
if (rc < 0) {
@@ -454,9 +444,8 @@ static struct pci_driver dgnc_driver = {
.id_table   = dgnc_pci_tbl,
 };
 
-/*
- * Start of driver.
- */
+/* Start of driver. */
+
 static int dgnc_start(void)
 {
int rc = 0;
@@ -566,11 +555,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
kfree(brd);
 }
 
-/
- *
- * Driver load/unload functions
- *
- /
+/* Driver load/unload functions */
 
 static void cleanup(bool sysfiles)
 {
@@ -619,17 +604,15 @@ static int __init dgnc_init_module(void)
 {
int rc;
 
-   /*
-* Initialize global stuff
-*/
+   /* Initialize global stuff */
+
rc = dgnc_start();
 
if (rc < 0)
return rc;
 
-   /*
-* Find and configure all the cards
-*/
+   /* Find and configure all the cards */
+
rc = pci_register_driver(&dgnc_driver);
if (rc) {
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or 
Classic boards found.\n");
-- 
2.1.4

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


[PATCH v2 3/3] staging: dgnc: dgnc_driver.c Blank line before }

2016-11-18 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: Blank lines aren't necessary before
a close brace '}'

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_driver.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index e80d2345..91c9047 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -579,7 +579,6 @@ static void cleanup(bool sysfiles)
dgnc_cleanup_tty(dgnc_board[i]);
dgnc_cleanup_board(dgnc_board[i]);
}
-
 }
 
 /*
-- 
2.1.4

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


[PATCH v2 2/3] staging: dgnc: dgnc_driver.c Remove blank lines

2016-11-18 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: Please don't use multiple blank lines

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_driver.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index d232dd2..e80d2345 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -95,8 +95,6 @@ static const struct board_id dgnc_ids[] = {
{   NULL,   0,  0   }
 };
 
-
-
 /* Remap PCI memory. */
 
 static int dgnc_do_remap(struct dgnc_board *brd)
@@ -626,5 +624,3 @@ static int __init dgnc_init_module(void)
 
 module_init(dgnc_init_module);
 module_exit(dgnc_cleanup_module);
-
-
-- 
2.1.4

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


[PATCH 3/6] staging: slicoss: logical continuations should be on the previous line

2016-11-18 Thread Sergio Paracuellos
Move logical or operator to previous line to comply with
the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slicoss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index f8b956f..4ea5df6 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -614,8 +614,8 @@ static void slic_mac_config(struct adapter *adapter)
value |= GMCR_GBIT;
 
/* enable fullduplex */
-   if ((adapter->linkduplex == LINK_FULLD)
-   || (adapter->macopts & MAC_LOOPBACK)) {
+   if ((adapter->linkduplex == LINK_FULLD) ||
+   (adapter->macopts & MAC_LOOPBACK)) {
value |= GMCR_FULLD;
}
 
-- 
1.9.1

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


[PATCH 4/6] staging: slicoss: braces should be used on all arms of this statement

2016-11-18 Thread Sergio Paracuellos
Add braces in if statement to comply with the standard
kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slicoss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index 4ea5df6..be62256 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -784,9 +784,9 @@ static void slic_timer_load_check(ulong cardaddr)
if ((adapter) && (adapter->state == ADAPT_UP) &&
(card->state == CARD_UP) && (slic_global.dynamic_intagg)) {
if (adapter->devid == SLIC_1GB_DEVICE_ID) {
-   if (adapter->linkspeed == LINK_1000MB)
+   if (adapter->linkspeed == LINK_1000MB) {
level = 100;
-   else {
+   } else {
if (load > SLIC_LOAD_5)
level = SLIC_INTAGG_5;
else if (load > SLIC_LOAD_4)
-- 
1.9.1

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


[PATCH 0/6] staging: slicoss: fix some style issues

2016-11-18 Thread Sergio Paracuellos
This patchset fix several style issues to comply with 
the standard kernel coding style.

Sergio Paracuellos (6):
  staging: slicoss: avoid CamelCases in slic.h
  staging: slicoss: fix parenthesis alignment in slicoss.c
  staging: slicoss: logical continuations should be on the previous line
  staging: slicoss: braces should be used on all arms of this statement
  staging: slicoss: avoid CamelCases in slichw.h
  staging: slicoss: avoid CamelCases slicoss.c

 drivers/staging/slicoss/slic.h|  30 +++---
 drivers/staging/slicoss/slichw.h  | 178 +-
 drivers/staging/slicoss/slicoss.c | 194 +++---
 3 files changed, 200 insertions(+), 202 deletions(-)

-- 
1.9.1

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


[PATCH 5/6] staging: slicoss: avoid CamelCases in slichw.h

2016-11-18 Thread Sergio Paracuellos
Replace CamelCases to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slichw.h  | 178 +++---
 drivers/staging/slicoss/slicoss.c |  56 ++--
 2 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/drivers/staging/slicoss/slichw.h b/drivers/staging/slicoss/slichw.h
index 49cb91a..541d158 100644
--- a/drivers/staging/slicoss/slichw.h
+++ b/drivers/staging/slicoss/slichw.h
@@ -245,18 +245,18 @@ struct slic_hddr_wds {
} hdrs_14port;
struct {
u32 frame_status;
-   u16 ByteCnt;
-   u16 TpChksum;
-   u16 CtxHash;
-   u16 MacHash;
-   u32 BufLnk;
+   u16 byte_cnt;
+   u16 tp_chksum;
+   u16 ctx_hash;
+   u16 mac_hash;
+   u32 buf_lnk;
} hdrs_gbit;
} u0;
 };
 
 #define frame_status14 u0.hdrs_14port.frame_status
 #define frame_status_b14   u0.hdrs_14port.frame_status_b
-#define frame_statusGB u0.hdrs_gbit.frame_status
+#define frame_status_gbu0.hdrs_gbit.frame_status
 
 struct slic_host64sg {
u32 paddrl;
@@ -460,7 +460,7 @@ struct slic_pnp_capabilities {
 };
 
 struct slic_config_mac {
-   u8 macaddrA[6];
+   u8 macaddr_a[6];
 };
 
 #define ATK_FRU_FORMAT 0x00
@@ -520,56 +520,56 @@ struct vendor4_fru {
  * SLIC EEPROM structure for Mojave
  */
 struct slic_eeprom {
-   u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
-   u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
-   u16 FlashSize;  /* 02 Flash size */
-   u16 EepromSize; /* 03 EEPROM Size */
-   u16 VendorId;   /* 04 Vendor ID */
-   u16 DeviceId;   /* 05 Device ID */
-   u8 RevisionId;  /* 06 Revision ID */
-   u8 ClassCode[3];/* 07 Class Code */
-   u8 DbgIntPin;   /* 08 Debug Interrupt pin */
-   u8 NetIntPin0;  /*Network Interrupt Pin */
-   u8 MinGrant;/* 09 Minimum grant */
-   u8 MaxLat;  /*Maximum Latency */
-   u16 PciStatus;  /* 10 PCI Status */
-   u16 SubSysVId;  /* 11 Subsystem Vendor Id */
-   u16 SubSysId;   /* 12 Subsystem ID */
-   u16 DbgDevId;   /* 13 Debug Device Id */
-   u16 DramRomFn;  /* 14 Dram/Rom function */
-   u16 DSize2Pci;  /* 15 DRAM size to PCI (bytes * 64K) */
-   u16 RSize2Pci;  /* 16 ROM extension size to PCI (bytes * 4k) */
-   u8 NetIntPin1;  /* 17 Network Interface Pin 1
+   u16 id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
+   u16 eecode_size;/* 01 Size of EEPROM Codes (bytes * 4)*/
+   u16 flash_size; /* 02 Flash size */
+   u16 eeprom_size;/* 03 EEPROM Size */
+   u16 vendor_id;  /* 04 Vendor ID */
+   u16 device_id;  /* 05 Device ID */
+   u8 revision_id; /* 06 Revision ID */
+   u8 class_code[3];   /* 07 Class Code */
+   u8 dbg_int_pin; /* 08 Debug Interrupt pin */
+   u8 net_int_pin0;/*Network Interrupt Pin */
+   u8 min_grant;   /* 09 Minimum grant */
+   u8 max_lat; /*Maximum Latency */
+   u16 pci_status; /* 10 PCI Status */
+   u16 sub_sys_vid;/* 11 Subsystem Vendor Id */
+   u16 sub_sys_id; /* 12 Subsystem ID */
+   u16 dbg_dev_id; /* 13 Debug Device Id */
+   u16 dram_rom_fn;/* 14 Dram/Rom function */
+   u16 dsize2pci;  /* 15 DRAM size to PCI (bytes * 64K) */
+   u16 rsize2pci;  /* 16 ROM extension size to PCI (bytes * 4k) */
+   u8 net_int_pin1;/* 17 Network Interface Pin 1
 *  (simba/leone only)
 */
-   u8 NetIntPin2;  /* Network Interface Pin 2 (simba/leone only)*/
+   u8 net_int_pin2;/* Network Interface Pin 2 (simba/leone only)*/
union {
-   u8 NetIntPin3;  /* 18 Network Interface Pin 3 (simba only) */
-   u8 FreeTime;/* FreeTime setting (leone/mojave only) */
+   u8 net_int_pin3;/* 18 Network Interface Pin 3 (simba only) */
+   u8 free_time;   /* FreeTime setting (leone/mojave only) */
} u1;
-   u8 TBIctl;  /* 10-bit interface control (Mojave only) */
-   u16 DramSize;   /* 19 DRAM size (bytes * 64k) */
+   u8 tbi_ctl; /* 10-bit interface control (Mojave only) */
+   u16 dram_size;  /* 19 DRAM size (bytes * 64k) */
union {
struct {
/* Mac Interface Specific portions */
-   

[PATCH 2/6] staging: slicoss: fix parenthesis alignment in slicoss.c

2016-11-18 Thread Sergio Paracuellos
This patch fix open parenthesis alignment matching in slicoss.c
file to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slicoss.c | 68 +++
 1 file changed, 33 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index db93654..f8b956f 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -191,7 +191,7 @@ static void slic_timer_ping(ulong dev)
  *
  */
 static void slic_link_config(struct adapter *adapter,
- u32 linkspeed, u32 linkduplex)
+u32 linkspeed, u32 linkduplex)
 {
u32 speed;
u32 duplex;
@@ -706,7 +706,7 @@ static void slic_config_clear(struct adapter *adapter)
 }
 
 static bool slic_mac_filter(struct adapter *adapter,
-   struct ether_header *ether_frame)
+   struct ether_header *ether_frame)
 {
struct net_device *netdev = adapter->netdev;
u32 opts = adapter->macopts;
@@ -829,10 +829,10 @@ static void slic_timer_load_check(ulong cardaddr)
 }
 
 static int slic_upr_queue_request(struct adapter *adapter,
-  u32 upr_request,
-  u32 upr_data,
-  u32 upr_data_h,
-  u32 upr_buffer, u32 upr_buffer_h)
+ u32 upr_request,
+ u32 upr_data,
+ u32 upr_data_h,
+ u32 upr_buffer, u32 upr_buffer_h)
 {
struct slic_upr *upr;
struct slic_upr *uprqueue;
@@ -898,19 +898,19 @@ static void slic_upr_start(struct adapter *adapter)
 }
 
 static int slic_upr_request(struct adapter *adapter,
-u32 upr_request,
-u32 upr_data,
-u32 upr_data_h,
-u32 upr_buffer, u32 upr_buffer_h)
+   u32 upr_request,
+   u32 upr_data,
+   u32 upr_data_h,
+   u32 upr_buffer, u32 upr_buffer_h)
 {
unsigned long flags;
int rc;
 
spin_lock_irqsave(&adapter->upr_lock, flags);
rc = slic_upr_queue_request(adapter,
-   upr_request,
-   upr_data,
-   upr_data_h, upr_buffer, upr_buffer_h);
+   upr_request,
+   upr_data,
+   upr_data_h, upr_buffer, upr_buffer_h);
if (rc)
goto err_unlock_irq;
 
@@ -1420,7 +1420,7 @@ static struct slic_hostcmd *slic_cmdq_getfree(struct 
adapter *adapter)
 }
 
 static void slic_cmdq_putdone_irq(struct adapter *adapter,
-   struct slic_hostcmd *cmd)
+ struct slic_hostcmd *cmd)
 {
struct slic_cmdqueue *cmdq = &adapter->cmdq_done;
 
@@ -1469,17 +1469,17 @@ static int slic_rcvqueue_fill(struct adapter *adapter)
__func__);
dev_err(dev, "skb[%p] PROBLEM\n", skb);
dev_err(dev, " skbdata[%p]\n",
-   skb->data);
+   skb->data);
dev_err(dev, " skblen[%x]\n", skb->len);
dev_err(dev, " paddr[%p]\n", paddr);
dev_err(dev, " paddrl[%x]\n", paddrl);
dev_err(dev, " paddrh[%x]\n", paddrh);
dev_err(dev, " rcvq->head[%p]\n",
-   rcvq->head);
+   rcvq->head);
dev_err(dev, " rcvq->tail[%p]\n",
-   rcvq->tail);
+   rcvq->tail);
dev_err(dev, " rcvq->count[%x]\n",
-   rcvq->count);
+   rcvq->count);
dev_err(dev, "SKIP THIS SKB\n");
goto retry_rcvqfill;
}
@@ -1489,17 +1489,17 @@ static int slic_rcvqueue_fill(struct adapter *adapter)
__func__);
dev_err(dev, "skb[%p] PROBLEM\n", skb);
dev_err(dev, " skbdata[%p]\n",
-   skb->data);
+   skb->data);
dev_err(dev, " skblen[%x]\n", skb->len);
  

[PATCH 6/6] staging: slicoss: avoid CamelCases slicoss.c

2016-11-18 Thread Sergio Paracuellos
Replace CamelCases to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slicoss.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index e43a339..b2f8ad3 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -629,15 +629,15 @@ static void slic_mac_config(struct adapter *adapter)
 static void slic_config_set(struct adapter *adapter, bool linkchange)
 {
u32 value;
-   u32 RcrReset;
+   u32 rcr_reset;
 
if (linkchange) {
/* Setup MAC */
slic_mac_config(adapter);
-   RcrReset = GRCR_RESET;
+   rcr_reset = GRCR_RESET;
} else {
slic_mac_address_config(adapter);
-   RcrReset = 0;
+   rcr_reset = 0;
}
 
if (adapter->linkduplex == LINK_FULLD) {
@@ -649,7 +649,7 @@ static void slic_config_set(struct adapter *adapter, bool 
linkchange)
slic_write32(adapter, SLIC_REG_WXCFG, value);
 
/* Setup rcvcfg last */
-   value = (RcrReset | /* Reset, if linkchange */
+   value = (rcr_reset |/* Reset, if linkchange */
 GRCR_CTLEN |   /* Enable CTL frames*/
 GRCR_ADDRAEN | /* Address A enable */
 GRCR_RCVBAD |  /* Rcv bad frames   */
@@ -662,7 +662,7 @@ static void slic_config_set(struct adapter *adapter, bool 
linkchange)
slic_write32(adapter, SLIC_REG_WXCFG, value);
 
/* Setup rcvcfg last */
-   value = (RcrReset | /* Reset, if linkchange */
+   value = (rcr_reset |/* Reset, if linkchange */
 GRCR_ADDRAEN | /* Address A enable */
 GRCR_RCVBAD |  /* Rcv bad frames   */
 (GRCR_HASHSIZE << GRCR_HASHSIZE_SHIFT));
@@ -2585,7 +2585,7 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
struct slic_shmemory *sm = &adapter->shmem;
struct slic_shmem_data *sm_data = sm->shmem_data;
struct slic_eeprom *peeprom;
-   struct oslic_eeprom *pOeeprom;
+   struct oslic_eeprom *poeeprom;
dma_addr_t phys_config;
u32 phys_configh;
u32 phys_configl;
@@ -2681,14 +2681,14 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
/* Oasis card */
case SLIC_2GB_DEVICE_ID:
/* extract EEPROM data and pointers to EEPROM data */
-   pOeeprom = (struct oslic_eeprom *)peeprom;
-   eecodesize = pOeeprom->eecode_size;
-   dramsize = pOeeprom->dram_size;
-   pmac = pOeeprom->mac_info;
-   fruformat = pOeeprom->fru_format;
-   patkfru = &pOeeprom->atk_fru;
-   oemfruformat = pOeeprom->oem_fru_format;
-   poemfru = &pOeeprom->oem_fru;
+   poeeprom = (struct oslic_eeprom *)peeprom;
+   eecodesize = poeeprom->eecode_size;
+   dramsize = poeeprom->dram_size;
+   pmac = poeeprom->mac_info;
+   fruformat = poeeprom->fru_format;
+   patkfru = &poeeprom->atk_fru;
+   oemfruformat = poeeprom->oem_fru_format;
+   poemfru = &poeeprom->oem_fru;
macaddrs = 2;
/*
 * Minor kludge for Oasis card
-- 
1.9.1

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


[PATCH 1/6] staging: slicoss: avoid CamelCases in slic.h

2016-11-18 Thread Sergio Paracuellos
Replace CamelCases to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slic.h| 30 +++
 drivers/staging/slicoss/slicoss.c | 50 +++
 2 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 420546d..3bb3441 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -52,8 +52,8 @@
 
 #define GB_RCVUCODE_VERS_STRING"1.2"
 #define GB_RCVUCODE_VERS_DATE  "2006/03/27 15:12:15"
-static u32 OasisRcvUCodeLen = 512;
-static u32 GBRcvUCodeLen = 512;
+static u32 oasis_rcv_ucode_len = 512;
+static u32 gb_rcv_ucode_len = 512;
 #define SECTION_SIZE 65536
 
 #define SLIC_RSPQ_PAGES_GB10
@@ -396,20 +396,20 @@ struct slic_upr {
 struct slic_ifevents {
uintoflow802;
uintuflow802;
-   uintTprtoflow;
+   uinttprtoflow;
uintrcvearly;
-   uintBufov;
-   uintCarre;
-   uintLonge;
-   uintInvp;
-   uintCrc;
-   uintDrbl;
-   uintCode;
-   uintIpHlen;
-   uintIpLen;
-   uintIpCsum;
-   uintTpCsum;
-   uintTpHlen;
+   uintbufov;
+   uintcarre;
+   uintlonge;
+   uintinvp;
+   uintcrc;
+   uintdrbl;
+   uintcode;
+   uintip_hlen;
+   uintip_len;
+   uintip_csum;
+   uinttp_csum;
+   uinttp_hlen;
 };
 
 struct adapter {
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index d2929b9..db93654 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -386,13 +386,13 @@ static int slic_card_download_gbrcv(struct adapter 
*adapter)
index += 4;
switch (adapter->devid) {
case SLIC_2GB_DEVICE_ID:
-   if (rcvucodelen != OasisRcvUCodeLen) {
+   if (rcvucodelen != oasis_rcv_ucode_len) {
release_firmware(fw);
return -EINVAL;
}
break;
case SLIC_1GB_DEVICE_ID:
-   if (rcvucodelen != GBRcvUCodeLen) {
+   if (rcvucodelen != gb_rcv_ucode_len) {
release_firmware(fw);
return -EINVAL;
}
@@ -1837,7 +1837,7 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (hdr->frame_status14 & VRHSTAT_802OE)
adapter->if_events.oflow802++;
if (hdr->frame_status14 & VRHSTAT_TPOFLO)
-   adapter->if_events.Tprtoflow++;
+   adapter->if_events.tprtoflow++;
if (hdr->frame_status_b14 & VRHSTATB_802UE)
adapter->if_events.uflow802++;
if (hdr->frame_status_b14 & VRHSTATB_RCVE) {
@@ -1845,45 +1845,45 @@ static void slic_rcv_handle_error(struct adapter 
*adapter,
netdev->stats.rx_fifo_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_BUFF) {
-   adapter->if_events.Bufov++;
+   adapter->if_events.bufov++;
netdev->stats.rx_over_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_CARRE) {
-   adapter->if_events.Carre++;
+   adapter->if_events.carre++;
netdev->stats.tx_carrier_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_LONGE)
-   adapter->if_events.Longe++;
+   adapter->if_events.longe++;
if (hdr->frame_status_b14 & VRHSTATB_PREA)
-   adapter->if_events.Invp++;
+   adapter->if_events.invp++;
if (hdr->frame_status_b14 & VRHSTATB_CRC) {
-   adapter->if_events.Crc++;
+   adapter->if_events.crc++;
netdev->stats.rx_crc_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_DRBL)
-   adapter->if_events.Drbl++;
+   adapter->if_events.drbl++;
if (hdr->frame_status_b14 & VRHSTATB_CODE)
-   adapter->if_events.Code++;
+   adapter->if_events.code++;
if (hdr->frame_status_b14 & VRHSTATB_TPCSUM)
-   adapter->if_events.TpCsum++;
+   adapter->if_events.tp_csum++;
if (hdr->frame_status_b14 & VRHSTATB_TPHLEN)
-   adapter->if_events.TpHlen++;
+   adapter->if_events.tp_hlen++;
if (hdr->frame_status_b14 & VR

[PATCH v4] staging: slicoss: fix different address space warnings

2016-11-18 Thread Sergio Paracuellos
This patchset fix the following sparse warning:
warning: incorrect type in assignment (different address spaces)

Changes in v2:
* Remove IOMEM_GET_FIELDADDR macro
* Add ioread64 and iowrite64 defines

Changes in v3:
* Remove ioread64 and iowrite64 defines
* Split into two patches: one for 32 bits stuff and the other for 64 bits.

Changes in v4:
* Undo all of previous changes and just remove __iomem annotation from 
field of struct because it is incorrect.

Sergio Paracuellos (1):
  staging: slicoss: fix different address space warnings

 drivers/staging/slicoss/slic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.9.1

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


[PATCH v4] staging: slicoss: fix different address space warnings

2016-11-18 Thread Sergio Paracuellos
Remove incorrect __iomem annotation.

This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 420546d..14d7555 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -380,7 +380,7 @@ struct slic_shmemory {
dma_addr_t isr_phaddr;
dma_addr_t lnkstatus_phaddr;
dma_addr_t stats_phaddr;
-   struct slic_shmem_data __iomem *shmem_data;
+   struct slic_shmem_data *shmem_data;
 };
 
 struct slic_upr {
-- 
1.9.1

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


[PATCH v2] staging: dgnc: dgnc_cls.c Comment style modifications

2016-11-18 Thread Walt Feasel
Make modifications to comment style format

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission
 drivers/staging/dgnc/dgnc_cls.c | 44 -
 1 file changed, 17 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index aedca66..c20ffdd 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -385,9 +385,8 @@ static void cls_copy_data_from_uart_to_queue(struct 
channel_t *ch)
ch->ch_rxcount++;
}
 
-   /*
-* Write new final heads to channel structure.
-*/
+   /* Write new final heads to channel structure. */
+
ch->ch_r_head = head & RQUEUEMASK;
ch->ch_e_head = head & EQUEUEMASK;
 
@@ -666,9 +665,8 @@ static void cls_param(struct tty_struct *tty)
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return;
 
-   /*
-* If baud rate is zero, flush queues, and set mval to drop DTR.
-*/
+   /* If baud rate is zero, flush queues, and set mval to drop DTR. */
+
if ((ch->ch_c_cflag & (CBAUD)) == 0) {
ch->ch_r_head = 0;
ch->ch_r_tail = 0;
@@ -887,9 +885,8 @@ static void cls_param(struct tty_struct *tty)
cls_parse_modem(ch, readb(&ch->ch_cls_uart->msr));
 }
 
-/*
- * Our board poller function.
- */
+/* Our board poller function. */
+
 static void cls_tasklet(unsigned long data)
 {
struct dgnc_board *bd = (struct dgnc_board *)data;
@@ -914,9 +911,8 @@ static void cls_tasklet(unsigned long data)
 */
spin_lock_irqsave(&bd->bd_intr_lock, flags);
 
-   /*
-* If board is ready, parse deeper to see if there is anything to do.
-*/
+   /* If board is ready, parse deeper to see if there is anything to do. */
+
if ((state == BOARD_READY) && (ports > 0)) {
/* Loop on each port */
for (i = 0; i < ports; i++) {
@@ -938,9 +934,8 @@ static void cls_tasklet(unsigned long data)
cls_copy_data_from_queue_to_uart(ch);
dgnc_wakeup_writes(ch);
 
-   /*
-* Check carrier function.
-*/
+   /* Check carrier function. */
+
dgnc_carrier(ch);
 
/*
@@ -992,9 +987,8 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)
for (i = 0; i < brd->nasync; i++)
cls_parse_isr(brd, i);
 
-   /*
-* Schedule tasklet to more in-depth servicing at a better time.
-*/
+   /* Schedule tasklet to more in-depth servicing at a better time. */
+
tasklet_schedule(&brd->helper_tasklet);
 
spin_unlock_irqrestore(&brd->bd_intr_lock, flags);
@@ -1043,9 +1037,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
un->un_flags |= UN_EMPTY;
spin_unlock_irqrestore(&ch->ch_lock, flags);
 
-   /*
-* NOTE: Do something with time passed in.
-*/
+   /* NOTE: Do something with time passed in. */
 
/* If ret is non-zero, user ctrl-c'ed us */
 
@@ -1112,9 +1104,8 @@ static void cls_uart_init(struct channel_t *ch)
readb(&ch->ch_cls_uart->msr);
 }
 
-/*
- * Turns off UART.
- */
+/* Turns off UART.  */
+
 static void cls_uart_off(struct channel_t *ch)
 {
writeb(0, &ch->ch_cls_uart->ier);
@@ -1160,9 +1151,8 @@ static void cls_send_break(struct channel_t *ch, int 
msecs)
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return;
 
-   /*
-* If we receive a time of 0, this means turn off the break.
-*/
+   /* If we receive a time of 0, this means turn off the break. */
+
if (msecs == 0) {
/* Turn break off, and unset some variables */
if (ch->ch_flags & CH_BREAK_SENDING) {
-- 
2.1.4

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


[PATCH v2] staging: dgnc: dgnc_cls.h Spelling correction

2016-11-18 Thread Walt Feasel
Make spelling correction for 'control'

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/dgnc/dgnc_cls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h
index 2597e36..463ad30 100644
--- a/drivers/staging/dgnc/dgnc_cls.h
+++ b/drivers/staging/dgnc/dgnc_cls.h
@@ -69,7 +69,7 @@ struct cls_uart_struct {
 #define UART_EXAR654_EFR_IXON 0x2 /* Receiver compares Xon1/Xoff1 */
 #define UART_EXAR654_EFR_IXOFF0x8 /* Transmit Xon1/Xoff1 */
 #define UART_EXAR654_EFR_RTSDTR   0x40/* Auto RTS/DTR Flow Control Enable 
*/
-#define UART_EXAR654_EFR_CTSDSR   0x80/* Auto CTS/DSR Flow COntrol Enable 
*/
+#define UART_EXAR654_EFR_CTSDSR   0x80/* Auto CTS/DSR Flow Control Enable 
*/
 #define UART_EXAR654_IER_XOFF 0x20/* Xoff Interrupt Enable */
 #define UART_EXAR654_IER_RTSDTR   0x40/* Output Interrupt Enable */
 #define UART_EXAR654_IER_CTSDSR   0x80/* Input Interrupt Enable */
-- 
2.1.4

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


[PATCH v3] staging: vme: vme_user.c Spelling corrections

2016-11-18 Thread Walt Feasel
Make spelling corrections for 'correctly' and
'unregister'

Signed-off-by: Walt Feasel 
Acked-by: Martyn Welch 
---
v2 Removed the previously submitted U.S. spelling for
'initialise' to keep the correct U.K. spelling.

v3 makes changes to correct for email format patch submission

 drivers/staging/vme/devices/vme_user.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 5dd430f..2753fb2 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -661,7 +661,7 @@ static int vme_user_probe(struct vme_dev *vdev)
}
class_destroy(vme_user_sysfs_class);
 
-   /* Ensure counter set correcty to unalloc all master windows */
+   /* Ensure counter set correctly to unalloc all master windows */
i = MASTER_MAX + 1;
 err_master:
while (i > MASTER_MINOR) {
@@ -671,7 +671,7 @@ static int vme_user_probe(struct vme_dev *vdev)
}
 
/*
-* Ensure counter set correcty to unalloc all slave windows and buffers
+* Ensure counter set correctly to unalloc all slave windows and buffers
 */
i = SLAVE_MAX + 1;
 err_slave:
@@ -716,7 +716,7 @@ static int vme_user_remove(struct vme_dev *dev)
/* Unregister device driver */
cdev_del(vme_user_cdev);
 
-   /* Unregiser the major and minor device numbers */
+   /* Unregister the major and minor device numbers */
unregister_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS);
 
return 0;
-- 
2.1.4

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


Re: [PATCH 32/35] staging: lustre: mount: fix lmd_parse() to handle commas in expr_list

2016-11-18 Thread Greg Kroah-Hartman
On Fri, Nov 18, 2016 at 04:54:03PM +, James Simmons wrote:
> 
> > > --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> > > +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> > > @@ -871,6 +871,87 @@ static int lmd_parse_mgs(struct lustre_mount_data 
> > > *lmd, char **ptr)
> > >   return 0;
> > >  }
> > >  
> > > +/**
> > > + * Find the first comma delimiter from the specified \a buf and make \a 
> > > *endh
> > > + * point to the string starting with the comma. The commas in expression 
> > > list
> > > + * [...] will be skipped.
> > > + *
> > > + * \param[in] bufa comma-separated string
> > > + * \param[in] endh   a pointer to a pointer that will point to the 
> > > string
> > > + *   starting with the comma
> > 
> > Please drop this mess of \param, it's not needed and is not kernel-doc
> > format.
> 
> Is it just the [in] mess that needs to be removed or does the doc style
> need to migrate to another format. Looking online doesn't reveal much and'
> I saw something about @arg format as well. I see both in tree. What is the
> right one to use and do clear docs on this format exist somewhere.

@arg is the correct one, see the file
Documentation/kernel-documentation.rst in the section, "How to format
kernel-doc comments" for how to do this properly.

thanks,

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


Re: [PATCH 32/35] staging: lustre: mount: fix lmd_parse() to handle commas in expr_list

2016-11-18 Thread James Simmons

> > --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> > +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> > @@ -871,6 +871,87 @@ static int lmd_parse_mgs(struct lustre_mount_data 
> > *lmd, char **ptr)
> > return 0;
> >  }
> >  
> > +/**
> > + * Find the first comma delimiter from the specified \a buf and make \a 
> > *endh
> > + * point to the string starting with the comma. The commas in expression 
> > list
> > + * [...] will be skipped.
> > + *
> > + * \param[in] buf  a comma-separated string
> > + * \param[in] endh a pointer to a pointer that will point to the string
> > + * starting with the comma
> 
> Please drop this mess of \param, it's not needed and is not kernel-doc
> format.

Is it just the [in] mess that needs to be removed or does the doc style
need to migrate to another format. Looking online doesn't reveal much and'
I saw something about @arg format as well. I see both in tree. What is the
right one to use and do clear docs on this format exist somewhere.

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


[PATCH v4] staging: lustre: llog: fix wrong offset in llog_process_thread()

2016-11-18 Thread James Simmons
From: Mikhail Pershin 

- llh_cat_idx may become bigger than llog bitmap size in
  llog_cat_set_first_idx() function
- it is wrong to use previous cur_offset as new buffer offset,
  new offset should be calculated from value returned by
  llog_next_block().
- optimize llog_skip_over() to find llog entry offset by index
  for llog with fixed-size records.

Signed-off-by: Mikhail Pershin 
Signed-off-by: Bob Glossman 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6714
Reviewed-on: http://review.whamcloud.com/15316
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6163
Reviewed-on: http://review.whamcloud.com/18819
Reviewed-by: John L. Hammond 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---

ChangeLog:

v1) Initial patch with umoddi issue
v2) Included fix from patch LU-6163 that fixed umoddi problem
v3) Remove no longer needed last_offset variable
v4) Remove extra debugging bit that got included by mistake

 drivers/staging/lustre/lustre/obdclass/llog.c |   82 +---
 2 files changed, 59 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c 
b/drivers/staging/lustre/lustre/obdclass/llog.c
index 3bc1789..ae63047 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog.c
@@ -217,8 +217,7 @@ static int llog_process_thread(void *arg)
struct llog_log_hdr *llh = loghandle->lgh_hdr;
struct llog_process_cat_data*cd  = lpi->lpi_catdata;
char*buf;
-   __u64cur_offset;
-   __u64last_offset;
+   u64 cur_offset, tmp_offset;
int chunk_size;
int  rc = 0, index = 1, last_index;
int  saved_index = 0;
@@ -229,6 +228,8 @@ static int llog_process_thread(void *arg)
 
cur_offset = llh->llh_hdr.lrh_len;
chunk_size = llh->llh_hdr.lrh_len;
+   /* expect chunk_size to be power of two */
+   LASSERT(is_power_of_2(chunk_size));
 
buf = libcfs_kvzalloc(chunk_size, GFP_NOFS);
if (!buf) {
@@ -245,38 +246,50 @@ static int llog_process_thread(void *arg)
else
last_index = LLOG_HDR_BITMAP_SIZE(llh) - 1;
 
-   /* Record is not in this buffer. */
-   if (index > last_index)
-   goto out;
-
while (rc == 0) {
+   unsigned int buf_offset = 0;
struct llog_rec_hdr *rec;
+   bool partial_chunk;
+   off_t chunk_offset;
 
/* skip records not set in bitmap */
while (index <= last_index &&
   !ext2_test_bit(index, LLOG_HDR_BITMAP(llh)))
++index;
 
-   LASSERT(index <= last_index + 1);
-   if (index == last_index + 1)
+   if (index > last_index)
break;
-repeat:
+
CDEBUG(D_OTHER, "index: %d last_index %d\n",
   index, last_index);
-
+repeat:
/* get the buf with our target record; avoid old garbage */
memset(buf, 0, chunk_size);
-   last_offset = cur_offset;
rc = llog_next_block(lpi->lpi_env, loghandle, &saved_index,
 index, &cur_offset, buf, chunk_size);
if (rc)
goto out;
 
+   /*
+* NB: after llog_next_block() call the cur_offset is the
+* offset of the next block after read one.
+* The absolute offset of the current chunk is calculated
+* from cur_offset value and stored in chunk_offset variable.
+*/
+   tmp_offset = cur_offset;
+   if (do_div(tmp_offset, chunk_size)) {
+   partial_chunk = true;
+   chunk_offset = cur_offset & ~(chunk_size - 1);
+   } else {
+   partial_chunk = false;
+   chunk_offset = cur_offset - chunk_size;
+   }
+
/* NB: when rec->lrh_len is accessed it is already swabbed
 * since it is used at the "end" of the loop and the rec
 * swabbing is done at the beginning of the loop.
 */
-   for (rec = (struct llog_rec_hdr *)buf;
+   for (rec = (struct llog_rec_hdr *)(buf + buf_offset);
 (char *)rec < buf + chunk_size;
 rec = llog_rec_hdr_next(rec)) {
CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n",
@@ -288,13 +301,28 @@ static int llog_process_thread(void *arg)
CDEBUG(D_OTHER, "after swabbing, type=%#x idx=%d\n",
   rec->lrh_type, rec->lrh_index);
 
-   if (rec->lrh_index == 0) {
-   

[PATCH 07/10] staging: lustre: libcfs: remove whitespace in libcfs_fail.h

2016-11-18 Thread James Simmons
One last white space is still left in libcfs_fail.h. Lets
remove it.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_fail.h  |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index 6f019a4..73cbb47 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -73,7 +73,7 @@ static inline bool CFS_FAIL_PRECHECK(__u32 id)
 {
return cfs_fail_loc != 0 &&
   ((cfs_fail_loc & CFS_FAIL_MASK_LOC) == (id & CFS_FAIL_MASK_LOC) 
||
-   (cfs_fail_loc & id & CFS_FAULT));
+   (cfs_fail_loc & id & CFS_FAULT));
 }
 
 static inline int cfs_fail_check_set(__u32 id, __u32 value,
-- 
1.7.1

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


[PATCH 00/10] checkpatch fixes and style cleanups for libcfs headers

2016-11-18 Thread James Simmons
This patch set contains various cleanups that were reported
with checkpatch. Also remove the NULL and 0 comparisons which
is not kernel style. Lastly the uXX types are sorted out in
the libcfs headers. Only the macro mess is left that needs
cleaning up.

James Simmons (10):
  staging: lustre: libcfs: fixup all header block comments
  staging: lustre: libcfs: remove header's bare unsigned use
  staging: lustre: libcfs: name parameters for function prototypes
  staging: lustre: libcfs: remove blank line in header
  staging: lustre: libcfs: correct spelling in libcfs_cpu.h
  staging: lustre: libcfs: use bit macro in libcfs headers
  staging: lustre: libcfs: remove whitespace in libcfs_fail.h
  staging: lustre: libcfs: remove NULL comparisons in headers
  staging: lustre: libcfs: remove zero comparisons in headers
  staging: lustre: libcfs: use uXX instead of __uXX types in headers

 .../staging/lustre/include/linux/libcfs/curproc.h  |   20 +-
 .../staging/lustre/include/linux/libcfs/libcfs.h   |4 +-
 .../lustre/include/linux/libcfs/libcfs_cpu.h   |4 +-
 .../lustre/include/linux/libcfs/libcfs_crypto.h|   12 +-
 .../lustre/include/linux/libcfs/libcfs_fail.h  |   53 ---
 .../lustre/include/linux/libcfs/libcfs_hash.h  |  183 ++-
 .../lustre/include/linux/libcfs/libcfs_private.h   |   13 +-
 .../lustre/include/linux/libcfs/libcfs_string.h|   24 ++--
 .../lustre/include/linux/libcfs/libcfs_workitem.h  |4 +-
 .../lustre/include/linux/libcfs/linux/linux-cpu.h  |8 +-
 .../lustre/include/linux/libcfs/linux/linux-time.h |8 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |2 +-
 12 files changed, 179 insertions(+), 156 deletions(-)

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


[PATCH 02/10] staging: lustre: libcfs: remove header's bare unsigned use

2016-11-18 Thread James Simmons
Fixup the libcfs headers to use the proper unsigned int
instead of raw unsigned.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_hash.h  |   28 ++--
 .../lustre/include/linux/libcfs/libcfs_string.h|6 ++--
 .../lustre/include/linux/libcfs/linux/linux-cpu.h  |8 +++---
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index a4ca488..28937d5 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -297,8 +297,8 @@ struct cfs_hash_hlist_ops {
 
 struct cfs_hash_ops {
/** return hashed value from @key */
-   unsigned (*hs_hash)(struct cfs_hash *hs, const void *key,
-   unsigned mask);
+   unsigned int (*hs_hash)(struct cfs_hash *hs, const void *key,
+   unsigned int mask);
/** return key address of @hnode */
void *   (*hs_key)(struct hlist_node *hnode);
/** copy key from @hnode to @key */
@@ -461,7 +461,7 @@ struct cfs_hash_ops {
 }
 
 static inline unsigned
-cfs_hash_id(struct cfs_hash *hs, const void *key, unsigned mask)
+cfs_hash_id(struct cfs_hash *hs, const void *key, unsigned int mask)
 {
return hs->hs_ops->hs_hash(hs, key, mask);
 }
@@ -570,7 +570,7 @@ void cfs_hash_bd_get(struct cfs_hash *hs, const void *key,
 }
 
 static inline void
-cfs_hash_bd_index_set(struct cfs_hash *hs, unsigned index,
+cfs_hash_bd_index_set(struct cfs_hash *hs, unsigned int index,
  struct cfs_hash_bd *bd)
 {
bd->bd_bucket = hs->hs_buckets[index >> hs->hs_bkt_bits];
@@ -677,10 +677,10 @@ struct hlist_node *
 
 /* Hash init/cleanup functions */
 struct cfs_hash *
-cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
-   unsigned bkt_bits, unsigned extra_bytes,
-   unsigned min_theta, unsigned max_theta,
-   struct cfs_hash_ops *ops, unsigned flags);
+cfs_hash_create(char *name, unsigned int cur_bits, unsigned int max_bits,
+   unsigned int bkt_bits, unsigned int extra_bytes,
+   unsigned int min_theta, unsigned int max_theta,
+   struct cfs_hash_ops *ops, unsigned int flags);
 
 struct cfs_hash *cfs_hash_getref(struct cfs_hash *hs);
 void cfs_hash_putref(struct cfs_hash *hs);
@@ -725,7 +725,7 @@ typedef int (*cfs_hash_for_each_cb_t)(struct cfs_hash *hs,
 cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t, void *data);
 
 void
-cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned hindex,
+cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned int hindex,
cfs_hash_for_each_cb_t, void *data);
 int  cfs_hash_is_empty(struct cfs_hash *hs);
 __u64 cfs_hash_size_get(struct cfs_hash *hs);
@@ -813,9 +813,9 @@ static inline int __cfs_hash_theta(struct cfs_hash *hs)
  * Generic djb2 hash algorithm for character arrays.
  */
 static inline unsigned
-cfs_hash_djb2_hash(const void *key, size_t size, unsigned mask)
+cfs_hash_djb2_hash(const void *key, size_t size, unsigned int mask)
 {
-   unsigned i, hash = 5381;
+   unsigned int i, hash = 5381;
 
LASSERT(key != NULL);
 
@@ -829,7 +829,7 @@ static inline int __cfs_hash_theta(struct cfs_hash *hs)
  * Generic u32 hash algorithm.
  */
 static inline unsigned
-cfs_hash_u32_hash(const __u32 key, unsigned mask)
+cfs_hash_u32_hash(const __u32 key, unsigned int mask)
 {
return ((key * CFS_GOLDEN_RATIO_PRIME_32) & mask);
 }
@@ -838,9 +838,9 @@ static inline int __cfs_hash_theta(struct cfs_hash *hs)
  * Generic u64 hash algorithm.
  */
 static inline unsigned
-cfs_hash_u64_hash(const __u64 key, unsigned mask)
+cfs_hash_u64_hash(const __u64 key, unsigned int mask)
 {
-   return ((unsigned)(key * CFS_GOLDEN_RATIO_PRIME_64) & mask);
+   return ((unsigned int)(key * CFS_GOLDEN_RATIO_PRIME_64) & mask);
 }
 
 /** iterate over all buckets in @bds (array of struct cfs_hash_bd) */
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index 56341d9..f5a434d 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -74,8 +74,8 @@ struct cfs_expr_list {
 
 char *cfs_trimwhite(char *str);
 int cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res);
-int cfs_str2num_check(char *str, int nob, unsigned *num,
- unsigned min, unsigned max);
+int cfs_str2num_check(char *str, int nob, unsigned int *num,
+ unsigned int min, unsigned int max);
 int cfs_expr_list_match(__u32 value, struct cfs_expr_list *expr_list);
 int cfs_expr_list_print(char *buffer, int count,
struct cfs_expr_list *expr_list);
@@ -93,7 +93,7 @@ int cfs_expr_list_values(stru

[PATCH 10/10] staging: lustre: libcfs: use uXX instead of __uXX types in headers

2016-11-18 Thread James Simmons
The types __[u|s]XX is only used for UAPI headers and userspace.
Only keep these types for the libcfs headers that are UAPI
headers. The rest convert to the standard uXX types.

Signed-off-by: James Simmons 
---
 .../staging/lustre/include/linux/libcfs/curproc.h  |2 +-
 .../lustre/include/linux/libcfs/libcfs_cpu.h   |2 +-
 .../lustre/include/linux/libcfs/libcfs_fail.h  |   12 +++---
 .../lustre/include/linux/libcfs/libcfs_hash.h  |   46 ++--
 .../lustre/include/linux/libcfs/libcfs_string.h|   12 +++---
 .../lustre/include/linux/libcfs/linux/linux-time.h |8 ++--
 6 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/curproc.h 
b/drivers/staging/lustre/include/linux/libcfs/curproc.h
index 6469a67..1ea27c9 100644
--- a/drivers/staging/lustre/include/linux/libcfs/curproc.h
+++ b/drivers/staging/lustre/include/linux/libcfs/curproc.h
@@ -53,7 +53,7 @@
 #define current_pid()  (current->pid)
 #define current_comm() (current->comm)
 
-typedef __u32 cfs_cap_t;
+typedef u32 cfs_cap_t;
 
 #define CFS_CAP_CHOWN 0
 #define CFS_CAP_DAC_OVERRIDE   1
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
index 61bd951..6d8752a 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
@@ -92,7 +92,7 @@ struct cfs_cpt_table {
/* node mask */
nodemask_t  ctb_nodemask;
/* version */
-   __u64   ctb_version;
+   u64 ctb_version;
 };
 
 static inline cpumask_t *
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index 129047e..fedb46d 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -39,8 +39,8 @@
 extern wait_queue_head_t cfs_race_waitq;
 extern int cfs_race_state;
 
-int __cfs_fail_check_set(__u32 id, __u32 value, int set);
-int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set);
+int __cfs_fail_check_set(u32 id, u32 value, int set);
+int __cfs_fail_timeout_set(u32 id, u32 value, int ms, int set);
 
 enum {
CFS_FAIL_LOC_NOSET  = 0,
@@ -69,14 +69,14 @@ enum {
 
 #define CFS_FAULT  0x0200 /* match any CFS_FAULT_CHECK */
 
-static inline bool CFS_FAIL_PRECHECK(__u32 id)
+static inline bool CFS_FAIL_PRECHECK(u32 id)
 {
return cfs_fail_loc &&
   ((cfs_fail_loc & CFS_FAIL_MASK_LOC) == (id & CFS_FAIL_MASK_LOC) 
||
(cfs_fail_loc & id & CFS_FAULT));
 }
 
-static inline int cfs_fail_check_set(__u32 id, __u32 value,
+static inline int cfs_fail_check_set(u32 id, u32 value,
 int set, int quiet)
 {
int ret = 0;
@@ -130,7 +130,7 @@ static inline int cfs_fail_check_set(__u32 id, __u32 value,
 #define CFS_FAIL_CHECK_RESET_QUIET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_RESET, 1)
 
-static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
+static inline int cfs_fail_timeout_set(u32 id, u32 value, int ms, int set)
 {
if (unlikely(CFS_FAIL_PRECHECK(id)))
return __cfs_fail_timeout_set(id, value, ms, set);
@@ -166,7 +166,7 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 
value, int ms, int set)
  * sleep. The next thread that calls with the same fail_loc wakes up
  * the first and continues.
  */
-static inline void cfs_race(__u32 id)
+static inline void cfs_race(u32 id)
 {
if (CFS_FAIL_PRECHECK(id)) {
if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) {
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 6231f47..0cc2fc4 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -89,8 +89,8 @@
  */
 struct cfs_hash_bucket {
union cfs_hash_lock hsb_lock;   /**< bucket lock */
-   __u32   hsb_count;  /**< current entries */
-   __u32   hsb_version;/**< change version */
+   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 */
@@ -156,7 +156,7 @@ enum cfs_hash_tag {
 */
CFS_HASH_NBLK_CHANGE= BIT(13),
/**
-* NB, we typed hs_flags as  __u16, please change it
+* NB, we typed hs_flags as  u16, please change it
 * if you need to extend >

[PATCH 09/10] staging: lustre: libcfs: remove zero comparisons in headers

2016-11-18 Thread James Simmons
Remove the zero comparisions in the libcfs headers.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_crypto.h|2 +-
 .../lustre/include/linux/libcfs/libcfs_fail.h  |4 +-
 .../lustre/include/linux/libcfs/libcfs_hash.h  |   32 ++--
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
index a0865e5..8f34c5d 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
@@ -137,7 +137,7 @@ static inline unsigned char cfs_crypto_hash_alg(const char 
*algname)
enum cfs_crypto_hash_alg hash_alg;
 
for (hash_alg = 0; hash_alg < CFS_HASH_ALG_MAX; hash_alg++)
-   if (strcmp(hash_types[hash_alg].cht_name, algname) == 0)
+   if (!strcmp(hash_types[hash_alg].cht_name, algname))
return hash_alg;
 
return CFS_HASH_ALG_UNKNOWN;
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index 73cbb47..129047e 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -71,7 +71,7 @@ enum {
 
 static inline bool CFS_FAIL_PRECHECK(__u32 id)
 {
-   return cfs_fail_loc != 0 &&
+   return cfs_fail_loc &&
   ((cfs_fail_loc & CFS_FAIL_MASK_LOC) == (id & CFS_FAIL_MASK_LOC) 
||
(cfs_fail_loc & id & CFS_FAULT));
 }
@@ -175,7 +175,7 @@ static inline void cfs_race(__u32 id)
cfs_race_state = 0;
CERROR("cfs_race id %x sleeping\n", id);
rc = wait_event_interruptible(cfs_race_waitq,
- cfs_race_state != 0);
+ !!cfs_race_state);
CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc);
} else {
CERROR("cfs_fail_race id %x waking\n", id);
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index d0ba3e0..6231f47 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -342,34 +342,34 @@ struct cfs_hash_ops {
 cfs_hash_with_no_lock(struct cfs_hash *hs)
 {
/* caller will serialize all operations for this hash-table */
-   return (hs->hs_flags & CFS_HASH_NO_LOCK) != 0;
+   return hs->hs_flags & CFS_HASH_NO_LOCK;
 }
 
 static inline int
 cfs_hash_with_no_bktlock(struct cfs_hash *hs)
 {
/* no bucket lock, one single lock to protect the hash-table */
-   return (hs->hs_flags & CFS_HASH_NO_BKTLOCK) != 0;
+   return hs->hs_flags & CFS_HASH_NO_BKTLOCK;
 }
 
 static inline int
 cfs_hash_with_rw_bktlock(struct cfs_hash *hs)
 {
/* rwlock to protect hash bucket */
-   return (hs->hs_flags & CFS_HASH_RW_BKTLOCK) != 0;
+   return hs->hs_flags & CFS_HASH_RW_BKTLOCK;
 }
 
 static inline int
 cfs_hash_with_spin_bktlock(struct cfs_hash *hs)
 {
/* spinlock to protect hash bucket */
-   return (hs->hs_flags & CFS_HASH_SPIN_BKTLOCK) != 0;
+   return hs->hs_flags & CFS_HASH_SPIN_BKTLOCK;
 }
 
 static inline int
 cfs_hash_with_add_tail(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_ADD_TAIL) != 0;
+   return hs->hs_flags & CFS_HASH_ADD_TAIL;
 }
 
 static inline int
@@ -380,55 +380,55 @@ struct cfs_hash_ops {
 * item can't be removed from hash unless it's
 * ZERO refcount
 */
-   return (hs->hs_flags & CFS_HASH_NO_ITEMREF) != 0;
+   return hs->hs_flags & CFS_HASH_NO_ITEMREF;
 }
 
 static inline int
 cfs_hash_with_bigname(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_BIGNAME) != 0;
+   return hs->hs_flags & CFS_HASH_BIGNAME;
 }
 
 static inline int
 cfs_hash_with_counter(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_COUNTER) != 0;
+   return hs->hs_flags & CFS_HASH_COUNTER;
 }
 
 static inline int
 cfs_hash_with_rehash(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_REHASH) != 0;
+   return hs->hs_flags & CFS_HASH_REHASH;
 }
 
 static inline int
 cfs_hash_with_rehash_key(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_REHASH_KEY) != 0;
+   return hs->hs_flags & CFS_HASH_REHASH_KEY;
 }
 
 static inline int
 cfs_hash_with_shrink(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_SHRINK) != 0;
+   return hs->hs_flags & CFS_HASH_SHRINK;
 }
 
 static inline int
 cfs_hash_with_assert_empty(struct cfs_hash *hs)
 {
-   return (hs->hs_flags & CFS_HASH_ASSERT_EMPTY) != 0;
+   return hs->hs_flags & CFS_HASH_ASSERT_EMPTY;
 }
 
 static inline int

[PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers

2016-11-18 Thread James Simmons
Remove the NULL comparisions in the libcfs headers.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_hash.h  |2 +-
 .../lustre/include/linux/libcfs/libcfs_private.h   |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 85661b3..d0ba3e0 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -818,7 +818,7 @@ static inline int __cfs_hash_theta(struct cfs_hash *hs)
 {
unsigned int i, hash = 5381;
 
-   LASSERT(key != NULL);
+   LASSERT(key);
 
for (i = 0; i < size; i++)
hash = hash * 33 + ((char *)key)[i];
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index 93bff1b..fc180b8 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -96,7 +96,7 @@
 
 #define LIBCFS_ALLOC_POST(ptr, size)   \
 do {   \
-   if (unlikely((ptr) == NULL)) {  \
+   if (!unlikely((ptr))) { \
CERROR("LNET: out of memory at %s:%d (tried to alloc '" \
   #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size));  \
} else {\
@@ -147,7 +147,7 @@
 
 #define LIBCFS_FREE(ptr, size)   \
 do {   \
-   if (unlikely((ptr) == NULL)) {\
+   if (!unlikely((ptr))) { \
CERROR("LIBCFS: free NULL '" #ptr "' (%d bytes) at "\
   "%s:%d\n", (int)(size), __FILE__, __LINE__); \
break;\
-- 
1.7.1

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


[PATCH 01/10] staging: lustre: libcfs: fixup all header block comments

2016-11-18 Thread James Simmons
Properly format the incorrect comments sections
that were reported by checkpatch.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_crypto.h|   10 --
 .../lustre/include/linux/libcfs/libcfs_fail.h  |   30 +--
 .../lustre/include/linux/libcfs/libcfs_hash.h  |   24 ++-
 .../lustre/include/linux/libcfs/libcfs_private.h   |5 ++-
 .../lustre/include/linux/libcfs/libcfs_string.h|6 ++-
 5 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
index 02be7d7..a0865e5 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
@@ -29,10 +29,12 @@
 #define _LIBCFS_CRYPTO_H
 
 struct cfs_crypto_hash_type {
-   char*cht_name;  /**< hash algorithm name, equal to
-* format name for crypto api */
-   unsigned intcht_key;/**< init key by default (valid for
-* 4 bytes context like crc32, adler */
+   char*cht_name;  /*< hash algorithm name, equal to
+* format name for crypto api
+*/
+   unsigned intcht_key;/*< init key by default (valid for
+* 4 bytes context like crc32, adler
+*/
unsigned intcht_size;   /**< hash digest size */
 };
 
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index bdbbe93..b1658c8 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -103,22 +103,28 @@ static inline int cfs_fail_check_set(__u32 id, __u32 
value,
 #define CFS_FAIL_CHECK_QUIET(id) \
cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET, 1)
 
-/* If id hit cfs_fail_loc and cfs_fail_val == (-1 or value) return 1,
- * otherwise return 0 */
+/*
+ * If id hit cfs_fail_loc and cfs_fail_val == (-1 or value) return 1,
+ * otherwise return 0
+ */
 #define CFS_FAIL_CHECK_VALUE(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 0)
 #define CFS_FAIL_CHECK_VALUE_QUIET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 1)
 
-/* If id hit cfs_fail_loc, cfs_fail_loc |= value and return 1,
- * otherwise return 0 */
+/*
+ * If id hit cfs_fail_loc, cfs_fail_loc |= value and return 1,
+ * otherwise return 0
+ */
 #define CFS_FAIL_CHECK_ORSET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 0)
 #define CFS_FAIL_CHECK_ORSET_QUIET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 1)
 
-/* If id hit cfs_fail_loc, cfs_fail_loc = value and return 1,
- * otherwise return 0 */
+/*
+ * If id hit cfs_fail_loc, cfs_fail_loc = value and return 1,
+ * otherwise return 0
+ */
 #define CFS_FAIL_CHECK_RESET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_RESET, 0)
 #define CFS_FAIL_CHECK_RESET_QUIET(id, value) \
@@ -138,8 +144,10 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 
value, int ms, int set)
 #define CFS_FAIL_TIMEOUT_MS(id, ms) \
cfs_fail_timeout_set(id, 0, ms, CFS_FAIL_LOC_NOSET)
 
-/* If id hit cfs_fail_loc, cfs_fail_loc |= value and
- * sleep seconds or milliseconds */
+/*
+ * If id hit cfs_fail_loc, cfs_fail_loc |= value and
+ * sleep seconds or milliseconds
+ */
 #define CFS_FAIL_TIMEOUT_ORSET(id, value, secs) \
cfs_fail_timeout_set(id, value, secs * 1000, CFS_FAIL_LOC_ORSET)
 
@@ -152,10 +160,12 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 
value, int ms, int set)
 #define CFS_FAULT_CHECK(id)\
CFS_FAIL_CHECK(CFS_FAULT | (id))
 
-/* The idea here is to synchronise two threads to force a race. The
+/*
+ * The idea here is to synchronise two threads to force a race. The
  * first thread that calls this with a matching fail_loc is put to
  * sleep. The next thread that calls with the same fail_loc wakes up
- * the first and continues. */
+ * the first and continues.
+ */
 static inline void cfs_race(__u32 id)
 {
 
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index f2b4399..a4ca488 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -57,8 +57,10 @@
 
 /** disable debug */
 #define CFS_HASH_DEBUG_NONE0
-/** record hash depth and output to console when it's too deep,
- *  computing overhead is low but consume more memory */
+/*
+ * record hash depth and output to console when it's too deep,
+ * computing overhead is low but consume more memory
+ */
 #defi

[PATCH 06/10] staging: lustre: libcfs: use bit macro in libcfs headers

2016-11-18 Thread James Simmons
Use the BIT macros instead of (1 << ***) in libcfs
headers.

Signed-off-by: James Simmons 
---
 .../staging/lustre/include/linux/libcfs/curproc.h  |   18 
 .../lustre/include/linux/libcfs/libcfs_fail.h  |4 +-
 .../lustre/include/linux/libcfs/libcfs_hash.h  |   42 ++--
 drivers/staging/lustre/lustre/obdclass/lu_object.c |2 +-
 4 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/curproc.h 
b/drivers/staging/lustre/include/linux/libcfs/curproc.h
index be0675d..6469a67 100644
--- a/drivers/staging/lustre/include/linux/libcfs/curproc.h
+++ b/drivers/staging/lustre/include/linux/libcfs/curproc.h
@@ -65,15 +65,15 @@
 #define CFS_CAP_SYS_BOOT  23
 #define CFS_CAP_SYS_RESOURCE  24
 
-#define CFS_CAP_FS_MASK ((1 << CFS_CAP_CHOWN) | \
-(1 << CFS_CAP_DAC_OVERRIDE) |\
-(1 << CFS_CAP_DAC_READ_SEARCH) |   \
-(1 << CFS_CAP_FOWNER) |\
-(1 << CFS_CAP_FSETID) |   \
-(1 << CFS_CAP_LINUX_IMMUTABLE) |   \
-(1 << CFS_CAP_SYS_ADMIN) |  \
-(1 << CFS_CAP_SYS_BOOT) |\
-(1 << CFS_CAP_SYS_RESOURCE))
+#define CFS_CAP_FS_MASK (BIT(CFS_CAP_CHOWN) |  \
+BIT(CFS_CAP_DAC_OVERRIDE) |\
+BIT(CFS_CAP_DAC_READ_SEARCH) | \
+BIT(CFS_CAP_FOWNER) |  \
+BIT(CFS_CAP_FSETID) |  \
+BIT(CFS_CAP_LINUX_IMMUTABLE) | \
+BIT(CFS_CAP_SYS_ADMIN) |   \
+BIT(CFS_CAP_SYS_BOOT) |\
+BIT(CFS_CAP_SYS_RESOURCE))
 
 void cfs_cap_raise(cfs_cap_t cap);
 void cfs_cap_lower(cfs_cap_t cap);
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index f06b4aa..6f019a4 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -55,11 +55,11 @@ enum {
 
 #define CFS_FAILED_BIT   30
 /* CFS_FAILED is 0x4000 */
-#define CFS_FAILED   (1 << CFS_FAILED_BIT)
+#define CFS_FAILED BIT(CFS_FAILED_BIT)
 
 #define CFS_FAIL_ONCE_BIT31
 /* CFS_FAIL_ONCE is 0x8000 */
-#define CFS_FAIL_ONCE   (1 << CFS_FAIL_ONCE_BIT)
+#define CFS_FAIL_ONCE  BIT(CFS_FAIL_ONCE_BIT)
 
 /* The following flags aren't made to be combined */
 #define CFS_FAIL_SKIP  0x2000 /* skip N times then fail */
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 2f56707..85661b3 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -125,36 +125,36 @@ enum cfs_hash_tag {
 *  . Some functions will be disabled with this flag, i.e:
 *cfs_hash_for_each_empty, cfs_hash_rehash
 */
-   CFS_HASH_NO_LOCK= 1 << 0,
+   CFS_HASH_NO_LOCK= BIT(0),
/** no bucket lock, use one spinlock to protect the whole hash */
-   CFS_HASH_NO_BKTLOCK = 1 << 1,
+   CFS_HASH_NO_BKTLOCK = BIT(1),
/** rwlock to protect bucket */
-   CFS_HASH_RW_BKTLOCK = 1 << 2,
+   CFS_HASH_RW_BKTLOCK = BIT(2),
/** spinlock to protect bucket */
-   CFS_HASH_SPIN_BKTLOCK   = 1 << 3,
+   CFS_HASH_SPIN_BKTLOCK   = BIT(3),
/** always add new item to tail */
-   CFS_HASH_ADD_TAIL   = 1 << 4,
+   CFS_HASH_ADD_TAIL   = BIT(4),
/** hash-table doesn't have refcount on item */
-   CFS_HASH_NO_ITEMREF = 1 << 5,
+   CFS_HASH_NO_ITEMREF = BIT(5),
/** big name for param-tree */
-   CFS_HASH_BIGNAME= 1 << 6,
+   CFS_HASH_BIGNAME= BIT(6),
/** track global count */
-   CFS_HASH_COUNTER= 1 << 7,
+   CFS_HASH_COUNTER= BIT(7),
/** rehash item by new key */
-   CFS_HASH_REHASH_KEY = 1 << 8,
+   CFS_HASH_REHASH_KEY = BIT(8),
/** Enable dynamic hash resizing */
-   CFS_HASH_REHASH = 1 << 9,
+   CFS_HASH_REHASH = BIT(9),
/** can shrink hash-size */
-   CFS_HASH_SHRINK = 1 << 10,
+   CFS_HASH_SHRINK = BIT(10),
/** assert hash is empty on exit */
-   CFS_HASH_ASSERT_EMPTY   = 1 << 11,
+   CFS_HASH_ASSERT_EMPTY   = BIT(11),
/** record hlist depth */
-   CFS_HASH_DEPTH  = 1 << 12,
+   CFS_HASH_DEPTH  = BIT(12),
/**
 * rehash is always scheduled in a different thread, so current
 * change on hash table is non-blocking
 */
-   CFS_HASH_NBLK_CHANG

[PATCH 05/10] staging: lustre: libcfs: correct spelling in libcfs_cpu.h

2016-11-18 Thread James Simmons
Spell the word destroy correctly.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_cpu.h   |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
index 81d8079..61bd951 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
@@ -211,7 +211,7 @@ void cfs_cpt_unset_nodemask(struct cfs_cpt_table *cptab,
  */
 void *cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size);
 /*
- * destory per-cpu-partition variable
+ * destroy per-cpu-partition variable
  */
 void cfs_percpt_free(void *vars);
 int cfs_percpt_number(void *vars);
-- 
1.7.1

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


[PATCH 04/10] staging: lustre: libcfs: remove blank line in header

2016-11-18 Thread James Simmons
The header libcfs_fail.h has a extra blank line that
is not needed.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_fail.h  |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index b1658c8..f06b4aa 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -168,7 +168,6 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 
value, int ms, int set)
  */
 static inline void cfs_race(__u32 id)
 {
-
if (CFS_FAIL_PRECHECK(id)) {
if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) {
int rc;
-- 
1.7.1

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


[PATCH 03/10] staging: lustre: libcfs: name parameters for function prototypes

2016-11-18 Thread James Simmons
Give the parameters names for the function
prototypes in the libcfs headers.

Signed-off-by: James Simmons 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |4 ++--
 .../lustre/include/linux/libcfs/libcfs_hash.h  |   15 ---
 .../lustre/include/linux/libcfs/libcfs_private.h   |4 ++--
 .../lustre/include/linux/libcfs/libcfs_workitem.h  |4 ++--
 4 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 3b92d38..70eb08e 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -61,7 +61,7 @@
 sigset_t cfs_block_allsigs(void);
 sigset_t cfs_block_sigs(unsigned long sigs);
 sigset_t cfs_block_sigsinv(unsigned long sigs);
-void cfs_restore_sigs(sigset_t);
+void cfs_restore_sigs(sigset_t sigset);
 void cfs_clear_sigpending(void);
 
 /*
@@ -71,7 +71,7 @@
 /* returns a random 32-bit integer */
 unsigned int cfs_rand(void);
 /* seed the generator */
-void cfs_srand(unsigned int, unsigned int);
+void cfs_srand(unsigned int seed1, unsigned int seed2);
 void cfs_get_random_bytes(void *buf, int size);
 
 #include "libcfs_debug.h"
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 28937d5..2f56707 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -708,25 +708,26 @@ typedef int (*cfs_hash_for_each_cb_t)(struct cfs_hash *hs,
 void *
 cfs_hash_lookup(struct cfs_hash *hs, const void *key);
 void
-cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each_cb_t, void *data);
+cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each_cb_t cb, void *data);
 void
-cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t, void 
*data);
+cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t cb,
+  void *data);
 int
-cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t,
+cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t cb,
 void *data, int start);
 int
-cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t,
+cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t cb,
void *data);
 void
 cfs_hash_for_each_key(struct cfs_hash *hs, const void *key,
- cfs_hash_for_each_cb_t, void *data);
+ cfs_hash_for_each_cb_t cb, void *data);
 typedef int (*cfs_hash_cond_opt_cb_t)(void *obj, void *data);
 void
-cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t, void *data);
+cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t cb, void *data);
 
 void
 cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned int hindex,
-   cfs_hash_for_each_cb_t, void *data);
+   cfs_hash_for_each_cb_t cb, void *data);
 int  cfs_hash_is_empty(struct cfs_hash *hs);
 __u64 cfs_hash_size_get(struct cfs_hash *hs);
 
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index 523e8f4..93bff1b 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -75,7 +75,7 @@
 
 #define KLASSERT(e) LASSERT(e)
 
-void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *);
+void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msg);
 
 #define LBUG()   \
 do {   \
@@ -170,7 +170,7 @@
 #endif
 
 void libcfs_run_upcall(char **argv);
-void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *);
+void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msg);
 void libcfs_debug_dumplog(void);
 int libcfs_debug_init(unsigned long bufsize);
 int libcfs_debug_cleanup(void);
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_workitem.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_workitem.h
index a7e1340..2accd9a 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_workitem.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_workitem.h
@@ -62,9 +62,9 @@
 
 struct cfs_wi_sched;
 
-void cfs_wi_sched_destroy(struct cfs_wi_sched *);
+void cfs_wi_sched_destroy(struct cfs_wi_sched *sched);
 int cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab, int cpt,
-   int nthrs, struct cfs_wi_sched **);
+   int nthrs, struct cfs_wi_sched **sched_pp);
 
 struct cfs_workitem;
 
-- 
1.7.1

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


Re: [PATCH 12/19] staging: lustre: libcfs: remove == 0 testing

2016-11-18 Thread James Simmons

> On Thu, Nov 17, 2016 at 02:35:50PM -0500, James Simmons wrote:
> > Testing == 0 is not kernel style so remove this
> > type of testing from libcfs.
> > 
> 
> That's not true.  Checkpatch.pl won't complain.
>

It got lumped in with the checkpatch fixes. Also the __uXX problem is not 
reported by checkpatch so this patch series covers checkpatch + style 
issues. 

> Not everyone has thought about it or agrees with me but there are time
> when == 0 is idiomatic.  For example, if you are talking about the
> *number* zero then it should probably be == 0.  If it's like "rc == 0"
> then "rc" doesn't mean the number it means success/fail so it should be
> "if (!rc) ".  But it's intuitive to say "if (len == 0) ".
> 
> The other place is strcmp() and friends where it's much more intuitive:
> 
>   strcmp(a, b) == 0 means a == b
>   strcmp(a, b) < 0 means a < b
>   strcmp(a, b) != 0 means a != b

Oh this I didn't know. I will keep this in mind for the future.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] staging: lustre: llog: fix wrong offset in llog_process_thread()

2016-11-18 Thread James Simmons

> On Thu, Nov 17, 2016 at 06:29:08PM -0500, James Simmons wrote:
> > From: Mikhail Pershin 
> > 
> > - llh_cat_idx may become bigger than llog bitmap size in
> >   llog_cat_set_first_idx() function
> > - it is wrong to use previous cur_offset as new buffer offset,
> >   new offset should be calculated from value returned by
> >   llog_next_block().
> > - optimize llog_skip_over() to find llog entry offset by index
> >   for llog with fixed-size records.
> > 
> > Signed-off-by: Mikhail Pershin 
> > Signed-off-by: Bob Glossman 
> > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6714
> > Reviewed-on: http://review.whamcloud.com/15316
> > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6163
> > Reviewed-on: http://review.whamcloud.com/18819
> > Reviewed-by: John L. Hammond 
> > Reviewed-by: James Simmons 
> > Reviewed-by: Oleg Drokin 
> > Signed-off-by: James Simmons 
> > ---
> > 
> > ChangeLog:
> > 
> > v1) Initial patch with umoddi issue
> > v2) Included fix from patch LU-6163 that fixed umoddi problem
> > v3) Remove no longer needed last_offset variable
> > 
> >  drivers/staging/lustre/lustre/obdclass/llog.c |   82 
> > +---
> >  include/linux/fs.h|2 +-
> >  2 files changed, 59 insertions(+), 25 deletions(-)
> > 
> > diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c 
> > b/drivers/staging/lustre/lustre/obdclass/llog.c
> > index 3bc1789..ae63047 100644
> > --- a/drivers/staging/lustre/lustre/obdclass/llog.c
> > +++ b/drivers/staging/lustre/lustre/obdclass/llog.c
> > @@ -217,8 +217,7 @@ static int llog_process_thread(void *arg)
> > struct llog_log_hdr *llh = loghandle->lgh_hdr;
> > struct llog_process_cat_data*cd  = lpi->lpi_catdata;
> > char*buf;
> > -   __u64cur_offset;
> > -   __u64last_offset;
> > +   u64 cur_offset, tmp_offset;
> > int chunk_size;
> > int  rc = 0, index = 1, last_index;
> > int  saved_index = 0;
> > @@ -229,6 +228,8 @@ static int llog_process_thread(void *arg)
> >  
> > cur_offset = llh->llh_hdr.lrh_len;
> > chunk_size = llh->llh_hdr.lrh_len;
> > +   /* expect chunk_size to be power of two */
> > +   LASSERT(is_power_of_2(chunk_size));
> >  
> > buf = libcfs_kvzalloc(chunk_size, GFP_NOFS);
> > if (!buf) {
> > @@ -245,38 +246,50 @@ static int llog_process_thread(void *arg)
> > else
> > last_index = LLOG_HDR_BITMAP_SIZE(llh) - 1;
> >  
> > -   /* Record is not in this buffer. */
> > -   if (index > last_index)
> > -   goto out;
> > -
> > while (rc == 0) {
> > +   unsigned int buf_offset = 0;
> > struct llog_rec_hdr *rec;
> > +   bool partial_chunk;
> > +   off_t chunk_offset;
> >  
> > /* skip records not set in bitmap */
> > while (index <= last_index &&
> >!ext2_test_bit(index, LLOG_HDR_BITMAP(llh)))
> > ++index;
> >  
> > -   LASSERT(index <= last_index + 1);
> > -   if (index == last_index + 1)
> > +   if (index > last_index)
> > break;
> > -repeat:
> > +
> > CDEBUG(D_OTHER, "index: %d last_index %d\n",
> >index, last_index);
> > -
> > +repeat:
> > /* get the buf with our target record; avoid old garbage */
> > memset(buf, 0, chunk_size);
> > -   last_offset = cur_offset;
> > rc = llog_next_block(lpi->lpi_env, loghandle, &saved_index,
> >  index, &cur_offset, buf, chunk_size);
> > if (rc)
> > goto out;
> >  
> > +   /*
> > +* NB: after llog_next_block() call the cur_offset is the
> > +* offset of the next block after read one.
> > +* The absolute offset of the current chunk is calculated
> > +* from cur_offset value and stored in chunk_offset variable.
> > +*/
> > +   tmp_offset = cur_offset;
> > +   if (do_div(tmp_offset, chunk_size)) {
> > +   partial_chunk = true;
> > +   chunk_offset = cur_offset & ~(chunk_size - 1);
> > +   } else {
> > +   partial_chunk = false;
> > +   chunk_offset = cur_offset - chunk_size;
> > +   }
> > +
> > /* NB: when rec->lrh_len is accessed it is already swabbed
> >  * since it is used at the "end" of the loop and the rec
> >  * swabbing is done at the beginning of the loop.
> >  */
> > -   for (rec = (struct llog_rec_hdr *)buf;
> > +   for (rec = (struct llog_rec_hdr *)(buf + buf_offset);
> >  (char *)rec < buf + chunk_size;
> >  rec = llog_rec_hdr_next(rec)) {
> > CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n

Re: [PATCH]: staging: Greybus: Remove unnecessary braces for single statement block

2016-11-18 Thread Rui Miguel Silva

Hi Rahul,
Thanks for the patch.
Now looks great.

On Fri, Nov 18, 2016 at 08:45:25PM +0530, Rahul Krishnan wrote:

This patch fixes the following checkpath.pl warning
WARNING: braces {} are not necessary for single statement blocks


Signed-off-by: Rahul Krishnan 


Reviewed-by: Rui Miguel Silva 


---
drivers/staging/greybus/sdio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index 5649ef1..66b37ea 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -191,9 +191,8 @@ static int _gb_sdio_process_events(struct gb_sdio_host 
*host, u8 event)
state_changed = 1;
}

-   if (event & GB_SDIO_WP) {
+   if (event & GB_SDIO_WP)
host->read_only = true;
-   }

if (state_changed) {
dev_info(mmc_dev(host->mmc), "card %s now event\n",
--
2.10.2


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


[PATCH]: staging: Greybus: Remove unnecessary braces for single statement block

2016-11-18 Thread Rahul Krishnan
This patch fixes the following checkpath.pl warning
WARNING: braces {} are not necessary for single statement blocks


Signed-off-by: Rahul Krishnan 
---
 drivers/staging/greybus/sdio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index 5649ef1..66b37ea 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -191,9 +191,8 @@ static int _gb_sdio_process_events(struct gb_sdio_host 
*host, u8 event)
state_changed = 1;
}
 
-   if (event & GB_SDIO_WP) {
+   if (event & GB_SDIO_WP)
host->read_only = true;
-   }
 
if (state_changed) {
dev_info(mmc_dev(host->mmc), "card %s now event\n",
-- 
2.10.2

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


Re: [PATCHv2]: staging: Greybus: Remove unnecessary braces for single statement block

2016-11-18 Thread Johan Hovold
On Fri, Nov 18, 2016 at 07:04:20PM +0530, Rahul Krishnan wrote:
> This patch fixes the following checkpath.pl warning
> WARNING: braces {} are not necessary for single statement blocks
> 
> Fixed indentation error, noted by Dan Carpenter
> 
> Signed-off-by: Rahul Krishnan 
> ---
>  drivers/staging/greybus/sdio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
> index f60b458..66b37ea 100644
> --- a/drivers/staging/greybus/sdio.c
> +++ b/drivers/staging/greybus/sdio.c
> @@ -192,7 +192,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host 
> *host, u8 event)
>   }
>  
>   if (event & GB_SDIO_WP)
> - host->read_only = true;
> + host->read_only = true;

You need to redo your original patch. This one instead looks like a
follow-up to your first revision (which actually removed the braces).

>  
>   if (state_changed) {
>   dev_info(mmc_dev(host->mmc), "card %s now event\n",

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


[PATCHv2]: staging: Greybus: Remove unnecessary braces for single statement block

2016-11-18 Thread Rahul Krishnan
This patch fixes the following checkpath.pl warning
WARNING: braces {} are not necessary for single statement blocks

Fixed indentation error, noted by Dan Carpenter

Signed-off-by: Rahul Krishnan 
---
 drivers/staging/greybus/sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index f60b458..66b37ea 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -192,7 +192,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host 
*host, u8 event)
}
 
if (event & GB_SDIO_WP)
-   host->read_only = true;
+   host->read_only = true;
 
if (state_changed) {
dev_info(mmc_dev(host->mmc), "card %s now event\n",
-- 
2.10.2

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


[PATCH] Staging: wlan-ng: prism2mgmt: Fixed operators spacing style issues

2016-11-18 Thread Shiva Kerdel
Fixed spaces around operators to fix their coding style issues.

Signed-off-by: Shiva Kerdel 
---
 drivers/staging/wlan-ng/prism2mgmt.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c 
b/drivers/staging/wlan-ng/prism2mgmt.c
index 16fb2d3..c558ad6 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -84,10 +84,10 @@
 #include "prism2mgmt.h"
 
 /* Converts 802.11 format rate specifications to prism2 */
-#define p80211rate_to_p2bit(n) n)&~BIT(7)) == 2) ? BIT(0) :  \
-(((n)&~BIT(7)) == 4) ? BIT(1) : \
-(((n)&~BIT(7)) == 11) ? BIT(2) : \
-(((n)&~BIT(7)) == 22) ? BIT(3) : 0)
+#define p80211rate_to_p2bit(n) n) & ~BIT(7)) == 2) ? BIT(0) :  \
+(((n) & ~BIT(7)) == 4) ? BIT(1) : \
+(((n) & ~BIT(7)) == 11) ? BIT(2) : \
+(((n) & ~BIT(7)) == 22) ? BIT(3) : 0)
 
 /*
  * prism2mgmt_scan
@@ -427,8 +427,8 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, 
void *msgp)
 #define REQBASICRATE(N) \
do { \
if ((count >= N) && DOT11_RATE5_ISBASIC_GET( \
-   item->supprates[(N)-1])) { \
-   req->basicrate ## N .data = item->supprates[(N)-1]; \
+   item->supprates[(N) - 1])) { \
+   req->basicrate ## N .data = item->supprates[(N) - 1]; \
req->basicrate ## N .status = \
P80211ENUM_msgitem_status_data_ok; \
} \
@@ -446,7 +446,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, 
void *msgp)
 #define REQSUPPRATE(N) \
do { \
if (count >= N) { \
-   req->supprate ## N .data = item->supprates[(N)-1]; \
+   req->supprate ## N .data = item->supprates[(N) - 1]; \
req->supprate ## N .status = \
P80211ENUM_msgitem_status_data_ok; \
} \
-- 
2.10.2

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


Re: [PATCH 12/19] staging: lustre: libcfs: remove == 0 testing

2016-11-18 Thread Dan Carpenter
On Thu, Nov 17, 2016 at 02:35:50PM -0500, James Simmons wrote:
> Testing == 0 is not kernel style so remove this
> type of testing from libcfs.
> 

That's not true.  Checkpatch.pl won't complain.

Not everyone has thought about it or agrees with me but there are time
when == 0 is idiomatic.  For example, if you are talking about the
*number* zero then it should probably be == 0.  If it's like "rc == 0"
then "rc" doesn't mean the number it means success/fail so it should be
"if (!rc) ".  But it's intuitive to say "if (len == 0) ".

The other place is strcmp() and friends where it's much more intuitive:

strcmp(a, b) == 0 means a == b
strcmp(a, b) < 0 means a < b
strcmp(a, b) != 0 means a != b

regards,
dan carpenter

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