linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] Staging: comedi: fix type issue in s626.c
@ 2016-03-10  6:52 Ravishankar Karkala Mallikarjunayya
  2016-03-10  6:52 ` [PATCH 2/5] Staging: comedi: fix WARNING " Ravishankar Karkala Mallikarjunayya
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2016-03-10  6:52 UTC (permalink / raw)
  To: abbotti
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel,
	Ravishankar Karkala Mallikarjunayya

This is a patch to the s626.c file that fixes up a type issues
found by the checkpatch.pl tool.

i.e Prefer kernel type 'u8' over 'uint8_t'
    Prefer kernel type 'u16' over 'uint16_t'
    Prefer kernel type 'u32' over 'uint32_t'
    Prefer kernel type 's16' over 'int16_t'
    Prefer kernel type 's32' over 'int32_t'

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
---
 drivers/staging/comedi/drivers/s626.c | 312 +++++++++++++++++-----------------
 1 file changed, 156 insertions(+), 156 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 35f0f67..5469ca0 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -75,24 +75,24 @@ struct s626_buffer_dma {
 };
 
 struct s626_private {
-	uint8_t ai_cmd_running;		/* ai_cmd is running */
+	u8 ai_cmd_running;		/* ai_cmd is running */
 	unsigned int ai_sample_timer;	/* time between samples in
 					 * units of the timer */
 	int ai_convert_count;		/* conversion counter */
 	unsigned int ai_convert_timer;	/* time between conversion in
 					 * units of the timer */
-	uint16_t counter_int_enabs;	/* counter interrupt enable mask
+	u16 counter_int_enabs;	/* counter interrupt enable mask
 					 * for MISC2 register */
-	uint8_t adc_items;		/* number of items in ADC poll list */
+	u8 adc_items;		/* number of items in ADC poll list */
 	struct s626_buffer_dma rps_buf;	/* DMA buffer used to hold ADC (RPS1)
 					 * program */
 	struct s626_buffer_dma ana_buf;	/* DMA buffer used to receive ADC data
 					 * and hold DAC data */
-	uint32_t *dac_wbuf;		/* pointer to logical adrs of DMA buffer
+	u32 *dac_wbuf;		/* pointer to logical adrs of DMA buffer
 					 * used to hold DAC data */
-	uint16_t dacpol;		/* image of DAC polarity register */
-	uint8_t trim_setpoint[12];	/* images of TrimDAC setpoints */
-	uint32_t i2c_adrs;		/* I2C device address for onboard EEPROM
+	u16 dacpol;		/* image of DAC polarity register */
+	u8 trim_setpoint[12];	/* images of TrimDAC setpoints */
+	u32 i2c_adrs;		/* I2C device address for onboard EEPROM
 					 * (board rev dependent) */
 };
 
@@ -179,7 +179,7 @@ static void s626_debi_transfer(struct comedi_device *dev)
 /*
  * Read a value from a gate array register.
  */
-static uint16_t s626_debi_read(struct comedi_device *dev, uint16_t addr)
+static u16 s626_debi_read(struct comedi_device *dev, u16 addr)
 {
 	/* Set up DEBI control register value in shadow RAM */
 	writel(S626_DEBI_CMD_RDWORD | addr, dev->mmio + S626_P_DEBICMD);
@@ -193,8 +193,8 @@ static uint16_t s626_debi_read(struct comedi_device *dev, uint16_t addr)
 /*
  * Write a value to a gate array register.
  */
-static void s626_debi_write(struct comedi_device *dev, uint16_t addr,
-			    uint16_t wdata)
+static void s626_debi_write(struct comedi_device *dev, u16 addr,
+			    u16 wdata)
 {
 	/* Set up DEBI control register value in shadow RAM */
 	writel(S626_DEBI_CMD_WRWORD | addr, dev->mmio + S626_P_DEBICMD);
@@ -241,7 +241,7 @@ static int s626_i2c_handshake_eoc(struct comedi_device *dev,
 	return -EBUSY;
 }
 
-static int s626_i2c_handshake(struct comedi_device *dev, uint32_t val)
+static int s626_i2c_handshake(struct comedi_device *dev, u32 val)
 {
 	unsigned int ctrl;
 	int ret;
@@ -267,8 +267,8 @@ static int s626_i2c_handshake(struct comedi_device *dev, uint32_t val)
 	return ctrl & S626_I2C_ERR;
 }
 
-/* Read uint8_t from EEPROM. */
-static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr)
+/* Read u8 from EEPROM. */
+static u8 s626_i2c_read(struct comedi_device *dev, u8 addr)
 {
 	struct s626_private *devpriv = dev->private;
 
@@ -288,7 +288,7 @@ static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr)
 	/*
 	 * Execute EEPROM read:
 	 *  Byte2 = I2C command: read from I2C EEPROM device.
-	 *  Byte1 receives uint8_t from EEPROM.
+	 *  Byte1 receives u8 from EEPROM.
 	 *  Byte0 = Not sent.
 	 */
 	if (s626_i2c_handshake(dev, S626_I2C_B2(S626_I2C_ATTRSTART,
@@ -304,10 +304,10 @@ static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr)
 /* ***********  DAC FUNCTIONS *********** */
 
 /* TrimDac LogicalChan-to-PhysicalChan mapping table. */
-static const uint8_t s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 };
+static const u8 s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 };
 
 /* TrimDac LogicalChan-to-EepromAdrs mapping table. */
-static const uint8_t s626_trimadrs[] = {
+static const u8 s626_trimadrs[] = {
 	0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63
 };
 
@@ -357,7 +357,7 @@ static int s626_send_dac_eoc(struct comedi_device *dev,
  * channel 2.  Assumes: (1) TSL2 slot records initialized, and (2)
  * dacpol contains valid target image.
  */
-static int s626_send_dac(struct comedi_device *dev, uint32_t val)
+static int s626_send_dac(struct comedi_device *dev, u32 val)
 {
 	struct s626_private *devpriv = dev->private;
 	int ret;
@@ -379,7 +379,7 @@ static int s626_send_dac(struct comedi_device *dev, uint32_t val)
 	/* TRANSFER OUTPUT DWORD VALUE INTO A2'S OUTPUT FIFO ---------------- */
 
 	/* Copy DAC setpoint value to DAC's output DMA buffer. */
-	/* writel(val, dev->mmio + (uint32_t)devpriv->dac_wbuf); */
+	/* writel(val, dev->mmio + (u32)devpriv->dac_wbuf); */
 	*devpriv->dac_wbuf = val;
 
 	/*
@@ -516,12 +516,12 @@ static int s626_send_dac(struct comedi_device *dev, uint32_t val)
  * Private helper function: Write setpoint to an application DAC channel.
  */
 static int s626_set_dac(struct comedi_device *dev,
-			uint16_t chan, int16_t dacdata)
+			u16 chan, s16 dacdata)
 {
 	struct s626_private *devpriv = dev->private;
-	uint16_t signmask;
-	uint32_t ws_image;
-	uint32_t val;
+	u16 signmask;
+	u32 ws_image;
+	u32 val;
 
 	/*
 	 * Adjust DAC data polarity and set up Polarity Control Register image.
@@ -535,7 +535,7 @@ static int s626_set_dac(struct comedi_device *dev,
 	}
 
 	/* Limit DAC setpoint value to valid range. */
-	if ((uint16_t)dacdata > 0x1FFF)
+	if ((u16)dacdata > 0x1FFF)
 		dacdata = 0x1FFF;
 
 	/*
@@ -575,23 +575,23 @@ static int s626_set_dac(struct comedi_device *dev,
 				 * (write to non-existent trimdac). */
 	val |= 0x00004000;	/* Address the two main dual-DAC devices
 				 * (TSL's chip select enables target device). */
-	val |= ((uint32_t)(chan & 1) << 15);	/* Address the DAC channel
+	val |= ((u32)(chan & 1) << 15);	/* Address the DAC channel
 						 * within the device. */
-	val |= (uint32_t)dacdata;	/* Include DAC setpoint data. */
+	val |= (u32)dacdata;	/* Include DAC setpoint data. */
 	return s626_send_dac(dev, val);
 }
 
 static int s626_write_trim_dac(struct comedi_device *dev,
-			       uint8_t logical_chan, uint8_t dac_data)
+			       u8 logical_chan, u8 dac_data)
 {
 	struct s626_private *devpriv = dev->private;
-	uint32_t chan;
+	u32 chan;
 
 	/*
 	 * Save the new setpoint in case the application needs to read it back
 	 * later.
 	 */
-	devpriv->trim_setpoint[logical_chan] = (uint8_t)dac_data;
+	devpriv->trim_setpoint[logical_chan] = (u8)dac_data;
 
 	/* Map logical channel number to physical channel number. */
 	chan = s626_trimchan[logical_chan];
@@ -602,16 +602,16 @@ static int s626_write_trim_dac(struct comedi_device *dev,
 	 * can be detected.
 	 */
 
-	/* Slot 2: Send high uint8_t to target TrimDac */
+	/* Slot 2: Send high u8 to target TrimDac */
 	writel(S626_XSD2 | S626_XFIFO_1 | S626_WS3,
 	       dev->mmio + S626_VECTPORT(2));
-	/* Slot 3: Send low uint8_t to target TrimDac */
+	/* Slot 3: Send low u8 to target TrimDac */
 	writel(S626_XSD2 | S626_XFIFO_0 | S626_WS3,
 	       dev->mmio + S626_VECTPORT(3));
-	/* Slot 4: Send NOP high uint8_t to DAC0 to keep clock running */
+	/* Slot 4: Send NOP high u8 to DAC0 to keep clock running */
 	writel(S626_XSD2 | S626_XFIFO_3 | S626_WS1,
 	       dev->mmio + S626_VECTPORT(4));
-	/* Slot 5: Send NOP low  uint8_t to DAC0 */
+	/* Slot 5: Send NOP low  u8 to DAC0 */
 	writel(S626_XSD2 | S626_XFIFO_2 | S626_WS1 | S626_EOS,
 	       dev->mmio + S626_VECTPORT(5));
 
@@ -633,7 +633,7 @@ static int s626_write_trim_dac(struct comedi_device *dev,
 
 static int s626_load_trim_dacs(struct comedi_device *dev)
 {
-	uint8_t i;
+	u8 i;
 	int ret;
 
 	/* Copy TrimDac setpoint values from EEPROM to TrimDacs. */
@@ -661,7 +661,7 @@ static int s626_load_trim_dacs(struct comedi_device *dev)
  * latches B.
  */
 static void s626_set_latch_source(struct comedi_device *dev,
-				  unsigned int chan, uint16_t value)
+				  unsigned int chan, u16 value)
 {
 	s626_debi_replace(dev, S626_LP_CRB(chan),
 			  ~(S626_CRBMSK_INTCTRL | S626_CRBMSK_LATCHSRC),
@@ -672,7 +672,7 @@ static void s626_set_latch_source(struct comedi_device *dev,
  * Write value into counter preload register.
  */
 static void s626_preload(struct comedi_device *dev,
-			 unsigned int chan, uint32_t value)
+			 unsigned int chan, u32 value)
 {
 	s626_debi_write(dev, S626_LP_CNTR(chan), value);
 	s626_debi_write(dev, S626_LP_CNTR(chan) + 2, value >> 16);
@@ -686,7 +686,7 @@ static void s626_preload(struct comedi_device *dev,
 static void s626_reset_cap_flags(struct comedi_device *dev,
 				 unsigned int chan)
 {
-	uint16_t set;
+	u16 set;
 
 	set = S626_SET_CRB_INTRESETCMD(1);
 	if (chan < 3)
@@ -702,12 +702,12 @@ static void s626_reset_cap_flags(struct comedi_device *dev,
  * Return counter setup in a format (COUNTER_SETUP) that is consistent
  * for both A and B counters.
  */
-static uint16_t s626_get_mode_a(struct comedi_device *dev,
-				unsigned int chan)
+static u16 s626_get_mode_a(struct comedi_device *dev,
+			   unsigned int chan)
 {
-	uint16_t cra;
-	uint16_t crb;
-	uint16_t setup;
+	u16 cra;
+	u16 crb;
+	u16 setup;
 	unsigned cntsrc, clkmult, clkpol, encmode;
 
 	/* Fetch CRA and CRB register images. */
@@ -757,12 +757,12 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev,
 	return setup;
 }
 
-static uint16_t s626_get_mode_b(struct comedi_device *dev,
-				unsigned int chan)
+static u16 s626_get_mode_b(struct comedi_device *dev,
+			   unsigned int chan)
 {
-	uint16_t cra;
-	uint16_t crb;
-	uint16_t setup;
+	u16 cra;
+	u16 crb;
+	u16 setup;
 	unsigned cntsrc, clkmult, clkpol, encmode;
 
 	/* Fetch CRA and CRB register images. */
@@ -817,8 +817,8 @@ static uint16_t s626_get_mode_b(struct comedi_device *dev,
 	return setup;
 }
 
-static uint16_t s626_get_mode(struct comedi_device *dev,
-			      unsigned int chan)
+static u16 s626_get_mode(struct comedi_device *dev,
+			 unsigned int chan)
 {
 	return (chan < 3) ? s626_get_mode_a(dev, chan)
 			  : s626_get_mode_b(dev, chan);
@@ -832,12 +832,12 @@ static uint16_t s626_get_mode(struct comedi_device *dev,
  * ClkPol, ClkEnab, IndexSrc, IndexPol, LoadSrc.
  */
 static void s626_set_mode_a(struct comedi_device *dev,
-			    unsigned int chan, uint16_t setup,
-			    uint16_t disable_int_src)
+			    unsigned int chan, u16 setup,
+			    u16 disable_int_src)
 {
 	struct s626_private *devpriv = dev->private;
-	uint16_t cra;
-	uint16_t crb;
+	u16 cra;
+	u16 crb;
 	unsigned cntsrc, clkmult, clkpol;
 
 	/* Initialize CRA and CRB images. */
@@ -910,12 +910,12 @@ static void s626_set_mode_a(struct comedi_device *dev,
 }
 
 static void s626_set_mode_b(struct comedi_device *dev,
-			    unsigned int chan, uint16_t setup,
-			    uint16_t disable_int_src)
+			    unsigned int chan, u16 setup,
+			    u16 disable_int_src)
 {
 	struct s626_private *devpriv = dev->private;
-	uint16_t cra;
-	uint16_t crb;
+	u16 cra;
+	u16 crb;
 	unsigned cntsrc, clkmult, clkpol;
 
 	/* Initialize CRA and CRB images. */
@@ -996,7 +996,7 @@ static void s626_set_mode_b(struct comedi_device *dev,
 
 static void s626_set_mode(struct comedi_device *dev,
 			  unsigned int chan,
-			  uint16_t setup, uint16_t disable_int_src)
+			  u16 setup, u16 disable_int_src)
 {
 	if (chan < 3)
 		s626_set_mode_a(dev, chan, setup, disable_int_src);
@@ -1008,7 +1008,7 @@ static void s626_set_mode(struct comedi_device *dev,
  * Return/set a counter's enable.  enab: 0=always enabled, 1=enabled by index.
  */
 static void s626_set_enable(struct comedi_device *dev,
-			    unsigned int chan, uint16_t enab)
+			    unsigned int chan, u16 enab)
 {
 	unsigned int mask = S626_CRBMSK_INTCTRL;
 	unsigned int set;
@@ -1024,10 +1024,10 @@ static void s626_set_enable(struct comedi_device *dev,
 }
 
 #ifdef unused
-static uint16_t s626_get_enable(struct comedi_device *dev,
-				unsigned int chan)
+static u16 s626_get_enable(struct comedi_device *dev,
+			   unsigned int chan)
 {
-	uint16_t crb = s626_debi_read(dev, S626_LP_CRB(chan));
+	u16 crb = s626_debi_read(dev, S626_LP_CRB(chan));
 
 	return (chan < 3) ? S626_GET_CRB_CLKENAB_A(crb)
 			  : S626_GET_CRB_CLKENAB_B(crb);
@@ -1035,8 +1035,8 @@ static uint16_t s626_get_enable(struct comedi_device *dev,
 #endif
 
 #ifdef unused
-static uint16_t s626_get_latch_source(struct comedi_device *dev,
-				      unsigned int chan)
+static u16 s626_get_latch_source(struct comedi_device *dev,
+				 unsigned int chan)
 {
 	return S626_GET_CRB_LATCHSRC(s626_debi_read(dev, S626_LP_CRB(chan)));
 }
@@ -1048,11 +1048,11 @@ static uint16_t s626_get_latch_source(struct comedi_device *dev,
  * 2=OverflowA (B counters only), 3=disabled.
  */
 static void s626_set_load_trig(struct comedi_device *dev,
-			       unsigned int chan, uint16_t trig)
+			       unsigned int chan, u16 trig)
 {
-	uint16_t reg;
-	uint16_t mask;
-	uint16_t set;
+	u16 reg;
+	u16 mask;
+	u16 set;
 
 	if (chan < 3) {
 		reg = S626_LP_CRA(chan);
@@ -1067,8 +1067,8 @@ static void s626_set_load_trig(struct comedi_device *dev,
 }
 
 #ifdef unused
-static uint16_t s626_get_load_trig(struct comedi_device *dev,
-				   unsigned int chan)
+static u16 s626_get_load_trig(struct comedi_device *dev,
+			      unsigned int chan)
 {
 	if (chan < 3)
 		return S626_GET_CRA_LOADSRC_A(s626_debi_read(dev,
@@ -1085,11 +1085,11 @@ static uint16_t s626_get_load_trig(struct comedi_device *dev,
  * 2=IndexOnly, 3=IndexAndOverflow.
  */
 static void s626_set_int_src(struct comedi_device *dev,
-			     unsigned int chan, uint16_t int_source)
+			     unsigned int chan, u16 int_source)
 {
 	struct s626_private *devpriv = dev->private;
-	uint16_t cra_reg = S626_LP_CRA(chan);
-	uint16_t crb_reg = S626_LP_CRB(chan);
+	u16 cra_reg = S626_LP_CRA(chan);
+	u16 crb_reg = S626_LP_CRB(chan);
 
 	if (chan < 3) {
 		/* Reset any pending counter overflow or index captures */
@@ -1101,7 +1101,7 @@ static void s626_set_int_src(struct comedi_device *dev,
 		s626_debi_replace(dev, cra_reg, ~S626_CRAMSK_INTSRC_A,
 				  S626_SET_CRA_INTSRC_A(int_source));
 	} else {
-		uint16_t crb;
+		u16 crb;
 
 		/* Cache writeable CRB register image */
 		crb = s626_debi_read(dev, crb_reg);
@@ -1139,8 +1139,8 @@ static void s626_set_int_src(struct comedi_device *dev,
 }
 
 #ifdef unused
-static uint16_t s626_get_int_src(struct comedi_device *dev,
-				 unsigned int chan)
+static u16 s626_get_int_src(struct comedi_device *dev,
+			    unsigned int chan)
 {
 	if (chan < 3)
 		return S626_GET_CRA_INTSRC_A(s626_debi_read(dev,
@@ -1156,9 +1156,9 @@ static uint16_t s626_get_int_src(struct comedi_device *dev,
  * Return/set the clock multiplier.
  */
 static void s626_set_clk_mult(struct comedi_device *dev,
-			      unsigned int chan, uint16_t value)
+			      unsigned int chan, u16 value)
 {
-	uint16_t mode;
+	u16 mode;
 
 	mode = s626_get_mode(dev, chan);
 	mode &= ~S626_STDMSK_CLKMULT;
@@ -1167,8 +1167,8 @@ static void s626_set_clk_mult(struct comedi_device *dev,
 	s626_set_mode(dev, chan, mode, false);
 }
 
-static uint16_t s626_get_clk_mult(struct comedi_device *dev,
-				  unsigned int chan)
+static u16 s626_get_clk_mult(struct comedi_device *dev,
+			     unsigned int chan)
 {
 	return S626_GET_STD_CLKMULT(s626_get_mode(dev, chan));
 }
@@ -1177,9 +1177,9 @@ static uint16_t s626_get_clk_mult(struct comedi_device *dev,
  * Return/set the clock polarity.
  */
 static void s626_set_clk_pol(struct comedi_device *dev,
-			     unsigned int chan, uint16_t value)
+			     unsigned int chan, u16 value)
 {
-	uint16_t mode;
+	u16 mode;
 
 	mode = s626_get_mode(dev, chan);
 	mode &= ~S626_STDMSK_CLKPOL;
@@ -1188,8 +1188,8 @@ static void s626_set_clk_pol(struct comedi_device *dev,
 	s626_set_mode(dev, chan, mode, false);
 }
 
-static uint16_t s626_get_clk_pol(struct comedi_device *dev,
-				 unsigned int chan)
+static u16 s626_get_clk_pol(struct comedi_device *dev,
+			    unsigned int chan)
 {
 	return S626_GET_STD_CLKPOL(s626_get_mode(dev, chan));
 }
@@ -1198,9 +1198,9 @@ static uint16_t s626_get_clk_pol(struct comedi_device *dev,
  * Return/set the encoder mode.
  */
 static void s626_set_enc_mode(struct comedi_device *dev,
-			      unsigned int chan, uint16_t value)
+			      unsigned int chan, u16 value)
 {
-	uint16_t mode;
+	u16 mode;
 
 	mode = s626_get_mode(dev, chan);
 	mode &= ~S626_STDMSK_ENCMODE;
@@ -1209,8 +1209,8 @@ static void s626_set_enc_mode(struct comedi_device *dev,
 	s626_set_mode(dev, chan, mode, false);
 }
 
-static uint16_t s626_get_enc_mode(struct comedi_device *dev,
-				  unsigned int chan)
+static u16 s626_get_enc_mode(struct comedi_device *dev,
+			     unsigned int chan)
 {
 	return S626_GET_STD_ENCMODE(s626_get_mode(dev, chan));
 }
@@ -1219,9 +1219,9 @@ static uint16_t s626_get_enc_mode(struct comedi_device *dev,
  * Return/set the index polarity.
  */
 static void s626_set_index_pol(struct comedi_device *dev,
-			       unsigned int chan, uint16_t value)
+			       unsigned int chan, u16 value)
 {
-	uint16_t mode;
+	u16 mode;
 
 	mode = s626_get_mode(dev, chan);
 	mode &= ~S626_STDMSK_INDXPOL;
@@ -1230,8 +1230,8 @@ static void s626_set_index_pol(struct comedi_device *dev,
 	s626_set_mode(dev, chan, mode, false);
 }
 
-static uint16_t s626_get_index_pol(struct comedi_device *dev,
-				   unsigned int chan)
+static u16 s626_get_index_pol(struct comedi_device *dev,
+			      unsigned int chan)
 {
 	return S626_GET_STD_INDXPOL(s626_get_mode(dev, chan));
 }
@@ -1240,9 +1240,9 @@ static uint16_t s626_get_index_pol(struct comedi_device *dev,
  * Return/set the index source.
  */
 static void s626_set_index_src(struct comedi_device *dev,
-			       unsigned int chan, uint16_t value)
+			       unsigned int chan, u16 value)
 {
-	uint16_t mode;
+	u16 mode;
 
 	mode = s626_get_mode(dev, chan);
 	mode &= ~S626_STDMSK_INDXSRC;
@@ -1251,8 +1251,8 @@ static void s626_set_index_src(struct comedi_device *dev,
 	s626_set_mode(dev, chan, mode, false);
 }
 
-static uint16_t s626_get_index_src(struct comedi_device *dev,
-				   unsigned int chan)
+static u16 s626_get_index_src(struct comedi_device *dev,
+			      unsigned int chan)
 {
 	return S626_GET_STD_INDXSRC(s626_get_mode(dev, chan));
 }
@@ -1265,7 +1265,7 @@ static void s626_pulse_index(struct comedi_device *dev,
 			     unsigned int chan)
 {
 	if (chan < 3) {
-		uint16_t cra;
+		u16 cra;
 
 		cra = s626_debi_read(dev, S626_LP_CRA(chan));
 
@@ -1274,7 +1274,7 @@ static void s626_pulse_index(struct comedi_device *dev,
 				(cra ^ S626_CRAMSK_INDXPOL_A));
 		s626_debi_write(dev, S626_LP_CRA(chan), cra);
 	} else {
-		uint16_t crb;
+		u16 crb;
 
 		crb = s626_debi_read(dev, S626_LP_CRB(chan));
 		crb &= ~S626_CRBMSK_INTCTRL;
@@ -1342,7 +1342,7 @@ static int s626_dio_clear_irq(struct comedi_device *dev)
 }
 
 static void s626_handle_dio_interrupt(struct comedi_device *dev,
-				      uint16_t irqbit, uint8_t group)
+				      u16 irqbit, u8 group)
 {
 	struct s626_private *devpriv = dev->private;
 	struct comedi_subdevice *s = dev->read_subdev;
@@ -1390,8 +1390,8 @@ static void s626_handle_dio_interrupt(struct comedi_device *dev,
 
 static void s626_check_dio_interrupts(struct comedi_device *dev)
 {
-	uint16_t irqbit;
-	uint8_t group;
+	u16 irqbit;
+	u8 group;
 
 	for (group = 0; group < S626_DIO_BANKS; group++) {
 		/* read interrupt type */
@@ -1411,7 +1411,7 @@ static void s626_check_counter_interrupts(struct comedi_device *dev)
 	struct comedi_subdevice *s = dev->read_subdev;
 	struct comedi_async *async = s->async;
 	struct comedi_cmd *cmd = &async->cmd;
-	uint16_t irqbit;
+	u16 irqbit;
 
 	/* read interrupt type */
 	irqbit = s626_debi_read(dev, S626_LP_RDMISC2);
@@ -1473,10 +1473,10 @@ static bool s626_handle_eos_interrupt(struct comedi_device *dev)
 	struct comedi_cmd *cmd = &async->cmd;
 	/*
 	 * Init ptr to DMA buffer that holds new ADC data.  We skip the
-	 * first uint16_t in the buffer because it contains junk data
+	 * first u16 in the buffer because it contains junk data
 	 * from the final ADC of the previous poll list scan.
 	 */
-	uint32_t *readaddr = (uint32_t *)devpriv->ana_buf.logical_base + 1;
+	u32 *readaddr = (u32 *)devpriv->ana_buf.logical_base + 1;
 	int i;
 
 	/* get the data and hand it over to comedi */
@@ -1511,7 +1511,7 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
 {
 	struct comedi_device *dev = d;
 	unsigned long flags;
-	uint32_t irqtype, irqstatus;
+	u32 irqtype, irqstatus;
 
 	if (!dev->attached)
 		return IRQ_NONE;
@@ -1552,25 +1552,25 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
 /*
  * This function builds the RPS program for hardware driven acquisition.
  */
-static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
+static void s626_reset_adc(struct comedi_device *dev, u8 *ppl)
 {
 	struct s626_private *devpriv = dev->private;
 	struct comedi_subdevice *s = dev->read_subdev;
 	struct comedi_cmd *cmd = &s->async->cmd;
-	uint32_t *rps;
-	uint32_t jmp_adrs;
-	uint16_t i;
-	uint16_t n;
-	uint32_t local_ppl;
+	u32 *rps;
+	u32 jmp_adrs;
+	u16 i;
+	u16 n;
+	u32 local_ppl;
 
 	/* Stop RPS program in case it is currently running */
 	s626_mc_disable(dev, S626_MC1_ERPS1, S626_P_MC1);
 
 	/* Set starting logical address to write RPS commands. */
-	rps = (uint32_t *)devpriv->rps_buf.logical_base;
+	rps = (u32 *)devpriv->rps_buf.logical_base;
 
 	/* Initialize RPS instruction pointer */
-	writel((uint32_t)devpriv->rps_buf.physical_base,
+	writel((u32)devpriv->rps_buf.physical_base,
 	       dev->mmio + S626_P_RPSADDR1);
 
 	/* Construct RPS program in rps_buf DMA buffer */
@@ -1610,7 +1610,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
 	     devpriv->adc_items++) {
 		/*
 		 * Convert application's poll list item to private board class
-		 * format.  Each app poll list item is an uint8_t with form
+		 * format.  Each app poll list item is an u8 with form
 		 * (EOPL,x,x,RANGE,CHAN<3:0>), where RANGE code indicates 0 =
 		 * +-10V, 1 = +-5V, and EOPL = End of Poll List marker.
 		 */
@@ -1652,10 +1652,10 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
 		 * flushes the RPS' instruction prefetch pipeline.
 		 */
 		jmp_adrs =
-			(uint32_t)devpriv->rps_buf.physical_base +
-			(uint32_t)((unsigned long)rps -
-				   (unsigned long)devpriv->
-						  rps_buf.logical_base);
+			(u32)devpriv->rps_buf.physical_base +
+			(u32)((unsigned long)rps -
+			      (unsigned long)devpriv->
+					     rps_buf.logical_base);
 		for (i = 0; i < (10 * S626_RPSCLK_PER_US / 2); i++) {
 			jmp_adrs += 8;	/* Repeat to implement time delay: */
 			/* Jump to next RPS instruction. */
@@ -1688,7 +1688,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
 		/* Transfer ADC data from FB BUFFER 1 register to DMA buffer. */
 		*rps++ = S626_RPS_STREG |
 			 (S626_BUGFIX_STREG(S626_P_FB_BUFFER1) >> 2);
-		*rps++ = (uint32_t)devpriv->ana_buf.physical_base +
+		*rps++ = (u32)devpriv->ana_buf.physical_base +
 			 (devpriv->adc_items << 2);
 
 		/*
@@ -1732,7 +1732,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
 
 	/* Transfer final ADC data from FB BUFFER 1 register to DMA buffer. */
 	*rps++ = S626_RPS_STREG | (S626_BUGFIX_STREG(S626_P_FB_BUFFER1) >> 2);
-	*rps++ = (uint32_t)devpriv->ana_buf.physical_base +
+	*rps++ = (u32)devpriv->ana_buf.physical_base +
 		 (devpriv->adc_items << 2);
 
 	/* Indicate ADC scan loop is finished. */
@@ -1745,7 +1745,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
 
 	/* Restart RPS program at its beginning. */
 	*rps++ = S626_RPS_JUMP;	/* Branch to start of RPS program. */
-	*rps++ = (uint32_t)devpriv->rps_buf.physical_base;
+	*rps++ = (u32)devpriv->rps_buf.physical_base;
 
 	/* End of RPS program build */
 }
@@ -1757,8 +1757,8 @@ static int s626_ai_rinsn(struct comedi_device *dev,
 			 unsigned int *data)
 {
 	struct s626_private *devpriv = dev->private;
-	uint8_t i;
-	int32_t *readaddr;
+	u8 i;
+	s32 *readaddr;
 
 	/* Trigger ADC scan loop start */
 	s626_mc_enable(dev, S626_MC2_ADC_RPS, S626_P_MC2);
@@ -1769,10 +1769,10 @@ static int s626_ai_rinsn(struct comedi_device *dev,
 
 	/*
 	 * Init ptr to DMA buffer that holds new ADC data.  We skip the
-	 * first uint16_t in the buffer because it contains junk data from
+	 * first u16 in the buffer because it contains junk data from
 	 * the final ADC of the previous poll list scan.
 	 */
-	readaddr = (uint32_t *)devpriv->ana_buf.logical_base + 1;
+	readaddr = (u32 *)devpriv->ana_buf.logical_base + 1;
 
 	/*
 	 * Convert ADC data to 16-bit integer values and
@@ -1805,11 +1805,11 @@ static int s626_ai_insn_read(struct comedi_device *dev,
 			     struct comedi_insn *insn,
 			     unsigned int *data)
 {
-	uint16_t chan = CR_CHAN(insn->chanspec);
-	uint16_t range = CR_RANGE(insn->chanspec);
-	uint16_t adc_spec = 0;
-	uint32_t gpio_image;
-	uint32_t tmp;
+	u16 chan = CR_CHAN(insn->chanspec);
+	u16 range = CR_RANGE(insn->chanspec);
+	u16 adc_spec = 0;
+	u32 gpio_image;
+	u32 tmp;
 	int ret;
 	int n;
 
@@ -1902,7 +1902,7 @@ static int s626_ai_insn_read(struct comedi_device *dev,
 	return n;
 }
 
-static int s626_ai_load_polllist(uint8_t *ppl, struct comedi_cmd *cmd)
+static int s626_ai_load_polllist(u8 *ppl, struct comedi_cmd *cmd)
 {
 	int n;
 
@@ -1968,7 +1968,7 @@ static int s626_ns_to_timer(unsigned int *nanosec, unsigned int flags)
 static void s626_timer_load(struct comedi_device *dev,
 			    unsigned int chan, int tick)
 {
-	uint16_t setup =
+	u16 setup =
 		/* Preload upon index. */
 		S626_SET_STD_LOADSRC(S626_LOADSRC_INDX) |
 		/* Disable hardware index. */
@@ -1981,8 +1981,8 @@ static void s626_timer_load(struct comedi_device *dev,
 		S626_SET_STD_CLKMULT(S626_CLKMULT_1X) |
 		/* Enabled by index */
 		S626_SET_STD_CLKENAB(S626_CLKENAB_INDEX);
-	uint16_t value_latchsrc = S626_LATCHSRC_A_INDXA;
-	/* uint16_t enab = S626_CLKENAB_ALWAYS; */
+	u16 value_latchsrc = S626_LATCHSRC_A_INDXA;
+	/* u16 enab = S626_CLKENAB_ALWAYS; */
 
 	s626_set_mode(dev, chan, setup, false);
 
@@ -2003,14 +2003,14 @@ static void s626_timer_load(struct comedi_device *dev,
 	s626_set_int_src(dev, chan, S626_INTSRC_OVER);
 
 	s626_set_latch_source(dev, chan, value_latchsrc);
-	/* s626_set_enable(dev, chan, (uint16_t)(enab != 0)); */
+	/* s626_set_enable(dev, chan, (u16)(enab != 0)); */
 }
 
 /* TO COMPLETE  */
 static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 {
 	struct s626_private *devpriv = dev->private;
-	uint8_t ppl[16];
+	u8 ppl[16];
 	struct comedi_cmd *cmd = &s->async->cmd;
 	int tick;
 
@@ -2245,7 +2245,7 @@ static int s626_ao_insn_write(struct comedi_device *dev,
 	int i;
 
 	for (i = 0; i < insn->n; i++) {
-		int16_t dacdata = (int16_t)data[i];
+		s16 dacdata = (s16)data[i];
 		int ret;
 
 		dacdata -= (0x1fff);
@@ -2270,7 +2270,7 @@ static int s626_ao_insn_write(struct comedi_device *dev,
 
 static void s626_dio_init(struct comedi_device *dev)
 {
-	uint16_t group;
+	u16 group;
 
 	/* Prepare to treat writes to WRCapSel as capture disables. */
 	s626_debi_write(dev, S626_LP_MISC1, S626_MISC1_NOEDCAP);
@@ -2334,7 +2334,7 @@ static int s626_enc_insn_config(struct comedi_device *dev,
 				struct comedi_insn *insn, unsigned int *data)
 {
 	unsigned int chan = CR_CHAN(insn->chanspec);
-	uint16_t setup =
+	u16 setup =
 		/* Preload upon index. */
 		S626_SET_STD_LOADSRC(S626_LOADSRC_INDX) |
 		/* Disable hardware index. */
@@ -2347,10 +2347,10 @@ static int s626_enc_insn_config(struct comedi_device *dev,
 		S626_SET_STD_CLKMULT(S626_CLKMULT_1X) |
 		/* Enabled by index */
 		S626_SET_STD_CLKENAB(S626_CLKENAB_INDEX);
-	/* uint16_t disable_int_src = true; */
-	/* uint32_t Preloadvalue;              //Counter initial value */
-	uint16_t value_latchsrc = S626_LATCHSRC_AB_READ;
-	uint16_t enab = S626_CLKENAB_ALWAYS;
+	/* u16 disable_int_src = true; */
+	/* u32 Preloadvalue;              //Counter initial value */
+	u16 value_latchsrc = S626_LATCHSRC_AB_READ;
+	u16 enab = S626_CLKENAB_ALWAYS;
 
 	/* (data==NULL) ? (Preloadvalue=0) : (Preloadvalue=data[0]); */
 
@@ -2369,7 +2369,7 @@ static int s626_enc_insn_read(struct comedi_device *dev,
 			      unsigned int *data)
 {
 	unsigned int chan = CR_CHAN(insn->chanspec);
-	uint16_t cntr_latch_reg = S626_LP_CNTR(chan);
+	u16 cntr_latch_reg = S626_LP_CNTR(chan);
 	int i;
 
 	for (i = 0; i < insn->n; i++) {
@@ -2407,7 +2407,7 @@ static int s626_enc_insn_write(struct comedi_device *dev,
 	return 1;
 }
 
-static void s626_write_misc2(struct comedi_device *dev, uint16_t new_image)
+static void s626_write_misc2(struct comedi_device *dev, u16 new_image)
 {
 	s626_debi_write(dev, S626_LP_MISC1, S626_MISC1_WENABLE);
 	s626_debi_write(dev, S626_LP_WRMISC2, new_image);
@@ -2417,7 +2417,7 @@ static void s626_write_misc2(struct comedi_device *dev, uint16_t new_image)
 static void s626_counters_init(struct comedi_device *dev)
 {
 	int chan;
-	uint16_t setup =
+	u16 setup =
 		/* Preload upon index. */
 		S626_SET_STD_LOADSRC(S626_LOADSRC_INDX) |
 		/* Disable hardware index. */
@@ -2486,7 +2486,7 @@ static int s626_initialize(struct comedi_device *dev)
 {
 	struct s626_private *devpriv = dev->private;
 	dma_addr_t phys_buf;
-	uint16_t chan;
+	u16 chan;
 	int i;
 	int ret;
 
@@ -2549,7 +2549,7 @@ static int s626_initialize(struct comedi_device *dev)
 	/*
 	 * Set up TSL1 slot list, which is used to control the
 	 * accumulation of ADC data: S626_RSD1 = shift data in on SD1.
-	 * S626_SIB_A1  = store data uint8_t at next available location
+	 * S626_SIB_A1  = store data u8 at next available location
 	 * in FB BUFFER1 register.
 	 */
 	writel(S626_RSD1 | S626_SIB_A1, dev->mmio + S626_P_TSL1);
@@ -2564,7 +2564,7 @@ static int s626_initialize(struct comedi_device *dev)
 	 */
 
 	/* Physical start of RPS program */
-	writel((uint32_t)devpriv->rps_buf.physical_base,
+	writel((u32)devpriv->rps_buf.physical_base,
 	       dev->mmio + S626_P_RPSADDR1);
 	/* RPS program performs no explicit mem writes */
 	writel(0, dev->mmio + S626_P_RPSPAGE1);
@@ -2583,10 +2583,10 @@ static int s626_initialize(struct comedi_device *dev)
 	 */
 	{
 		struct comedi_subdevice *s = dev->read_subdev;
-		uint8_t poll_list;
-		uint16_t adc_data;
-		uint16_t start_val;
-		uint16_t index;
+		u8 poll_list;
+		u16 adc_data;
+		u16 start_val;
+		u16 index;
 		unsigned int data[16];
 
 		/* Create a simple polling list for analog input channel 0 */
@@ -2634,16 +2634,16 @@ static int s626_initialize(struct comedi_device *dev)
 	 * enabled.
 	 */
 	phys_buf = devpriv->ana_buf.physical_base +
-		   (S626_DAC_WDMABUF_OS * sizeof(uint32_t));
-	writel((uint32_t)phys_buf, dev->mmio + S626_P_BASEA2_OUT);
-	writel((uint32_t)(phys_buf + sizeof(uint32_t)),
+		   (S626_DAC_WDMABUF_OS * sizeof(u32));
+	writel((u32)phys_buf, dev->mmio + S626_P_BASEA2_OUT);
+	writel((u32)(phys_buf + sizeof(u32)),
 	       dev->mmio + S626_P_PROTA2_OUT);
 
 	/*
 	 * Cache Audio2's output DMA buffer logical address.  This is
 	 * where DAC data is buffered for A2 output DMA transfers.
 	 */
-	devpriv->dac_wbuf = (uint32_t *)devpriv->ana_buf.logical_base +
+	devpriv->dac_wbuf = (u32 *)devpriv->ana_buf.logical_base +
 			    S626_DAC_WDMABUF_OS;
 
 	/*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] Staging: comedi: fix WARNING issue in s626.c
  2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
@ 2016-03-10  6:52 ` Ravishankar Karkala Mallikarjunayya
  2016-03-10 10:42   ` Ian Abbott
  2016-03-11  3:32   ` Greg KH
  2016-03-10  6:52 ` [PATCH 3/5] " Ravishankar Karkala Mallikarjunayya
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2016-03-10  6:52 UTC (permalink / raw)
  To: abbotti
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel,
	Ravishankar Karkala Mallikarjunayya

This is a patch to the s626.c file that fixes up a  Block comments issues
found by the checkpatch.pl tool.

i.e. Block comments use a trailing */ on a separate line

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
---
 drivers/staging/comedi/drivers/s626.c | 38 ++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 5469ca0..6ebae3a 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -77,23 +77,30 @@ struct s626_buffer_dma {
 struct s626_private {
 	u8 ai_cmd_running;		/* ai_cmd is running */
 	unsigned int ai_sample_timer;	/* time between samples in
-					 * units of the timer */
+					 * units of the timer
+					 */
 	int ai_convert_count;		/* conversion counter */
 	unsigned int ai_convert_timer;	/* time between conversion in
-					 * units of the timer */
-	u16 counter_int_enabs;	/* counter interrupt enable mask
-					 * for MISC2 register */
+					 * units of the timer
+					 */
+	u16 counter_int_enabs;		/* counter interrupt enable mask
+					 * for MISC2 register
+					 */
 	u8 adc_items;		/* number of items in ADC poll list */
 	struct s626_buffer_dma rps_buf;	/* DMA buffer used to hold ADC (RPS1)
-					 * program */
+					 * program
+					 */
 	struct s626_buffer_dma ana_buf;	/* DMA buffer used to receive ADC data
-					 * and hold DAC data */
-	u32 *dac_wbuf;		/* pointer to logical adrs of DMA buffer
-					 * used to hold DAC data */
+					 * and hold DAC data
+					 */
+	u32 *dac_wbuf;			/* pointer to logical adrs of DMA buffer
+					 * used to hold DAC data
+					 */
 	u16 dacpol;		/* image of DAC polarity register */
 	u8 trim_setpoint[12];	/* images of TrimDAC setpoints */
-	u32 i2c_adrs;		/* I2C device address for onboard EEPROM
-					 * (board rev dependent) */
+	u32 i2c_adrs;			/* I2C device address for onboard EEPROM
+					 * (board rev dependent)
+					 */
 };
 
 /* Counter overflow/index event flag masks for RDMISC2. */
@@ -572,11 +579,14 @@ static int s626_set_dac(struct comedi_device *dev,
 	 * running after the packet has been sent to the target DAC.
 	 */
 	val = 0x0F000000;	/* Continue clock after target DAC data
-				 * (write to non-existent trimdac). */
+				 * (write to non-existent trimdac).
+				 */
 	val |= 0x00004000;	/* Address the two main dual-DAC devices
-				 * (TSL's chip select enables target device). */
-	val |= ((u32)(chan & 1) << 15);	/* Address the DAC channel
-						 * within the device. */
+				 * (TSL's chip select enables target device).
+				 */
+	val |= ((u32)(chan & 1) << 15);		/* Address the DAC channel
+						 * within the device.
+						 */
 	val |= (u32)dacdata;	/* Include DAC setpoint data. */
 	return s626_send_dac(dev, val);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] Staging: comedi: fix WARNING issue in s626.c
  2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
  2016-03-10  6:52 ` [PATCH 2/5] Staging: comedi: fix WARNING " Ravishankar Karkala Mallikarjunayya
