mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] parport_pc: use pr_cont
@ 2017-08-12 21:45 Sudip Mukherjee
  2017-08-12 21:45 ` [PATCH 2/3] parport: cleanup statics initialization to NULL or 0 Sudip Mukherjee
  2017-08-12 21:45 ` [PATCH 3/3] parport: use release_mem_region instead of release_resource Sudip Mukherjee
  0 siblings, 2 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2017-08-12 21:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Sudip Mukherjee

From: Mikulas Patocka <mpatocka@redhat.com>

The kernel adds newline automatically between printk calls, we must use
pr_cont if we want multiple printk strings on the same line.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/parport/parport_pc.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 5548193..489492b 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -1083,9 +1083,9 @@ static void show_parconfig_winbond(int io, int key)
 		printk(KERN_INFO "Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ",
 		       (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f);
 		if ((cr74 & 0x07) > 3)
-			printk("dma=none\n");
+			pr_cont("dma=none\n");
 		else
-			printk("dma=%d\n", cr74 & 0x07);
+			pr_cont("dma=%d\n", cr74 & 0x07);
 		printk(KERN_INFO
 		    "Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n",
 					irqtypes[crf0>>7], (crf0>>3)&0x0f);
@@ -1685,14 +1685,14 @@ static int parport_ECP_supported(struct parport *pb)
 			pb->base, config, configb);
 		printk(KERN_DEBUG "0x%lx: ECP settings irq=", pb->base);
 		if ((configb >> 3) & 0x07)
-			printk("%d", intrline[(configb >> 3) & 0x07]);
+			pr_cont("%d", intrline[(configb >> 3) & 0x07]);
 		else
-			printk("<none or set by other means>");
-		printk(" dma=");
+			pr_cont("<none or set by other means>");
+		pr_cont(" dma=");
 		if ((configb & 0x03) == 0x00)
-			printk("<none or set by other means>\n");
+			pr_cont("<none or set by other means>\n");
 		else
-			printk("%d\n", configb & 0x07);
+			pr_cont("%d\n", configb & 0x07);
 	}
 
 	/* Go back to mode 000 */
@@ -2399,8 +2399,8 @@ static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma,
 			"parport_pc: ITE 8872 parallel port: io=0x%X",
 								ite8872_lpt);
 		if (irq != PARPORT_IRQ_NONE)
-			printk(", irq=%d", irq);
-		printk("\n");
+			pr_cont(", irq=%d", irq);
+		pr_cont("\n");
 		return 1;
 	}
 
@@ -2581,10 +2581,10 @@ static int sio_via_probe(struct pci_dev *pdev, int autoirq, int autodma,
 		printk(KERN_INFO
 			"parport_pc: VIA parallel port: io=0x%X", port1);
 		if (irq != PARPORT_IRQ_NONE)
-			printk(", irq=%d", irq);
+			pr_cont(", irq=%d", irq);
 		if (dma != PARPORT_DMA_NONE)
-			printk(", dma=%d", dma);
-		printk("\n");
+			pr_cont(", dma=%d", dma);
+		pr_cont("\n");
 		return 1;
 	}
 
-- 
1.9.1

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

* [PATCH 2/3] parport: cleanup statics initialization to NULL or 0
  2017-08-12 21:45 [PATCH 1/3] parport_pc: use pr_cont Sudip Mukherjee
@ 2017-08-12 21:45 ` Sudip Mukherjee
  2017-08-12 21:45 ` [PATCH 3/3] parport: use release_mem_region instead of release_resource Sudip Mukherjee
  1 sibling, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2017-08-12 21:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Sudip Mukherjee

From: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>

based on checkpatch, cleanup the "do not initialise statics to" 0 or NULL.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/parport/daisy.c         | 2 +-
 drivers/parport/parport_atari.c | 2 +-
 drivers/parport/parport_ip32.c  | 2 +-
 drivers/parport/parport_mfc3.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c
