* [PATCH] stagging: android: logger: code cleanup
@ 2014-06-22 18:51 Jerry Stralko
2014-06-23 0:41 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Jerry Stralko @ 2014-06-22 18:51 UTC (permalink / raw)
To: greg, linux-kernel; +Cc: swetland, Jerry Stralko
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] stagging: android: logger: code cleanup
2014-06-22 18:51 [PATCH] stagging: android: logger: code cleanup Jerry Stralko
@ 2014-06-23 0:41 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2014-06-23 0:41 UTC (permalink / raw)
To: Jerry Stralko; +Cc: linux-kernel, swetland
On Sun, Jun 22, 2014 at 02:51:08PM -0400, Jerry Stralko wrote:
> Add the unlikey macro to the return value of nonseekable_open,
> since it always returns successfully.
That shouldn't be needed, gcc and the processor knows this already.
Don't use unusual unless you can measure it.
> Fixed up some checkpatch warnings.
Don't do more than one thing in a patch, please split this up.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] stagging: android: logger: code cleanup
@ 2014-06-24 22:09 Jerry Stralko
0 siblings, 0 replies; 3+ messages in thread
From: Jerry Stralko @ 2014-06-24 22:09 UTC (permalink / raw)
To: greg, linux-kernel; +Cc: swetland, Jerry Stralko
---
drivers/staging/android/logger.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index 2772e01..9b47e66 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,
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-24 22:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-22 18:51 [PATCH] stagging: android: logger: code cleanup Jerry Stralko
2014-06-23 0:41 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2014-06-24 22:09 Jerry Stralko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.