linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix coding style problems reported by checkpatch
@ 2015-12-01  9:48 Rajan Vaja
  2015-12-01  9:48 ` [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem Rajan Vaja
  2015-12-01  9:48 ` [PATCH v2 2/2] staging: fwserial: Fix no space after cast checkpatch issue Rajan Vaja
  0 siblings, 2 replies; 4+ messages in thread
From: Rajan Vaja @ 2015-12-01  9:48 UTC (permalink / raw)
  To: gregkh
  Cc: carlos, mahfouz.saif.elyazal, rodriguez.twister, peter, devel,
	linux-kernel

Changes in v2:
Split patch into two different patches as suggested by
Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Rajan Vaja (2):
  staging: fwserial: Fix pointer comparison to NULL checkpatch problem
  staging: fwserial: Fix no space after cast checkpatch issue

 drivers/staging/fwserial/dma_fifo.c |   10 +++++-----
 drivers/staging/fwserial/fwserial.c |   18 +++++++++---------
 2 files changed, 14 insertions(+), 14 deletions(-)

--
1.7.9.5


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

* [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem
  2015-12-01  9:48 [PATCH v2 0/2] Fix coding style problems reported by checkpatch Rajan Vaja
@ 2015-12-01  9:48 ` Rajan Vaja
  2016-02-08  3:36   ` Greg KH
  2015-12-01  9:48 ` [PATCH v2 2/2] staging: fwserial: Fix no space after cast checkpatch issue Rajan Vaja
  1 sibling, 1 reply; 4+ messages in thread
From: Rajan Vaja @ 2015-12-01  9:48 UTC (permalink / raw)
  To: gregkh
  Cc: carlos, mahfouz.saif.elyazal, rodriguez.twister, peter, devel,
	linux-kernel

Fix pointer comparison to NULL problem reported by checkpatch.

Signed-off-by: Rajan Vaja <rajan.vaja@gmail.com>
---
 drivers/staging/fwserial/dma_fifo.c |   10 +++++-----
 drivers/staging/fwserial/fwserial.c |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fwserial/dma_fifo.c b/drivers/staging/fwserial/dma_fifo.c
index 7a3347c..4cd3ed3 100644
--- a/drivers/staging/fwserial/dma_fifo.c
+++ b/drivers/staging/fwserial/dma_fifo.c
@@ -106,7 +106,7 @@ void dma_fifo_free(struct dma_fifo *fifo)
 {
 	struct dma_pending *pending, *next;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return;

 	list_for_each_entry_safe(pending, next, &fifo->pending, link)
@@ -123,7 +123,7 @@ void dma_fifo_reset(struct dma_fifo *fifo)
 {
 	struct dma_pending *pending, *next;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return;

 	list_for_each_entry_safe(pending, next, &fifo->pending, link)
@@ -149,7 +149,7 @@ int dma_fifo_in(struct dma_fifo *fifo, const void *src, int n)
 {
 	int ofs, l;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return -ENOENT;
 	if (fifo->corrupt)
 		return -ENXIO;
@@ -192,7 +192,7 @@ int dma_fifo_out_pend(struct dma_fifo *fifo, struct dma_pending *pended)
 {
 	unsigned len, n, ofs, l, limit;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return -ENOENT;
 	if (fifo->corrupt)
 		return -ENXIO;
@@ -252,7 +252,7 @@ int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete)
 {
 	struct dma_pending *pending, *next, *tmp;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return -ENOENT;
 	if (fifo->corrupt)
 		return -ENXIO;
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index b3ea4bb..38ba145 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1701,7 +1701,7 @@ static void fwserial_virt_plug_complete(struct fwtty_peer *peer,
 	dma_fifo_change_tx_limit(&port->tx_fifo, port->max_payload);
 	spin_unlock_bh(&peer->port->lock);

-	if (port->port.console && port->fwcon_ops->notify != NULL)
+	if (port->port.console && port->fwcon_ops->notify)
 		(*port->fwcon_ops->notify)(FWCON_NOTIFY_ATTACH, port->con_data);

 	fwtty_info(&peer->unit, "peer (guid:%016llx) connected on %s\n",
@@ -1808,7 +1808,7 @@ static void fwserial_release_port(struct fwtty_port *port, bool reset)
 	RCU_INIT_POINTER(port->peer, NULL);
 	spin_unlock_bh(&port->lock);

-	if (port->port.console && port->fwcon_ops->notify != NULL)
+	if (port->port.console && port->fwcon_ops->notify)
 		(*port->fwcon_ops->notify)(FWCON_NOTIFY_DETACH, port->con_data);
 }

--
1.7.9.5


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

* [PATCH v2 2/2] staging: fwserial: Fix no space after cast checkpatch issue
  2015-12-01  9:48 [PATCH v2 0/2] Fix coding style problems reported by checkpatch Rajan Vaja
  2015-12-01  9:48 ` [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem Rajan Vaja
@ 2015-12-01  9:48 ` Rajan Vaja
  1 sibling, 0 replies; 4+ messages in thread
From: Rajan Vaja @ 2015-12-01  9:48 UTC (permalink / raw)
  To: gregkh
  Cc: carlos, mahfouz.saif.elyazal, rodriguez.twister, peter, devel,
	linux-kernel

Fix "No space is necessary after a cast" problem
reported by checkpatch.

Signed-off-by: Rajan Vaja <rajan.vaja@gmail.com>
---
 drivers/staging/fwserial/fwserial.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 38ba145..06c23d3 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1466,9 +1466,9 @@ static void fwtty_debugfs_show_peer(struct seq_file *m, struct fwtty_peer *peer)
 	seq_printf(m, " %s:", dev_name(&peer->unit->device));
 	seq_printf(m, " node:%04x gen:%d", peer->node_id, generation);
 	seq_printf(m, " sp:%d max:%d guid:%016llx", peer->speed,
-		   peer->max_payload, (unsigned long long) peer->guid);
-	seq_printf(m, " mgmt:%012llx", (unsigned long long) peer->mgmt_addr);
-	seq_printf(m, " addr:%012llx", (unsigned long long) peer->status_addr);
+		   peer->max_payload, (unsigned long long)peer->guid);
+	seq_printf(m, " mgmt:%012llx", (unsigned long long)peer->mgmt_addr);
+	seq_printf(m, " addr:%012llx", (unsigned long long)peer->status_addr);
 	seq_putc(m, '\n');
 }

@@ -1515,7 +1515,7 @@ static int fwtty_debugfs_peers_show(struct seq_file *m, void *v)
 	rcu_read_lock();
 	seq_printf(m, "card: %s  guid: %016llx\n",
 		   dev_name(serial->card->device),
-		   (unsigned long long) serial->card->guid);
+		   (unsigned long long)serial->card->guid);
 	list_for_each_entry_rcu(peer, &serial->peer_list, list)
 		fwtty_debugfs_show_peer(m, peer);
 	rcu_read_unlock();
@@ -1987,7 +1987,7 @@ static struct fwtty_peer *__fwserial_peer_by_node_id(struct fw_card *card,
 		 * been probed for any unit devices...
 		 */
 		fwtty_err(card, "unknown card (guid %016llx)\n",
-			  (unsigned long long) card->guid);
+			  (unsigned long long)card->guid);
 		return NULL;
 	}

@@ -2017,7 +2017,7 @@ static void __dump_peer_list(struct fw_card *card)

 		smp_rmb();
 		fwtty_dbg(card, "peer(%d:%x) guid: %016llx\n",
-			  g, peer->node_id, (unsigned long long) peer->guid);
+			  g, peer->node_id, (unsigned long long)peer->guid);
 	}
 }
 #else
@@ -2314,7 +2314,7 @@ static int fwserial_create(struct fw_unit *unit)
 	list_add_rcu(&serial->list, &fwserial_list);

 	fwtty_notice(&unit, "TTY over FireWire on device %s (guid %016llx)\n",
-		     dev_name(card->device), (unsigned long long) card->guid);
+		     dev_name(card->device), (unsigned long long)card->guid);

 	err = fwserial_add_peer(serial, unit);
 	if (!err)
--
1.7.9.5


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

* Re: [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem
  2015-12-01  9:48 ` [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem Rajan Vaja
@ 2016-02-08  3:36   ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-02-08  3:36 UTC (permalink / raw)
  To: Rajan Vaja; +Cc: devel, peter, carlos, linux-kernel

On Tue, Dec 01, 2015 at 03:18:11PM +0530, Rajan Vaja wrote:
> Fix pointer comparison to NULL problem reported by checkpatch.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@gmail.com>
> ---
>  drivers/staging/fwserial/dma_fifo.c |   10 +++++-----
>  drivers/staging/fwserial/fwserial.c |    4 ++--
>  2 files changed, 7 insertions(+), 7 deletions(-)

Someone else sent this, and patch 2/2 already before you did, sorry.

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

end of thread, other threads:[~2016-02-08  3:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01  9:48 [PATCH v2 0/2] Fix coding style problems reported by checkpatch Rajan Vaja
2015-12-01  9:48 ` [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem Rajan Vaja
2016-02-08  3:36   ` Greg KH
2015-12-01  9:48 ` [PATCH v2 2/2] staging: fwserial: Fix no space after cast checkpatch issue Rajan Vaja

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).