* [PATCH v3 0/3] Cleanup for staging lustre obdclass
@ 2018-03-04 20:09 Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 1/3] staging: lustre: obdclass: Fix comparison to NULL Dafna Hirschfeld
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dafna Hirschfeld @ 2018-03-04 20:09 UTC (permalink / raw)
To: oleg.drokin, andreas.dilger, jsimmons, gregkh
Cc: Dafna Hirschfeld, outreachy-kernel
Fixes of issues found with checkpatch.pl for the lustre obdclass driver.
Changes in v3:
Adding the acked-by to the commit body in the patches
Dafna Hirschfeld (3):
staging: lustre: obdclass: Fix comparison to NULL
staging: lustre: obdclass: Add 'const' to char* array
staging: lustre: obdclass: Replace 'unsigned' with 'unsigned int'
drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +-
drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 +-
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 4 ++--
drivers/staging/lustre/lustre/obdclass/lu_object.c | 8 ++++----
4 files changed, 8 insertions(+), 8 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/3] staging: lustre: obdclass: Fix comparison to NULL
2018-03-04 20:09 [PATCH v3 0/3] Cleanup for staging lustre obdclass Dafna Hirschfeld
@ 2018-03-04 20:09 ` Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 2/3] staging: lustre: obdclass: Add 'const' to char* array Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 3/3] staging: lustre: obdclass: Replace 'unsigned' with 'unsigned int' Dafna Hirschfeld
2 siblings, 0 replies; 4+ messages in thread
From: Dafna Hirschfeld @ 2018-03-04 20:09 UTC (permalink / raw)
To: oleg.drokin, andreas.dilger, jsimmons, gregkh
Cc: Dafna Hirschfeld, outreachy-kernel
Replace comparison to NULL with a 'not' operator.
Issue found with checkpatch.
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index e1f4ef2..64cc746 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1585,7 +1585,7 @@ int ldebugfs_seq_create(struct dentry *parent, const char *name,
struct dentry *entry;
/* Disallow secretly (un)writable entries. */
- LASSERT((seq_fops->write == NULL) == ((mode & 0222) == 0));
+ LASSERT((!seq_fops->write) == ((mode & 0222) == 0));
entry = debugfs_create_file(name, mode, parent, data, seq_fops);
if (IS_ERR_OR_NULL(entry))
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/3] staging: lustre: obdclass: Add 'const' to char* array
2018-03-04 20:09 [PATCH v3 0/3] Cleanup for staging lustre obdclass Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 1/3] staging: lustre: obdclass: Fix comparison to NULL Dafna Hirschfeld
@ 2018-03-04 20:09 ` Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 3/3] staging: lustre: obdclass: Replace 'unsigned' with 'unsigned int' Dafna Hirschfeld
2 siblings, 0 replies; 4+ messages in thread
From: Dafna Hirschfeld @ 2018-03-04 20:09 UTC (permalink / raw)
To: oleg.drokin, andreas.dilger, jsimmons, gregkh
Cc: Dafna Hirschfeld, outreachy-kernel
Replace 'const char*' arrays with 'const char * const'
since the values in the arrays are not changed.
Issues found with checkpatch.pl
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +-
drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 3b683b7..9ca29a2 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -224,7 +224,7 @@ EXPORT_SYMBOL(cl_lock_release);
const char *cl_lock_mode_name(const enum cl_lock_mode mode)
{
- static const char *names[] = {
+ static const char * const names[] = {
[CLM_READ] = "R",
[CLM_WRITE] = "W",
[CLM_GROUP] = "G"
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
index 7b18d77..7809f6a 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
@@ -495,7 +495,7 @@ static struct cache_stats cl_env_stats = {
int cl_site_stats_print(const struct cl_site *site, struct seq_file *m)
{
size_t i;
- static const char *pstate[] = {
+ static const char * const pstate[] = {
[CPS_CACHED] = "c",
[CPS_OWNED] = "o",
[CPS_PAGEOUT] = "w",
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 3/3] staging: lustre: obdclass: Replace 'unsigned' with 'unsigned int'
2018-03-04 20:09 [PATCH v3 0/3] Cleanup for staging lustre obdclass Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 1/3] staging: lustre: obdclass: Fix comparison to NULL Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 2/3] staging: lustre: obdclass: Add 'const' to char* array Dafna Hirschfeld
@ 2018-03-04 20:09 ` Dafna Hirschfeld
2 siblings, 0 replies; 4+ messages in thread
From: Dafna Hirschfeld @ 2018-03-04 20:09 UTC (permalink / raw)
To: oleg.drokin, andreas.dilger, jsimmons, gregkh
Cc: Dafna Hirschfeld, outreachy-kernel
Replace 'unsigned' with 'unsigned int' to improve readability.
Issues found with checkpatch.pl
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
drivers/staging/lustre/lustre/obdclass/lu_object.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 64cc746..2ed3505 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1467,7 +1467,7 @@ int lprocfs_write_frac_u64_helper(const char __user *buffer,
{
char kernbuf[22], *end, *pbuf;
__u64 whole, frac = 0, units;
- unsigned frac_d = 1;
+ unsigned int frac_d = 1;
int sign = 1;
if (count > (sizeof(kernbuf) - 1))
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index cca6881..964e854 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -1797,10 +1797,10 @@ int lu_env_refill(struct lu_env *env)
EXPORT_SYMBOL(lu_env_refill);
struct lu_site_stats {
- unsigned lss_populated;
- unsigned lss_max_search;
- unsigned lss_total;
- unsigned lss_busy;
+ unsigned int lss_populated;
+ unsigned int lss_max_search;
+ unsigned int lss_total;
+ unsigned int lss_busy;
};
static void lu_site_stats_get(struct cfs_hash *hs,
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-04 20:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-04 20:09 [PATCH v3 0/3] Cleanup for staging lustre obdclass Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 1/3] staging: lustre: obdclass: Fix comparison to NULL Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 2/3] staging: lustre: obdclass: Add 'const' to char* array Dafna Hirschfeld
2018-03-04 20:09 ` [PATCH v3 3/3] staging: lustre: obdclass: Replace 'unsigned' with 'unsigned int' Dafna Hirschfeld
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.