@ 2016-03-10  6:52 ` Ravishankar Karkala Mallikarjunayya
  2016-03-10 10:42   ` Ian Abbott
  2016-03-10  6:52 ` [PATCH 4/5] Staging: comedi: fix CHECK issue in ni_tio.c Ravishankar Karkala Mallikarjunayya
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2016-03-10  6:52 UTC (permalink / raw)
  To: abbotti
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel,
	Ravishankar Karkala Mallikarjunayya

This is a patch to the s626.c file that fixes up a  line over
80 characters issues found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
---
 drivers/staging/comedi/drivers/s626.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 6ebae3a..2a5e650 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -2543,7 +2543,8 @@ static int s626_initialize(struct comedi_device *dev)
 	for (i = 0; i < 2; i++) {
 		writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT);
 		s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2);
-		ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0);
+		ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc,
+				     0);
 		if (ret)
 			return ret;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] Staging: comedi: fix CHECK issue in ni_tio.c
  2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
  2016-03-10  6:52 ` [PATCH 2/5] Staging: comedi: fix WARNING " Ravishankar Karkala Mallikarjunayya
  2016-03-10  6:52 ` [PATCH 3/5] " Ravishankar Karkala Mallikarjunayya
@ 2016-03-10  6:52 ` Ravishankar Karkala Mallikarjunayya
  2016-03-10 10:42   ` Ian Abbott
  2016-03-10  6:52 ` [PATCH 5/5] Staging: comedi: fix type " Ravishankar Karkala Mallikarjunayya
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2016-03-10  6:52 UTC (permalink / raw)
  To: abbotti
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel,
	Ravishankar Karkala Mallikarjunayya

