linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipc/msg.c: Adjust indentation in ksys_msgctl
@ 2019-12-18  3:29 Nathan Chancellor
  2019-12-19 20:28 ` Nick Desaulniers
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2019-12-18  3:29 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Lu Shuaibing, linux-kernel, clang-built-linux, Nathan Chancellor

Clang warns:

../ipc/msg.c:621:4: warning: misleading indentation; statement is not
part of the previous 'if' [-Wmisleading-indentation]
                 return msgctl_down(ns, msqid, cmd, &msqid64.msg_perm,
msqid64.msg_qbytes);
                 ^
../ipc/msg.c:619:3: note: previous statement is here
                if (copy_msqid_from_user(&msqid64, buf, version))
                ^
1 warning generated.

This warning occurs because there is a space after the tab on this line.
Remove it so that the indentation is consistent with the Linux kernel
coding style and clang no longer warns.

Link: https://github.com/ClangBuiltLinux/linux/issues/829
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

I assume this will be squashed into the offending patch since it is
still in -next:

https://git.kernel.org/next/linux-next/c/658622e448a6e6a6a69471daeff7e95e98d34ed1

 ipc/msg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index 22ed09ded601..caca67368cb5 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -618,7 +618,8 @@ static long ksys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf, int ver
 	case IPC_SET:
 		if (copy_msqid_from_user(&msqid64, buf, version))
 			return -EFAULT;
-		 return msgctl_down(ns, msqid, cmd, &msqid64.msg_perm, msqid64.msg_qbytes);
+		return msgctl_down(ns, msqid, cmd, &msqid64.msg_perm,
+				   msqid64.msg_qbytes);
 	case IPC_RMID:
 		return msgctl_down(ns, msqid, cmd, NULL, 0);
 	default:
-- 
2.24.1


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

* Re: [PATCH] ipc/msg.c: Adjust indentation in ksys_msgctl
  2019-12-18  3:29 [PATCH] ipc/msg.c: Adjust indentation in ksys_msgctl Nathan Chancellor
@ 2019-12-19 20:28 ` Nick Desaulniers
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2019-12-19 20:28 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Andrew Morton, Lu Shuaibing, LKML, clang-built-linux

On Tue, Dec 17, 2019 at 7:30 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Clang warns:
>
> ../ipc/msg.c:621:4: warning: misleading indentation; statement is not
> part of the previous 'if' [-Wmisleading-indentation]
>                  return msgctl_down(ns, msqid, cmd, &msqid64.msg_perm,
> msqid64.msg_qbytes);
>                  ^
> ../ipc/msg.c:619:3: note: previous statement is here
>                 if (copy_msqid_from_user(&msqid64, buf, version))
>                 ^
> 1 warning generated.
>
> This warning occurs because there is a space after the tab on this line.
> Remove it so that the indentation is consistent with the Linux kernel
> coding style and clang no longer warns.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/829
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>
> I assume this will be squashed into the offending patch since it is
> still in -next:
>
> https://git.kernel.org/next/linux-next/c/658622e448a6e6a6a69471daeff7e95e98d34ed1
>
>  ipc/msg.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ipc/msg.c b/ipc/msg.c
> index 22ed09ded601..caca67368cb5 100644
> --- a/ipc/msg.c
> +++ b/ipc/msg.c
> @@ -618,7 +618,8 @@ static long ksys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf, int ver
>         case IPC_SET:
>                 if (copy_msqid_from_user(&msqid64, buf, version))
>                         return -EFAULT;
> -                return msgctl_down(ns, msqid, cmd, &msqid64.msg_perm, msqid64.msg_qbytes);
> +               return msgctl_down(ns, msqid, cmd, &msqid64.msg_perm,
> +                                  msqid64.msg_qbytes);
>         case IPC_RMID:
>                 return msgctl_down(ns, msqid, cmd, NULL, 0);
>         default:
> --
> 2.24.1
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20191218032932.37479-1-natechancellor%40gmail.com.



-- 
Thanks,
~Nick Desaulniers

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

end of thread, other threads:[~2019-12-19 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18  3:29 [PATCH] ipc/msg.c: Adjust indentation in ksys_msgctl Nathan Chancellor
2019-12-19 20:28 ` Nick Desaulniers

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).