linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ceph: Move static keyword to the front of declarations
@ 2019-08-31 21:57 Krzysztof Wilczynski
  2019-09-02  8:54 ` Ilya Dryomov
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Wilczynski @ 2019-08-31 21:57 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Sage Weil, Ilya Dryomov, ceph-devel, linux-kernel

Move the static keyword to the front of declarations of
snap_handle_length, handle_length and connected_handle_length,
and resolve the following compiler warnings that can be seen
when building with warnings enabled (W=1):

fs/ceph/export.c:38:2: warning:
  ‘static’ is not at beginning of declaration [-Wold-style-declaration]

fs/ceph/export.c:88:2: warning:
  ‘static’ is not at beginning of declaration [-Wold-style-declaration]

fs/ceph/export.c:90:2: warning:
  ‘static’ is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
---
Related: https://lore.kernel.org/r/20190827233017.GK9987@google.com

 fs/ceph/export.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 020d39a85ecc..b6bfa94332c3 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -35,7 +35,7 @@ struct ceph_nfs_snapfh {
 static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
 			      struct inode *parent_inode)
 {
-	const static int snap_handle_length =
+	static const int snap_handle_length =
 		sizeof(struct ceph_nfs_snapfh) >> 2;
 	struct ceph_nfs_snapfh *sfh = (void *)rawfh;
 	u64 snapid = ceph_snap(inode);
@@ -85,9 +85,9 @@ static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
 static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
 			  struct inode *parent_inode)
 {
-	const static int handle_length =
+	static const int handle_length =
 		sizeof(struct ceph_nfs_fh) >> 2;
-	const static int connected_handle_length =
+	static const int connected_handle_length =
 		sizeof(struct ceph_nfs_confh) >> 2;
 	int type;
 
-- 
2.22.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ceph: Move static keyword to the front of declarations
  2019-08-31 21:57 [PATCH] ceph: Move static keyword to the front of declarations Krzysztof Wilczynski
@ 2019-09-02  8:54 ` Ilya Dryomov
  0 siblings, 0 replies; 2+ messages in thread
From: Ilya Dryomov @ 2019-09-02  8:54 UTC (permalink / raw)
  To: Krzysztof Wilczynski; +Cc: Jeff Layton, Sage Weil, Ceph Development, LKML

On Sat, Aug 31, 2019 at 11:57 PM Krzysztof Wilczynski <kw@linux.com> wrote:
>
> Move the static keyword to the front of declarations of
> snap_handle_length, handle_length and connected_handle_length,
> and resolve the following compiler warnings that can be seen
> when building with warnings enabled (W=1):
>
> fs/ceph/export.c:38:2: warning:
>   ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>
> fs/ceph/export.c:88:2: warning:
>   ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>
> fs/ceph/export.c:90:2: warning:
>   ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>
> Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
> ---
> Related: https://lore.kernel.org/r/20190827233017.GK9987@google.com
>
>  fs/ceph/export.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ceph/export.c b/fs/ceph/export.c
> index 020d39a85ecc..b6bfa94332c3 100644
> --- a/fs/ceph/export.c
> +++ b/fs/ceph/export.c
> @@ -35,7 +35,7 @@ struct ceph_nfs_snapfh {
>  static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
>                               struct inode *parent_inode)
>  {
> -       const static int snap_handle_length =
> +       static const int snap_handle_length =
>                 sizeof(struct ceph_nfs_snapfh) >> 2;
>         struct ceph_nfs_snapfh *sfh = (void *)rawfh;
>         u64 snapid = ceph_snap(inode);
> @@ -85,9 +85,9 @@ static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
>  static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
>                           struct inode *parent_inode)
>  {
> -       const static int handle_length =
> +       static const int handle_length =
>                 sizeof(struct ceph_nfs_fh) >> 2;
> -       const static int connected_handle_length =
> +       static const int connected_handle_length =
>                 sizeof(struct ceph_nfs_confh) >> 2;
>         int type;

Applied.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-02  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31 21:57 [PATCH] ceph: Move static keyword to the front of declarations Krzysztof Wilczynski
2019-09-02  8:54 ` Ilya Dryomov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).