mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Bernat <vincent@bernat.im>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Eli Billauer <eli.billauer@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Vincent Bernat <vincent@bernat.im>
Subject: [PATCH] staging: xillybus: fix some coding style errors
Date: Wed, 16 Jul 2014 15:19:42 +0200	[thread overview]
Message-ID: <1405516782-11434-1-git-send-email-vincent@bernat.im> (raw)

This includes:
 - keep "else" on the same line as the closing brace
 - don't use "else" after "return"
 - don't issue a message for an out-of-memory error
 - blank line after a declaration

Signed-off-by: Vincent Bernat <vincent@bernat.im>
---
 drivers/staging/xillybus/xillybus_core.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c
index ab6502caa72c..2d59734744e5 100644
--- a/drivers/staging/xillybus/xillybus_core.c
+++ b/drivers/staging/xillybus/xillybus_core.c
@@ -138,7 +138,6 @@ irqreturn_t xillybus_isr(int irq, void *data)
 	 * guaranteed no interrupt will occur, but in theory, the cache
 	 * lines may not be updated. So a memory barrier is issued.
 	 */
-
 	smp_rmb();
 
 	buf = ep->msgbuf_addr;
@@ -546,8 +545,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep,
 			channel->rd_buffers = buffers;
 			rc = xilly_get_dma_buffers(ep, &rd_alloc, buffers,
 						   bufnum, bytebufsize);
-		}
-		else if (channelnum > 0) {
+		} else if (channelnum > 0) {
 			channel->num_wr_buffers = bufnum;
 
 			channel->seekable = seekable;
@@ -610,8 +608,8 @@ static void xilly_scan_idt(struct xilly_endpoint *endpoint,
 			"IDT device name list overflow. Aborting.\n");
 		idt_handle->chandesc = NULL;
 		return;
-	} else
-		idt_handle->chandesc = scan;
+	}
+	idt_handle->chandesc = scan;
 
 	len = endpoint->idtlen - (3 + ((int) (scan - idt)));
 
@@ -722,6 +720,7 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf,
 
 	while (1) { /* Note that we may drop mutex within this loop */
 		int bytes_to_do = count - bytes_done;
+
 		spin_lock_irqsave(&channel->wr_spinlock, flags);
 
 		empty = channel->wr_empty;
@@ -1963,10 +1962,8 @@ struct xilly_endpoint *xillybus_init_endpoint(struct pci_dev *pdev,
 	struct xilly_endpoint *endpoint;
 
 	endpoint = devm_kzalloc(dev, sizeof(*endpoint), GFP_KERNEL);
-	if (!endpoint) {
-		dev_err(dev, "Failed to allocate memory. Aborting.\n");
+	if (!endpoint)
 		return NULL;
-	}
 
 	endpoint->pdev = pdev;
 	endpoint->dev = dev;
-- 
2.0.1


             reply	other threads:[~2014-07-16 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 13:19 Vincent Bernat [this message]
2014-08-10  3:34 ` Greg Kroah-Hartman
2014-08-10 12:16   ` Vincent Bernat
2014-08-10 12:25     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405516782-11434-1-git-send-email-vincent@bernat.im \
    --to=vincent@bernat.im \
    --cc=devel@driverdev.osuosl.org \
    --cc=eli.billauer@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®