This is a patch to the ni_tio.c file that fixes up a CHECK issues
found by the checkpatch.pl tool.

i.e. Avoid crashing the kernel - try using WARN_ON & recovery code
rather than BUG() or BUG_ON().

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
---
 drivers/staging/comedi/drivers/ni_tio.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c
index b74e44e..f006805 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -222,7 +222,7 @@ static uint64_t ni_tio_clock_period_ps(const struct ni_gpct *counter,
 		clock_period_ps *= 8;
 		break;
 	default:
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	return clock_period_ps;
@@ -304,7 +304,7 @@ static unsigned ni_m_series_clock_src_select(const struct ni_gpct *counter)
 		}
 		if (i <= NI_M_MAX_PFI_CHAN)
 			break;
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	clock_source |= ni_tio_clock_src_modifiers(counter);
@@ -361,7 +361,7 @@ static unsigned ni_660x_clock_src_select(const struct ni_gpct *counter)
 		}
 		if (i <= NI_660X_MAX_SRC_PIN)
 			break;
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	clock_source |= ni_tio_clock_src_modifiers(counter);
@@ -584,7 +584,7 @@ static unsigned ni_660x_clk_src(unsigned int clock_source)
 		if (i <= NI_660X_MAX_SRC_PIN)
 			break;
 		ni_660x_clock = 0;
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	return GI_SRC_SEL(ni_660x_clock);
@@ -643,7 +643,7 @@ static unsigned ni_m_clk_src(unsigned int clock_source)
 			break;
 		pr_err("invalid clock source 0x%lx\n",
 		       (unsigned long)clock_source);
