mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jerry Stralko <gerb.stralko@gmail.com>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Cc: swetland@google.com, Jerry Stralko <gerb.stralko@gmail.com>
Subject: [PATCH] stagging: android: logger: code cleanup
Date: Sun, 22 Jun 2014 14:51:08 -0400	[thread overview]
Message-ID: <1403463068-21850-1-git-send-email-gerb.stralko@gmail.com> (raw)

Add the unlikey macro to the return value of nonseekable_open,
since it always returns successfully.

Fixed up some checkpatch warnings.

Signed-off-by: Jerry Stralko <gerb.stralko@gmail.com>
---
 drivers/staging/android/logger.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index 2772e01..b98d181 100644
--- a/drivers/staging/android/logger.c
+++ b/drivers/staging/android/logger.c
@@ -110,8 +110,8 @@ static inline struct logger_log *file_get_log(struct file *file)
 		struct logger_reader *reader = file->private_data;
 
 		return reader->log;
-	} else
-		return file->private_data;
+	}
+	return file->private_data;
 }
 
 /*
@@ -159,8 +159,7 @@ static size_t get_user_hdr_len(int ver)
 {
 	if (ver < 2)
 		return sizeof(struct user_logger_entry_compat);
-	else
-		return sizeof(struct logger_entry);
+	return sizeof(struct logger_entry);
 }
 
 static ssize_t copy_header_to_user(int ver, struct logger_entry *entry,
@@ -552,7 +551,7 @@ static int logger_open(struct inode *inode, struct file *file)
 	int ret;
 
 	ret = nonseekable_open(inode, file);
-	if (ret)
+	if (unlikely(ret))
 		return ret;
 
 	log = get_log_from_minor(MINOR(inode->i_rdev));
-- 
1.9.3


             reply	other threads:[~2014-06-22 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-22 18:51 Jerry Stralko [this message]
2014-06-23  0:41 ` Greg KH
2014-06-24 22:09 Jerry Stralko

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=1403463068-21850-1-git-send-email-gerb.stralko@gmail.com \
    --to=gerb.stralko@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swetland@google.com \
    /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®