mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/6] drivers: staging: vme: Fixed indention
@ 2015-11-22  9:27 Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 2/6] drivers: staging: vme: Deleted extra empty lines Egor Uleyskiy
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Egor Uleyskiy @ 2015-11-22  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Egor Uleyskiy, Manohar Vanga, Martyn Welch, Trivial Patch Monkey,
	linux-kernel

From: Egor Uleyskiy <egor.ulieiskii@gmail.com>

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_cntr.c |  2 +-
 drivers/staging/vme/devices/vme_pio2_core.c | 16 ++++++++--------
 drivers/staging/vme/devices/vme_pio2_gpio.c | 24 ++++++++++++------------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_cntr.c b/drivers/staging/vme/devices/vme_pio2_cntr.c
index 6335471..486c30c 100644
--- a/drivers/staging/vme/devices/vme_pio2_cntr.c
+++ b/drivers/staging/vme/devices/vme_pio2_cntr.c
@@ -61,7 +61,7 @@ int pio2_cntr_reset(struct pio2_card *card)
 	/* Ensure all counter interrupts are cleared */
 	do {
 		retval = vme_master_read(card->window, &reg, 1,
-			PIO2_REGS_INT_STAT_CNTR);
+					 PIO2_REGS_INT_STAT_CNTR);
 		if (retval < 0)
 			return retval;
 	} while (reg != 0);
diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 35c6ce5..f3b878b 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -90,7 +90,7 @@ static void pio2_int(int level, int vector, void *ptr)
 	case 4:
 		/* Channels 0 to 7 */
 		retval = vme_master_read(card->window, &reg, 1,
-			PIO2_REGS_INT_STAT[vec - 1]);
+					 PIO2_REGS_INT_STAT[vec - 1]);
 		if (retval < 0) {
 			dev_err(&card->vdev->dev,
 				"Unable to read IRQ status register\n");
@@ -100,8 +100,8 @@ static void pio2_int(int level, int vector, void *ptr)
 			channel = ((vec - 1) * 8) + i;
 			if (reg & PIO2_CHANNEL_BIT[channel])
 				dev_info(&card->vdev->dev,
-					"Interrupt on I/O channel %d\n",
-					channel);
+					 "Interrupt on I/O channel %d\n",
+					 channel);
 		}
 		break;
 	case 5:
@@ -289,7 +289,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	}
 
 	retval = vme_master_set(card->window, 1, card->base, 0x10000, VME_A24,
-		(VME_SCT | VME_USER | VME_DATA), VME_D16);
+				(VME_SCT | VME_USER | VME_DATA), VME_D16);
 	if (retval) {
 		dev_err(&card->vdev->dev,
 			"Unable to configure VME master resource\n");
@@ -335,7 +335,7 @@ static int pio2_probe(struct vme_dev *vdev)
 
 	/* Set VME vector */
 	retval = vme_master_write(card->window, &card->irq_vector, 1,
-		PIO2_REGS_VME_VECTOR);
+				  PIO2_REGS_VME_VECTOR);
 	if (retval < 0)
 		return retval;
 