-		BUG();
+		WARN_ON(1);
 		ni_m_series_clock = 0;
 		break;
 	}
@@ -946,7 +946,7 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index,
 		case ni_gpct_variant_660x:
 			return ni_660x_set_gate2(counter, gate_source);
 		default:
-			BUG();
+			WARN_ON(1);
 			break;
 		}
 		break;
@@ -1015,7 +1015,7 @@ static unsigned ni_660x_gate_to_generic_gate(unsigned gate)
 			if (gate == NI_660X_PIN_GATE_SEL(i))
 				return NI_GPCT_GATE_PIN_GATE_SELECT(i);
 		}
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	return 0;
@@ -1051,7 +1051,7 @@ static unsigned ni_m_gate_to_generic_gate(unsigned gate)
 			if (gate == NI_M_PFI_GATE_SEL(i))
 				return NI_GPCT_PFI_GATE_SELECT(i);
 		}
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	return 0;
@@ -1083,7 +1083,7 @@ static unsigned ni_660x_gate2_to_generic_gate(unsigned gate)
 			if (gate == NI_660X_UD_PIN_GATE2_SEL(i))
 				return NI_GPCT_UP_DOWN_PIN_GATE_SELECT(i);
 		}
-		BUG();
+		WARN_ON(1);
 		break;
 	}
 	return 0;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] Staging: comedi: fix type issue in ni_tio.c
  2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
                   ` (2 preceding siblings ...)
  2016-03-10  6:52 ` [PATCH 4/5] Staging: comedi: fix CHECK issue in ni_tio.c Ravishankar Karkala Mallikarjunayya
