All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH -mm] -funsigned-char, namei: delete cast in lookup_one_common()
Date: Thu, 20 Oct 2022 12:56:20 +0300	[thread overview]
Message-ID: <Y1EbRNxRnZ/42G9x@localhost.localdomain> (raw)
In-Reply-To: <Y1EZuQcO8UoN91cX@localhost.localdomain>

Cast to unsigned int doesn't do anything because two comparisons are
a) for equality, and
b) both '/' and '\0' have non-negative values.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/namei.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2657,7 +2657,7 @@ static int lookup_one_common(struct user_namespace *mnt_userns,
 	}
 
 	while (len--) {
-		unsigned int c = *(const unsigned char *)name++;
+		char c = *name++;
 		if (c == '/' || c == '\0')
 			return -EACCES;
 	}

  reply	other threads:[~2022-10-20  9:56 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20  0:03 + kbuild-treat-char-as-always-unsigned.patch added to mm-nonmm-unstable branch Andrew Morton
2022-10-20  9:43 ` Alexey Dobriyan
2022-10-20  9:49 ` [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array Alexey Dobriyan
2022-10-20  9:56   ` Alexey Dobriyan [this message]
2022-10-20 16:28   ` Jason A. Donenfeld
2022-10-20 17:14     ` Linus Torvalds
2022-10-20 17:33       ` Jason A. Donenfeld
2022-10-20 17:42         ` Linus Torvalds
2022-10-20 18:57           ` Kees Cook
2022-10-20 19:39             ` Linus Torvalds
2022-10-20 20:17               ` Linus Torvalds
2022-10-20 21:34                 ` Andy Shevchenko
2022-10-20 22:46                   ` Jason A. Donenfeld
2022-10-21  6:48                 ` Greg KH
2022-10-21  7:24                   ` Jason A. Donenfeld
2022-10-21  7:36                     ` Greg KH
2022-10-26  1:50             ` Jason A. Donenfeld
2022-10-26 12:58               ` Jason A. Donenfeld
2022-10-26 12:58                 ` [cocci] " Jason A. Donenfeld
2022-10-26 13:17                 ` Andy Shevchenko
2022-10-26 13:17                   ` [cocci] " Andy Shevchenko
2022-11-02 17:17                 ` Julia Lawall
2022-11-03  0:08                   ` Jason A. Donenfeld
2022-11-03  6:31                     ` Julia Lawall
2022-11-03 12:45                     ` Julia Lawall
2022-11-03 12:47                       ` Jason A. Donenfeld
2022-11-03 12:57                         ` Julia Lawall
2022-11-03 14:07                           ` Jason A. Donenfeld
2022-10-24 15:44         ` Jason A. Donenfeld
2022-10-21  5:59       ` Alexey Dobriyan
2022-10-21 17:11         ` Linus Torvalds
2022-10-21 17:23           ` Linus Torvalds
2022-10-20 16:24 ` + kbuild-treat-char-as-always-unsigned.patch added to mm-nonmm-unstable branch Jason A. Donenfeld
2022-10-20 21:12   ` Andrew Morton
2022-10-20 21:13     ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1EbRNxRnZ/42G9x@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.