@@ -343,7 +343,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	vec = card->irq_vector | PIO2_VME_VECTOR_SPUR;
 
 	retval = vme_irq_request(vdev, card->irq_level, vec,
-		&pio2_int, (void *)card);
+				 &pio2_int, (void *)card);
 	if (retval < 0) {
 		dev_err(&card->vdev->dev,
 			"Unable to attach VME interrupt vector0x%x, level 0x%x\n",
@@ -356,7 +356,7 @@ static int pio2_probe(struct vme_dev *vdev)
 		vec = card->irq_vector | PIO2_VECTOR_BANK[i];
 
 		retval = vme_irq_request(vdev, card->irq_level, vec,
-			&pio2_int, (void *)card);
+					 &pio2_int, (void *)card);
 		if (retval < 0) {
 			dev_err(&card->vdev->dev,
 				"Unable to attach VME interrupt vector0x%x, level 0x%x\n",
@@ -397,7 +397,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	dev_set_drvdata(&card->vdev->dev, card);
 
 	dev_info(&card->vdev->dev,
-		"PIO2 (variant %s) configured at 0x%lx\n", card->variant,
+		 "PIO2 (variant %s) configured at 0x%lx\n", card->variant,
 		card->base);
 
 	return 0;
diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c b/drivers/staging/vme/devices/vme_pio2_gpio.c
index 77901b3..0b72dac 100644
--- a/drivers/staging/vme/devices/vme_pio2_gpio.c
+++ b/drivers/staging/vme/devices/vme_pio2_gpio.c
@@ -37,14 +37,14 @@ static int pio2_gpio_get(struct gpio_chip *chip, unsigned int offset)
 	struct pio2_card *card = gpio_to_pio2_card(chip);
 
 	if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == OUTPUT) |
-		(card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
+	    (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
 
 		dev_err(&card->vdev->dev, "Channel not available as input\n");
 		return 0;
 	}
 
 	retval = vme_master_read(card->window, &reg, 1,
-		PIO2_REGS_DATA[PIO2_CHANNEL_BANK[offset]]);
+				 PIO2_REGS_DATA[PIO2_CHANNEL_BANK[offset]]);
 	if (retval < 0) {
 		dev_err(&card->vdev->dev, "Unable to read from GPIO\n");
 		return 0;
@@ -67,15 +67,15 @@ static int pio2_gpio_get(struct gpio_chip *chip, unsigned int offset)
 	return 0;
 }
 
-static void pio2_gpio_set(struct gpio_chip *chip, unsigned int offset,
-	int value)
+static void pio2_gpio_set(struct gpio_chip *chip,
+			  unsigned int offset, int value)
 {
 	u8 reg;
 	int retval;
 	struct pio2_card *card = gpio_to_pio2_card(chip);
 
 	if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == INPUT) |
-		(card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
+	    (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
 
 		dev_err(&card->vdev->dev, "Channel not available as output\n");
 		return;
@@ -89,7 +89,7 @@ static void pio2_gpio_set(struct gpio_chip *chip, unsigned int offset,
 			~PIO2_CHANNEL_BIT[offset];
 
 	retval = vme_master_write(card->window, &reg, 1,
-		PIO2_REGS_DATA[PIO2_CHANNEL_BANK[offset]]);
+				  PIO2_REGS_DATA[PIO2_CHANNEL_BANK[offset]]);
 	if (retval < 0) {
 		dev_err(&card->vdev->dev, "Unable to write to GPIO\n");
 		return;
@@ -105,7 +105,7 @@ static int pio2_gpio_dir_in(struct gpio_chip *chip, unsigned offset)
 	struct pio2_card *card = gpio_to_pio2_card(chip);
 
 	if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == OUTPUT) |
-		(card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
+	    (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
 		dev_err(&card->vdev->dev,
 			"Channel directionality not configurable at runtime\n");
 
@@ -124,7 +124,7 @@ static int pio2_gpio_dir_out(struct gpio_chip *chip, unsigned offset, int value)
 	struct pio2_card *card = gpio_to_pio2_card(chip);
 
 	if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == INPUT) |
-		(card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
+	    (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
 		dev_err(&card->vdev->dev,
 			"Channel directionality not configurable at runtime\n");
 
@@ -150,7 +150,7 @@ int pio2_gpio_reset(struct pio2_card *card)
 	/* Zero output registers */
 	for (i = 0; i < 4; i++) {
 		retval = vme_master_write(card->window, &data, 1,
-			PIO2_REGS_DATA[i]);
+					  PIO2_REGS_DATA[i]);
 		if (retval < 0)
 			return retval;
 		card->bank[i].value = 0;
@@ -159,12 +159,12 @@ int pio2_gpio_reset(struct pio2_card *card)
 	/* Set input interrupt masks */
 	for (i = 0; i < 4; i++) {
 		retval = vme_master_write(card->window, &data, 1,
-			PIO2_REGS_INT_MASK[i * 2]);
+					  PIO2_REGS_INT_MASK[i * 2]);
 		if (retval < 0)
 			return retval;
 
 		retval = vme_master_write(card->window, &data, 1,
-			PIO2_REGS_INT_MASK[(i * 2) + 1]);
+					  PIO2_REGS_INT_MASK[(i * 2) + 1]);
 		if (retval < 0)
 			return retval;
 
@@ -176,7 +176,7 @@ int pio2_gpio_reset(struct pio2_card *card)
 	for (i = 0; i < 4; i++) {
 		do {
 			retval = vme_master_read(card->window, &data, 1,
-				PIO2_REGS_INT_STAT[i]);
+						 PIO2_REGS_INT_STAT[i]);
 			if (retval < 0)
 				return retval;
 		} while (data != 0);
-- 
2.5.0


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

* [PATCH 2/6] drivers: staging: vme: Deleted extra empty lines
  2015-11-22  9:27 [PATCH 1/6] drivers: staging: vme: Fixed indention Egor Uleyskiy
@ 2015-11-22  9:27 ` Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 3/6] drivers: staging: vme: Fixed the using of sizeof Egor Uleyskiy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Egor Uleyskiy @ 2015-11-22  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Egor Uleyskiy, Manohar Vanga, Martyn Welch, Trivial Patch Monkey,
	linux-kernel

From: Egor Uleyskiy <egor.ulieiskii@gmail.com>

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_gpio.c | 2 --
 drivers/staging/vme/devices/vme_user.h      | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c b/drivers/staging/vme/devices/vme_pio2_gpio.c
index 0b72dac..e09f6bb 100644
--- a/drivers/staging/vme/devices/vme_pio2_gpio.c
+++ b/drivers/staging/vme/devices/vme_pio2_gpio.c
@@ -38,7 +38,6 @@ static int pio2_gpio_get(struct gpio_chip *chip, unsigned int offset)
 
 	if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == OUTPUT) |
 	    (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
-
 		dev_err(&card->vdev->dev, "Channel not available as input\n");
 		return 0;
 	}
@@ -76,7 +75,6 @@ static void pio2_gpio_set(struct gpio_chip *chip,
 
 	if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == INPUT) |
 	    (card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
-
 		dev_err(&card->vdev->dev, "Channel not available as output\n");
 		return;
 	}
diff --git a/drivers/staging/vme/devices/vme_user.h b/drivers/staging/vme/devices/vme_user.h
index b8cc7bc..a6cb756 100644
--- a/drivers/staging/vme/devices/vme_user.h
+++ b/drivers/staging/vme/devices/vme_user.h
@@ -20,7 +20,6 @@ struct vme_master {
 #endif
 } __packed;
 
-
 /*
  * IOCTL Commands and structures
  */
@@ -28,7 +27,6 @@ struct vme_master {
 /* Magic number for use in ioctls */
 #define VME_IOC_MAGIC 0xAE
 
-
 /* VMEbus Slave Window Configuration Structure */
 struct vme_slave {
 	__u32 enable;		/* State of Window */
-- 
2.5.0


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

* [PATCH 3/6] drivers: staging: vme: Fixed the using of sizeof
  2015-11-22  9:27 [PATCH 1/6] drivers: staging: vme: Fixed indention Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 2/6] drivers: staging: vme: Deleted extra empty lines Egor Uleyskiy
@ 2015-11-22  9:27 ` Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 4/6] drivers: staging: vme: Deleted extra bracking Egor Uleyskiy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Egor Uleyskiy @ 2015-11-22  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Egor Uleyskiy, Manohar Vanga, Martyn Welch, Trivial Patch Monkey,
	linux-kernel

From: Egor Uleyskiy <egor.ulieiskii@gmail.com>

Constructions that looks like
    card = kzalloc(sizeof(struct pio2_card), GFP_KERNEL);
  are changed to
    card = kzalloc(sizeof(*card), GFP_KERNEL);

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c |  2 +-
 drivers/staging/vme/devices/vme_user.c      | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index f3b878b..a30282a 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -215,7 +215,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	u8 reg;
 	int vec;
 
-	card = kzalloc(sizeof(struct pio2_card), GFP_KERNEL);
+	card = kzalloc(sizeof(*card), GFP_KERNEL);
 	if (!card) {
 		retval = -ENOMEM;
 		goto err_struct;
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 8e61a3b..a05a065 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -308,7 +308,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 		switch (cmd) {
 		case VME_IRQ_GEN:
 			copied = copy_from_user(&irq_req, argp,
-						sizeof(struct vme_irq_id));
+						sizeof(irq_req));
 			if (copied != 0) {
 				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
@@ -322,7 +322,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 	case MASTER_MINOR:
 		switch (cmd) {
 		case VME_GET_MASTER:
-			memset(&master, 0, sizeof(struct vme_master));
+			memset(&master, 0, sizeof(master));
 
 			/* XXX	We do not want to push aspace, cycle and width
 			 *	to userspace as they are
@@ -334,7 +334,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 						&master.cycle, &master.dwidth);
 
 			copied = copy_to_user(argp, &master,
-					      sizeof(struct vme_master));
+					      sizeof(master));
 			if (copied != 0) {
 				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
@@ -368,7 +368,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 	case SLAVE_MINOR:
 		switch (cmd) {
 		case VME_GET_SLAVE:
-			memset(&slave, 0, sizeof(struct vme_slave));
+			memset(&slave, 0, sizeof(slave));
 
 			/* XXX	We do not want to push aspace, cycle and width
 			 *	to userspace as they are
@@ -379,7 +379,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 					       &slave.aspace, &slave.cycle);
 
 			copied = copy_to_user(argp, &slave,
-					      sizeof(struct vme_slave));
+					      sizeof(slave));
 			if (copied != 0) {
 				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
-- 
2.5.0


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

* [PATCH 4/6] drivers: staging: vme: Deleted extra bracking
  2015-11-22  9:27 [PATCH 1/6] drivers: staging: vme: Fixed indention Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 2/6] drivers: staging: vme: Deleted extra empty lines Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 3/6] drivers: staging: vme: Fixed the using of sizeof Egor Uleyskiy
@ 2015-11-22  9:27 ` Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 5/6] drivers: staging: vme: Fixed checking NULL and 0 code style Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 6/6] drivers: staging: vme: Deleted casting to (void *) Egor Uleyskiy
  4 siblings, 0 replies; 6+ messages in thread
From: Egor Uleyskiy @ 2015-11-22  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Egor Uleyskiy, Manohar Vanga, Martyn Welch, Trivial Patch Monkey,
	linux-kernel

From: Egor Uleyskiy <egor.ulieiskii@gmail.com>

* Deleted extra bracking of VME_* constants
* Deleted extra bracking of address operator

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c | 2 +-
 drivers/staging/vme/devices/vme_pio2_gpio.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index a30282a..296551f 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -289,7 +289,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	}
 
 	retval = vme_master_set(card->window, 1, card->base, 0x10000, VME_A24,
-				(VME_SCT | VME_USER | VME_DATA), VME_D16);
+				VME_SCT | VME_USER | VME_DATA, VME_D16);
 	if (retval) {
 		dev_err(&card->vdev->dev,
 			"Unable to configure VME master resource\n");
diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c b/drivers/staging/vme/devices/vme_pio2_gpio.c
index e09f6bb..65fdb56 100644
--- a/drivers/staging/vme/devices/vme_pio2_gpio.c
+++ b/drivers/staging/vme/devices/vme_pio2_gpio.c
@@ -205,7 +205,7 @@ int pio2_gpio_init(struct pio2_card *card)
 	card->gc.set = pio2_gpio_set;
 
 	/* This function adds a memory mapped GPIO chip */
-	retval = gpiochip_add(&(card->gc));
+	retval = gpiochip_add(&card->gc);
 	if (retval) {
 		dev_err(&card->vdev->dev, "Unable to register GPIO\n");
 		kfree(card->gc.label);
@@ -218,7 +218,7 @@ void pio2_gpio_exit(struct pio2_card *card)
 {
 	const char *label = card->gc.label;
 
-	gpiochip_remove(&(card->gc));
+	gpiochip_remove(&card->gc);
 	kfree(label);
 }
 
-- 
2.5.0


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

* [PATCH 5/6] drivers: staging: vme: Fixed checking NULL and 0 code style
  2015-11-22  9:27 [PATCH 1/6] drivers: staging: vme: Fixed indention Egor Uleyskiy
                   ` (2 preceding siblings ...)
  2015-11-22  9:27 ` [PATCH 4/6] drivers: staging: vme: Deleted extra bracking Egor Uleyskiy
@ 2015-11-22  9:27 ` Egor Uleyskiy
  2015-11-22  9:27 ` [PATCH 6/6] drivers: staging: vme: Deleted casting to (void *) Egor Uleyskiy
  4 siblings, 0 replies; 6+ messages in thread
From: Egor Uleyskiy @ 2015-11-22  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Egor Uleyskiy, Manohar Vanga, Martyn Welch, Trivial Patch Monkey,
	linux-kernel

From: Egor Uleyskiy <egor.ulieiskii@gmail.com>

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c |  2 +-
 drivers/staging/vme/devices/vme_pio2_gpio.c |  2 +-
 drivers/staging/vme/devices/vme_user.c      | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 296551f..30712da 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -230,7 +230,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	card->vdev = vdev;
 
 	for (i = 0; i < PIO2_VARIANT_LENGTH; i++) {
-		if (isdigit(card->variant[i]) == 0) {
+		if (!isdigit(card->variant[i])) {
 			dev_err(&card->vdev->dev, "Variant invalid\n");
 			retval = -EINVAL;
 			goto err_variant;
diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c b/drivers/staging/vme/devices/vme_pio2_gpio.c
index 65fdb56..df992c3 100644
--- a/drivers/staging/vme/devices/vme_pio2_gpio.c
+++ b/drivers/staging/vme/devices/vme_pio2_gpio.c
@@ -190,7 +190,7 @@ int pio2_gpio_init(struct pio2_card *card)
 
 	label = kasprintf(GFP_KERNEL,
 			  "%s@%s", driver_name, dev_name(&card->vdev->dev));
-	if (label == NULL)
+	if (!label)
 		return -ENOMEM;
 
 	card->gc.label = label;
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index a05a065..b95883b 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -309,7 +309,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 		case VME_IRQ_GEN:
 			copied = copy_from_user(&irq_req, argp,
 						sizeof(irq_req));
-			if (copied != 0) {
+			if (copied) {
 				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
@@ -335,7 +335,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 			copied = copy_to_user(argp, &master,
 					      sizeof(master));
-			if (copied != 0) {
+			if (copied) {
 				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
@@ -350,7 +350,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			}
 
 			copied = copy_from_user(&master, argp, sizeof(master));
-			if (copied != 0) {
+			if (copied) {
 				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
@@ -380,7 +380,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 			copied = copy_to_user(argp, &slave,
 					      sizeof(slave));
-			if (copied != 0) {
+			if (copied) {
 				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
@@ -390,7 +390,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 		case VME_SET_SLAVE:
 
 			copied = copy_from_user(&slave, argp, sizeof(slave));
-			if (copied != 0) {
+			if (copied) {
 				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
@@ -757,7 +757,7 @@ static int __init vme_user_init(void)
 	 * we just change the code in vme_user_match().
 	 */
 	retval = vme_register_driver(&vme_user_driver, VME_MAX_SLOTS);
-	if (retval != 0)
+	if (retval)
 		goto err_reg;
 
 	return retval;
-- 
2.5.0


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

* [PATCH 6/6] drivers: staging: vme: Deleted casting to (void *)
  2015-11-22  9:27 [PATCH 1/6] drivers: staging: vme: Fixed indention Egor Uleyskiy
                   ` (3 preceding siblings ...)
  2015-11-22  9:27 ` [PATCH 5/6] drivers: staging: vme: Fixed checking NULL and 0 code style Egor Uleyskiy
@ 2015-11-22  9:27 ` Egor Uleyskiy
  4 siblings, 0 replies; 6+ messages in thread
From: Egor Uleyskiy @ 2015-11-22  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Egor Uleyskiy, Manohar Vanga, Martyn Welch, Trivial Patch Monkey,
	linux-kernel

From: Egor Uleyskiy <egor.ulieiskii@gmail.com>

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 30712da..4f3cdbc 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -343,7 +343,7 @@ static int pio2_probe(struct vme_dev *vdev)
 	vec = card->irq_vector | PIO2_VME_VECTOR_SPUR;
 
 	retval = vme_irq_request(vdev, card->irq_level, vec,
-				 &pio2_int, (void *)card);
+				 &pio2_int, card);
 	if (retval < 0) {
 		dev_err(&card->vdev->dev,
 			"Unable to attach VME interrupt vector0x%x, level 0x%x\n",
@@ -356,7 +356,7 @@ static int pio2_probe(struct vme_dev *vdev)
 		vec = card->irq_vector | PIO2_VECTOR_BANK[i];
 
 		retval = vme_irq_request(vdev, card->irq_level, vec,
-					 &pio2_int, (void *)card);
+					 &pio2_int, card);
 		if (retval < 0) {
 			dev_err(&card->vdev->dev,
 				"Unable to attach VME interrupt vector0x%x, level 0x%x\n",
@@ -370,7 +370,7 @@ static int pio2_probe(struct vme_dev *vdev)
 		vec = card->irq_vector | PIO2_VECTOR_CNTR[i];
 
 		retval = vme_irq_request(vdev, card->irq_level, vec,
-			&pio2_int, (void *)card);
+			&pio2_int, card);
 		if (retval < 0) {
 			dev_err(&card->vdev->dev,
 				"Unable to attach VME interrupt vector0x%x, level 0x%x\n",
-- 
2.5.0


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

end of thread, other threads:[~2015-11-22  9:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-22  9:27 [PATCH 1/6] drivers: staging: vme: Fixed indention Egor Uleyskiy
2015-11-22  9:27 ` [PATCH 2/6] drivers: staging: vme: Deleted extra empty lines Egor Uleyskiy
2015-11-22  9:27 ` [PATCH 3/6] drivers: staging: vme: Fixed the using of sizeof Egor Uleyskiy
2015-11-22  9:27 ` [PATCH 4/6] drivers: staging: vme: Deleted extra bracking Egor Uleyskiy
2015-11-22  9:27 ` [PATCH 5/6] drivers: staging: vme: Fixed checking NULL and 0 code style Egor Uleyskiy
2015-11-22  9:27 ` [PATCH 6/6] drivers: staging: vme: Deleted casting to (void *) Egor Uleyskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®