staging: lustre: Replace typedef with struct
PATCH v2 1/1 staging: lustre: Replace typedef with struct
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Coccinelle script:
@r1@
type T;
@@
typedef struct { ... } T;
@script:python c1@
T2;
T << r1.T;
@@
coccinelle.T2=T;
@@
type r1.T;
identifier c1.T2;
@@
-typedef
struct
+ T2
{ ... }
-T
;
---
Changes in v2:
- Improved the commit message.
--- drivers/staging/lustre/lustre/include/lustre_eacl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/include/lustre_eacl.h +6 -6
@@ -49,17 +49,17 @@#include <linux/fs.h> #include <linux/posix_acl_xattr.h> -typedef struct { +struct ext_acl_xattr_entry {__u16 e_tag;__u16 e_perm;__u32 e_id;__u32 e_stat; -}ext_acl_xattr_entry ; +}; -typedef struct { -__u32 a_count; -ext_acl_xattr_entry a_entries[0 ]; -}ext_acl_xattr_header ; +struct ext_acl_xattr_header { +__u32 a_count; +struct ext_acl_xattr_entry a_entries[0 ]; +};#define CFS_ACL_XATTR_SIZE (count, prefix) \ (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry))
Signature · 1 line
2.7.4
Quoted 4 lines · Gargi Sharma
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Actually, I'm not sure to understand. No uses of the structures were found at all? If so, they should just be dropped. Or are there uses, but they already have the word "struct" in front of them?
julia
Quoted 72 lines
Coccinelle script:
@r1@
type T;
@@typedef struct { ... } T;
@script:python c1@
T2;
T << r1.T;
@@
coccinelle.T2=T;@@
type r1.T;
identifier c1.T2;
@@
-typedef
struct
+ T2
{ ... }
-T
;Signed-off-by Gargi Sharma <[email protected]>---
Changes in v2:
- Improved the commit message.--- drivers/staging/lustre/lustre/include/lustre_eacl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/staging/lustre/lustre/include/lustre_eacl.h +6
-7@@ -49,17 +49,17 @@#include <linux/fs.h> #include <linux/posix_acl_xattr.h> -typedef struct { +struct ext_acl_xattr_entry {__u16 e_tag;__u16 e_perm;__u32 e_id;__u32 e_stat; -}ext_acl_xattr_entry ; +}; -typedef struct { -__u32 a_count; -ext_acl_xattr_entry a_entries[0 ]; -}ext_acl_xattr_header ; +struct ext_acl_xattr_header { +__u32 a_count; +struct ext_acl_xattr_entry a_entries[0 ]; +};#define CFS_ACL_XATTR_SIZE (count, prefix) \ (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry)) --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1488265307-24641-1-git-send-email-gs051095%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 5 lines · Julia Lawall
On Tue, 28 Feb 2017, Gargi Sharma wrote:
Quoted 8 lines
Quoted 4 lines
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Actually, I'm not sure to understand. No uses of the structures were found at all? If so, they should just be dropped. Or are there uses, but they already have the word "struct" in front of them?
The first structure "ext_acl_xattr_entry" is used as one of the fields in the
other structure "ext_acl_xattr_header". I could not find any uses of the structure
"ext_acl_xattr_header" inside the staging directory. Should I drop these two structures then?
gargi
Quoted 37 lines
julia
Quoted 34 lines
Coccinelle script:
@r1@
type T;
@@typedef struct { ... } T;
@script:python c1@
T2;
T << r1.T;
@@
coccinelle.T2=T;@@
type r1.T;
identifier c1.T2;
@@
-typedef
struct
+ T2
{ ... }
-T
;Signed-off-by Gargi Sharma <[email protected]>---
Changes in v2:
- Improved the commit message.--- drivers/staging/lustre/lustre/include/lustre_eacl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/staging/lustre/lustre/include/lustre_eacl.h
Quoted 25 lines
Quoted 25 lines
index 1e71a86..c198eda 100644
drivers/staging/lustre/lustre/include/lustre_eacl.h +6
-6@@ -49,17 +49,17 @@#include <linux/fs.h> #include <linux/posix_acl_xattr.h> -typedef struct { +struct ext_acl_xattr_entry {__u16 e_tag;__u16 e_perm;__u32 e_id;__u32 e_stat; -}ext_acl_xattr_entry ; +}; -typedef struct { -__u32 a_count; -ext_acl_xattr_entry a_entries[0 ]; -}ext_acl_xattr_header ; +struct ext_acl_xattr_header { +__u32 a_count; +struct ext_acl_xattr_entry a_entries[0 ]; +};
Quoted 7 lines
Quoted 7 lines
drivers/staging/lustre/lustre/include/lustre_eacl.h +0
-1#define CFS_ACL_XATTR_SIZE (count, prefix) \ (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry)) --2.7.4
--
You received this message because you are subscribed to the Google
Groups "outreachy-kernel" group.
Quoted 1 line
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/
msgid/outreachy-kernel/1488265307-24641-1-git-send- email-gs051095%40gmail.com.
Quoted 2 lines
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Greg KH
maintainerQuoted 15 lines · Gargi Sharma
Quoted 5 lines · Julia Lawall
On Tue, 28 Feb 2017, Gargi Sharma wrote:
Quoted 8 lines
Quoted 4 lines
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Actually, I'm not sure to understand.� No uses of the structures were found at all?� If so, they should just be dropped.� Or are there uses, but they already have the word "struct" in front of them?
Quoted 5 lines
The first structure "
ext_acl_xattr_entry" is used as one of the fields in the� other structure "ext_acl_xattr_header". I could not find any uses of the structure
"ext_acl_xattr_header" inside the staging directory. Should I drop these two structures then?
I think so, we shouldn't keep around structures that are not actually used.
Unless the Lustre maintainers are hiding something somewhere else that uses these?
thanks,
greg k-h
Quoted 23 lines · Greg KH
Quoted 15 lines · Gargi Sharma
Quoted 5 lines · Julia Lawall
On Tue, 28 Feb 2017, Gargi Sharma wrote:
Quoted 8 lines
Quoted 4 lines
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Actually, I'm not sure to understand. No uses of the structures were found at all? If so, they should just be dropped. Or are there uses, but they already have the word "struct" in front of them?
Quoted 5 lines
The first structure "
ext_acl_xattr_entry" is used as one of the fields in the other structure "ext_acl_xattr_header". I could not find any uses of the structure
"ext_acl_xattr_header" inside the staging directory. Should I drop these two structures then?
Quoted 5 lines
I think so, we shouldn't keep around structures that are not actually used.
Unless the Lustre maintainers are hiding something somewhere else that uses these?
Looks like this is left over from 341f1f0affed1c24712f37c95bb654b3b33ab2c6 "staging: lustre: remove remote client support". The ext_acl_xattr_{entry,header} structs were accessed from CFS_ACL_XATTR_SIZE() and CFS_ACL_XATTR_COUNT() macros, along with posix_acl_xattr_{entry,header} but it looks like all of that was deleted (and good riddance). The CFS_ACL_XATTR_* macros should be removed also.
That leaves the lustre_eacl.h header empty, so it could just be deleted entirely, and removed from llite/llite_internal.h (where posix_acl_xattr.h is already included) and llite/xattr.h (which includes llite_internal.h).
Cheers, Andreas
Quoted 5 lines · Andreas
Quoted 3 lines · Greg KH
Quoted 1 line · Gargi Sharma
On Tue, Feb 28, 2017 at 12:36 PM, Julia Lawall <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Gargi Sharma
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Actually, I'm not sure to understand. No uses of the structures were found at all? If so, they should just be dropped. Or are there
uses, but
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
they already have the word "struct" in front of them?
The first structure "
ext_acl_xattr_entry" is used as one of the fields
in the
Quoted 1 line
Quoted 1 line
Quoted 1 line
other structure "
ext_acl_xattr_header". I could not find any uses of
the
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
structure
"ext_acl_xattr_header" inside the staging directory. Should I drop
these two
Quoted 10 lines
Quoted 7 lines
Quoted 1 line
structures then?
I think so, we shouldn't keep around structures that are not actually used.
Unless the Lustre maintainers are hiding something somewhere else that uses these?
Looks like this is left over from
341f1f0affed1c24712f37c95bb654b3b33ab2c6"staging: lustre: remove remote client support". The
ext_acl_xattr_{entry,header}
Quoted 1 line
structs were accessed from
CFS_ACL_XATTR_SIZE()andCFS_ACL_XATTR_COUNT()
macros,
Quoted 1 line
along with posix_acl_xattr_{entry,header} but it looks like all of that
was deleted
Quoted 2 lines
(and good riddance). The CFS_ACL_XATTR_* macros should be removed also.
Hi,
Quoted 2 lines
That leaves the
lustre_eacl.hheader empty, so it could just be deleted
entirely,
Quoted 1 line
and removed from
llite/llite_internal.h(whereposix_acl_xattr.his
already included)
Quoted 1 line
and
llite/xattr.h(which includesllite_internal.h).
Okay, that makes sense. So should I send a v3 where I delete the header file and places it
has been referred, or an entirely new patch?
thanks,
gargi
Quoted 42 lines · Gargi Sharma
Quoted 28 lines · Andreas
Quoted 26 lines · Greg KH
Quoted 15 lines · Gargi Sharma
Quoted 5 lines · Julia Lawall
On Tue, 28 Feb 2017, Gargi Sharma wrote:
Quoted 8 lines
Quoted 4 lines
As per the Linux kernel coding style guidelines, using typedef for a structure type is not recommended. Hence, occurences of typedefs have been removed. To find the occurences of the structures grep was used and no uses were found.
Actually, I'm not sure to understand. No uses of the structures were found at all? If so, they should just be dropped. Or are there uses, but they already have the word "struct" in front of them?
Quoted 5 lines
The first structure "
ext_acl_xattr_entry" is used as one of the fields in the other structure "ext_acl_xattr_header". I could not find any uses of the structure
"ext_acl_xattr_header" inside the staging directory. Should I drop these two structures then?I think so, we shouldn't keep around structures that are not actually used.
Quoted 9 lines
Quoted 2 lines
Unless the Lustre maintainers are hiding something somewhere else that uses these?
Looks like this is left over from
341f1f0affed1c24712f37c95bb654b3b33ab2c6"staging: lustre: remove remote client support". The ext_acl_xattr_{entry,header} structs were accessed fromCFS_ACL_XATTR_SIZE()andCFS_ACL_XATTR_COUNT()macros, along with posix_acl_xattr_{entry,header} but it looks like all of that was deleted (and good riddance). The CFS_ACL_XATTR_* macros should be removed also.Hi,
Quoted 1 line
Quoted 6 lines
Quoted 3 lines
That leaves the
lustre_eacl.hheader empty, so it could just be deleted entirely, and removed fromllite/llite_internal.h(whereposix_acl_xattr.his already included) andllite/xattr.h(which includesllite_internal.h).Okay, that makes sense. So should I send a v3 where I delete the header file and places it has been referred, or an entirely new patch?
If the whole header is being deleted, there isn't any point to have the earlier patch. It makes the most sense to just have a single patch that deletes the unused header.
Cheers, Andreas
--
Andreas Dilger