index 46eb15f..5484a46 100644
--- a/drivers/parport/daisy.c
+++ b/drivers/parport/daisy.c
@@ -44,7 +44,7 @@
 } *topology = NULL;
 static DEFINE_SPINLOCK(topology_lock);
 
-static int numdevs = 0;
+static int numdevs;
 
 /* Forward-declaration of lower-level functions. */
 static int mux_present(struct parport *port);
diff --git a/drivers/parport/parport_atari.c b/drivers/parport/parport_atari.c
index a81cd2a..9fbf6cc 100644
--- a/drivers/parport/parport_atari.c
+++ b/drivers/parport/parport_atari.c
@@ -18,7 +18,7 @@
 #include <asm/irq.h>
 #include <asm/atariints.h>
 
-static struct parport *this_port = NULL;
+static struct parport *this_port;
 
 static unsigned char
 parport_atari_read_data(struct parport *p)
diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index dcbeeb2..0186db7 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -138,7 +138,7 @@
 static bool verbose_probing =	DEFAULT_VERBOSE_PROBING;
 
 /* We do not support more than one port. */
-static struct parport *this_port = NULL;
+static struct parport *this_port;
 
 /* Timing constants for FIFO modes.  */
 #define FIFO_NFAULT_TIMEOUT	100	/* milliseconds */
diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c
index 2f650f6..7f4be0e 100644
--- a/drivers/parport/parport_mfc3.c
+++ b/drivers/parport/parport_mfc3.c
@@ -174,7 +174,7 @@ static unsigned char mfc3_read_status(struct parport *p)
 	return status;
 }
 
-static int use_cnt = 0;
+static int use_cnt;
 
 static irqreturn_t mfc3_interrupt(int irq, void *dev_id)
 {
-- 
1.9.1

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

* [PATCH 3/3] parport: use release_mem_region instead of release_resource
  2017-08-12 21:45 [PATCH 1/3] parport_pc: use pr_cont Sudip Mukherjee
  2017-08-12 21:45 ` [PATCH 2/3] parport: cleanup statics initialization to NULL or 0 Sudip Mukherjee
@ 2017-08-12 21:45 ` Sudip Mukherjee
  1 sibling, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2017-08-12 21:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Sudip Mukherjee

From: Anton Vasilyev <vasilyev@ispras.ru>

Use api pair of request_mem_region and release_mem_region
instead of release_resource.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/parport/parport_ax88796.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/parport/parport_ax88796.c b/drivers/parport/parport_ax88796.c
index 8f8c9f3..2fc91ed 100644
--- a/drivers/parport/parport_ax88796.c
+++ b/drivers/parport/parport_ax88796.c
@@ -358,8 +358,7 @@ static int parport_ax88796_probe(struct platform_device *pdev)
  exit_unmap:
 	iounmap(dd->base);
  exit_res:
-	release_resource(dd->io);
-	kfree(dd->io);
+	release_mem_region(dd->io->start, size);
  exit_mem:
 	kfree(dd);
 	return ret;
@@ -373,8 +372,7 @@ static int parport_ax88796_remove(struct platform_device *pdev)
 	free_irq(p->irq, p);
 	parport_remove_port(p);
 	iounmap(dd->base);
-	release_resource(dd->io);
-	kfree(dd->io);
+	release_mem_region(dd->io->start, resource_size(dd->io));
 	kfree(dd);
 
 	return 0;
-- 
1.9.1

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

end of thread, other threads:[~2017-08-12 21:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-12 21:45 [PATCH 1/3] parport_pc: use pr_cont Sudip Mukherjee
2017-08-12 21:45 ` [PATCH 2/3] parport: cleanup statics initialization to NULL or 0 Sudip Mukherjee
2017-08-12 21:45 ` [PATCH 3/3] parport: use release_mem_region instead of release_resource Sudip Mukherjee

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®