@ 2016-03-10  6:52 ` Ravishankar Karkala Mallikarjunayya
  2016-03-10 10:42   ` Ian Abbott
  2016-03-10 10:41 ` [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ian Abbott
  2016-03-11  3:32 ` Greg KH
  5 siblings, 1 reply; 12+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2016-03-10  6:52 UTC (permalink / raw)
  To: abbotti
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel,
	Ravishankar Karkala Mallikarjunayya

This is a patch to the ni_tio.c file that fixes up a type issues
found by the checkpatch.pl tool.
i.e. Prefer kernel type 'u64' over 'uint64_t'

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
---
 drivers/staging/comedi/drivers/ni_tio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c
index f006805..0ee6d6c 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -189,7 +189,7 @@ static void ni_tio_reset_count_and_disarm(struct ni_gpct *counter)
 static uint64_t ni_tio_clock_period_ps(const struct ni_gpct *counter,
 				       unsigned generic_clock_source)
 {
-	uint64_t clock_period_ps;
+	u64 clock_period_ps;
 
 	switch (generic_clock_source & NI_GPCT_CLOCK_SRC_SELECT_MASK) {
 	case NI_GPCT_TIMEBASE_1_CLOCK_SRC_BITS:
@@ -385,9 +385,9 @@ static void ni_tio_set_sync_mode(struct ni_gpct *counter, int force_alt_sync)
 	struct ni_gpct_device *counter_dev = counter->counter_dev;
 	unsigned cidx = counter->counter_index;
 	const unsigned counting_mode_reg = NITIO_CNT_MODE_REG(cidx);
-	static const uint64_t min_normal_sync_period_ps = 25000;
+	static const u64 min_normal_sync_period_ps = 25000;
 	unsigned mode;
-	uint64_t clock_period_ps;
+	u64 clock_period_ps;
 
 	if (ni_tio_counting_mode_registers_present(counter_dev) == 0)
 		return;
@@ -730,7 +730,7 @@ static void ni_tio_get_clock_src(struct ni_gpct *counter,
 				 unsigned int *clock_source,
 				 unsigned int *period_ns)
 {
-	uint64_t temp64;
+	u64 temp64;
 
 	*clock_source = ni_tio_generic_clock_src_select(counter);
 	temp64 = ni_tio_clock_period_ps(counter, *clock_source);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] Staging: comedi: fix type issue in s626.c
  2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
                   ` (3 preceding siblings ...)
  2016-03-10  6:52 ` [PATCH 5/5] Staging: comedi: fix type " Ravishankar Karkala Mallikarjunayya
@ 2016-03-10 10:41 ` Ian Abbott
  2016-03-11  3:32 ` Greg KH
  5 siblings, 0 replies; 12+ messages in thread
From: Ian Abbott @ 2016-03-10 10:41 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel

On 10/03/16 06:52, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the s626.c file that fixes up a type issues
> found by the checkpatch.pl tool.
>
> i.e Prefer kernel type 'u8' over 'uint8_t'
>      Prefer kernel type 'u16' over 'uint16_t'
>      Prefer kernel type 'u32' over 'uint32_t'
>      Prefer kernel type 's16' over 'int16_t'
>      Prefer kernel type 's32' over 'int32_t'
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> ---
>   drivers/staging/comedi/drivers/s626.c | 312 +++++++++++++++++-----------------
>   1 file changed, 156 insertions(+), 156 deletions(-)

Thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] Staging: comedi: fix WARNING issue in s626.c
  2016-03-10  6:52 ` [PATCH 2/5] Staging: comedi: fix WARNING " Ravishankar Karkala Mallikarjunayya
@ 2016-03-10 10:42   ` Ian Abbott
  2016-03-11  3:32   ` Greg KH
  1 sibling, 0 replies; 12+ messages in thread
From: Ian Abbott @ 2016-03-10 10:42 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel

On 10/03/16 06:52, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the s626.c file that fixes up a  Block comments issues
> found by the checkpatch.pl tool.
>
> i.e. Block comments use a trailing */ on a separate line
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> ---
>   drivers/staging/comedi/drivers/s626.c | 38 ++++++++++++++++++++++-------------
>   1 file changed, 24 insertions(+), 14 deletions(-)

Thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/5] Staging: comedi: fix WARNING issue in s626.c
  2016-03-10  6:52 ` [PATCH 3/5] " Ravishankar Karkala Mallikarjunayya
@ 2016-03-10 10:42   ` Ian Abbott
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Abbott @ 2016-03-10 10:42 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel

On 10/03/16 06:52, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the s626.c file that fixes up a  line over
> 80 characters issues found by the checkpatch.pl tool.
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> ---
>   drivers/staging/comedi/drivers/s626.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
> index 6ebae3a..2a5e650 100644
> --- a/drivers/staging/comedi/drivers/s626.c
> +++ b/drivers/staging/comedi/drivers/s626.c
> @@ -2543,7 +2543,8 @@ static int s626_initialize(struct comedi_device *dev)
>   	for (i = 0; i < 2; i++) {
>   		writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT);
>   		s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2);
> -		ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0);
> +		ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc,
> +				     0);
>   		if (ret)
>   			return ret;
>   	}
>


Thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] Staging: comedi: fix CHECK issue in ni_tio.c
  2016-03-10  6:52 ` [PATCH 4/5] Staging: comedi: fix CHECK issue in ni_tio.c Ravishankar Karkala Mallikarjunayya
@ 2016-03-10 10:42   ` Ian Abbott
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Abbott @ 2016-03-10 10:42 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel

On 10/03/16 06:52, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the ni_tio.c file that fixes up a CHECK issues
> found by the checkpatch.pl tool.
>
> i.e. Avoid crashing the kernel - try using WARN_ON & recovery code
> rather than BUG() or BUG_ON().
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> ---
>   drivers/staging/comedi/drivers/ni_tio.c | 18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)


Thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] Staging: comedi: fix type issue in ni_tio.c
  2016-03-10  6:52 ` [PATCH 5/5] Staging: comedi: fix type " Ravishankar Karkala Mallikarjunayya
@ 2016-03-10 10:42   ` Ian Abbott
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Abbott @ 2016-03-10 10:42 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: hsweeten, gregkh, geliangtang, devel, linux-kernel

On 10/03/16 06:52, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the ni_tio.c file that fixes up a type issues
> found by the checkpatch.pl tool.
> i.e. Prefer kernel type 'u64' over 'uint64_t'
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> ---
>   drivers/staging/comedi/drivers/ni_tio.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)


Thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] Staging: comedi: fix type issue in s626.c
  2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
                   ` (4 preceding siblings ...)
  2016-03-10 10:41 ` [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ian Abbott
@ 2016-03-11  3:32 ` Greg KH
  5 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2016-03-11  3:32 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: abbotti, hsweeten, geliangtang, devel, linux-kernel

On Thu, Mar 10, 2016 at 12:22:06PM +0530, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the s626.c file that fixes up a type issues
> found by the checkpatch.pl tool.
> 
> i.e Prefer kernel type 'u8' over 'uint8_t'
>     Prefer kernel type 'u16' over 'uint16_t'
>     Prefer kernel type 'u32' over 'uint32_t'
>     Prefer kernel type 's16' over 'int16_t'
>     Prefer kernel type 's32' over 'int32_t'
> 
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/drivers/s626.c | 312 +++++++++++++++++-----------------
>  1 file changed, 156 insertions(+), 156 deletions(-)

This doesn't apply to my tree at all.  Please rebase this series on the
staging-next branch of staging.git on git.kernel.org.  Don't work off of
Linus's tree, that does not contain all of the work that others have
already done but are not merged with him yet.

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] Staging: comedi: fix WARNING issue in s626.c
  2016-03-10  6:52 ` [PATCH 2/5] Staging: comedi: fix WARNING " Ravishankar Karkala Mallikarjunayya
  2016-03-10 10:42   ` Ian Abbott
