Message ID | Y1EbRNxRnZ/42G9x@localhost.localdomain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp9232wrr; Thu, 20 Oct 2022 03:01:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/XjftK47QmqkOvAfm5tPQ+gtIRGDglOt91+G0y9RdUrbNSBDP0zAEyriEkC0WIWCohOMh X-Received: by 2002:a17:907:7f8f:b0:791:a840:56b4 with SMTP id qk15-20020a1709077f8f00b00791a84056b4mr5782314ejc.540.1666260076677; Thu, 20 Oct 2022 03:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666260076; cv=none; d=google.com; s=arc-20160816; b=uqKTtlFM5APV4yR9TiEF8z9pYFMVGkp7tVYvgZZEwMotZXoiheI+169RD8HKi+9KHZ jGz9o2l2/mrPadFVszfp/Set7k30jD34rb0ewyZCAqjf+F/GLftcfpSpqtHDnvAc7we8 LnfypPTZ0KHKVx7ZuAmnd40SebB7Z3u1tVmNM3n9DKQPZYBsZaHxnuUCX/m3yZnDDTKk FWA+meDYn9PYd0/4nACluTP4bhLl7K+5ubfP6eZCQS+Ez7rMonkasPVYID5p9C3IMj3K HOIYhWbCgKwJsGd0RoxgQAMfzbHfOkCRiDf5jSayOJHtSJxBuihjAWea0n1sJisQsQio 5UKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V799u1OvsFy3rfEiYBMkwUXRRFdL63Meg4qL1Gy+Szw=; b=L1DAW4tkrVQ8MEFiWHSfDVU+KcuOirFCVttIwMa0yEeDGUj8UXBaJ6Gq/ch3FPHk/P cQ4DYRCgkEwdPOayfGSXfhcoiAcaJPEdyuK91H/GsFhjyFCmZYw2sT5PtHzLksZlscP1 B7a73QvAPtcrT8LB0DEvfVxOQBSFlfKCVzuW3RGM1q+BxXT2YOumB5M6bcNcByzUo7zw /m3267kxF6wbA91kjFLmumTBwfHjDVFH/oHOVPK9x15UktYfbka+004WdKcvdI+H4F0T gNPFnupk8hqMJ9A9N/jtj+SQzWieZNyHT/4A3SOpnU8QfAVQyxL1YOjw8rzQvoGMRVKv qrsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gcD3x1hz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn20-20020a17090794d400b007123952b00dsi16779508ejc.100.2022.10.20.03.00.46; Thu, 20 Oct 2022 03:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gcD3x1hz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbiJTJ4b (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Thu, 20 Oct 2022 05:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbiJTJ4Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Oct 2022 05:56:25 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E43AF48; Thu, 20 Oct 2022 02:56:24 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id az22-20020a05600c601600b003c6b72797fdso1777069wmb.5; Thu, 20 Oct 2022 02:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=V799u1OvsFy3rfEiYBMkwUXRRFdL63Meg4qL1Gy+Szw=; b=gcD3x1hzQYTUcUyKQ5yQINSy9VGeO+QxvYJbP3bVZrsseQ4Hq0wWRQ6iCaZEYzJOfJ oCN95yvunqzlcdaa7BTDHGyBXqN3Cg8i/uDYjpGUAwqCto9X9yxyWUHZLwDJdG5FmZ83 c9BQr08Z1gep5B1Sb9wS+M3/r/xE8/UrO8gobkPFp9VygNnoPshRT9s5n8SZ4qM0P3qU JCT2tFzS3kAFFbOaxWH7Yp3HNRG+JvgCL8HBALQFKwvn9tA2OxXGU1757fHqDkwNARTw P2JaqRWBHPGazzm1wGkLnO7xPMUd/NVRKAC9d+ahvvwXrpCwPqhLGQyVSdM/yStmyDiS cI5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V799u1OvsFy3rfEiYBMkwUXRRFdL63Meg4qL1Gy+Szw=; b=2mow69DIeNl2EcRx4Ie3LQeY7YR8Rr4BKh66mvoY5vFw0Qm6wbbI2y83I7xhZ6zU5I 9bYphNJhN69xfQRpvnNZJtacCL5x4xmnyrRnjuertpE3GLVm+JISTpoMUILlls6KidBo 95XkxX5agZ4MHtH4dzsmujf+Ip9aDExntgCurZXRT+h5PxPVlG4e9dOYkLcbQ1+NfLRZ qYVzwcnkdWTdc5t+xuWjF5CKghAL/XpL0wv8vVKATe6FVslL9jXbxhB6qAeeNxgN900r +37RMmb813Ayb6LmyyCx08pmzSnIprJJuhKM47JCwnKManatP+c+zosg6VJ4Jjnqv8qb ynRw== X-Gm-Message-State: ACrzQf3G5FRZoW8Sh1LSdSBZWIxi8FO9SNIISyPoe/7/EpnfDHCMR8tO 6k8TbpmfC6i+JGsE4pCLAOKKZ45q0g== X-Received: by 2002:a7b:c398:0:b0:3c7:87f:3b48 with SMTP id s24-20020a7bc398000000b003c7087f3b48mr4134400wmj.65.1666259782655; Thu, 20 Oct 2022 02:56:22 -0700 (PDT) Received: from localhost.localdomain ([46.53.254.126]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c154800b003a3442f1229sm2703510wmg.29.2022.10.20.02.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:56:22 -0700 (PDT) Date: Thu, 20 Oct 2022 12:56:20 +0300 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() Message-ID: <Y1EbRNxRnZ/42G9x@localhost.localdomain> References: <20221020000356.177CDC433C1@smtp.kernel.org> <Y1EZuQcO8UoN91cX@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <Y1EZuQcO8UoN91cX@localhost.localdomain> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747200326456979209?= X-GMAIL-MSGID: =?utf-8?q?1747200326456979209?= |
Series |
[-mm] -funsigned-char, namei: delete cast in lookup_one_common()
|
|
Commit Message
Alexey Dobriyan
Oct. 20, 2022, 9:56 a.m. UTC
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; }