@ 2016-03-11  3:32   ` Greg KH
  1 sibling, 0 replies; 12+ messages in thread
From: Greg KH @ 2016-03-11  3:32 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya
  Cc: abbotti, hsweeten, geliangtang, devel, linux-kernel

On Thu, Mar 10, 2016 at 12:22:07PM +0530, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the s626.c file that fixes up a  Block comments issues
> found by the checkpatch.pl tool.
> 
> i.e. Block comments use a trailing */ on a separate line
> 
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/drivers/s626.c | 38 ++++++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 14 deletions(-)

You have two subjects that are identical in this series, which isn't
allowed, please fix up and make them unique.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-03-11  3:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10  6:52 [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ravishankar Karkala Mallikarjunayya
2016-03-10  6:52 ` [PATCH 2/5] Staging: comedi: fix WARNING " Ravishankar Karkala Mallikarjunayya
2016-03-10 10:42   ` Ian Abbott
2016-03-11  3:32   ` Greg KH
2016-03-10  6:52 ` [PATCH 3/5] " Ravishankar Karkala Mallikarjunayya
2016-03-10 10:42   ` Ian Abbott
2016-03-10  6:52 ` [PATCH 4/5] Staging: comedi: fix CHECK issue in ni_tio.c Ravishankar Karkala Mallikarjunayya
2016-03-10 10:42   ` Ian Abbott
2016-03-10  6:52 ` [PATCH 5/5] Staging: comedi: fix type " Ravishankar Karkala Mallikarjunayya
2016-03-10 10:42   ` Ian Abbott
2016-03-10 10:41 ` [PATCH 1/5] Staging: comedi: fix type issue in s626.c Ian Abbott
2016-03-11  3:32 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).