Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp609025rwi; Thu, 20 Oct 2022 03:02:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uyzfVblmhRYze4BiaYuOXtOWIHTje4/A52MoTQLe97PFCkUrDd/a19WJVh9XRB5kD7U47 X-Received: by 2002:a05:6402:1d4e:b0:45d:27e4:f93a with SMTP id dz14-20020a0564021d4e00b0045d27e4f93amr11318751edb.287.1666260151009; Thu, 20 Oct 2022 03:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666260151; cv=none; d=google.com; s=arc-20160816; b=S5EqnTLqPhe5ksEKUG73NrngPx7sOY5PgAnZrG1P7hJtvqvEPovhd6YhL8Nm0xPAXB Los/GO1ab4eDn0Efy4qcIsfBq1A/qAu6d3Bb4qQePNfy6BdMkxZE/OyBmabp1KXn8LeF 79Xgk/njbRqS/4Puuua7MOZrI/MLh8gOn7CZfwcwipPWjwHqSoPXqMFcYK/kcnR9PAN9 ozQBF/hl69g0Ap64deNRHOcB1Lsp25krtLhIZXyhYMQWi0nMcoRxHPKrD0Ji/jHtA1gR WFxjV/vw+DRDIpmk6fpNZZ4ag5uaN3PYOEpTGtD75sU3VEvg46eoQpcgW67tKR/EWTUe jWcA== 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 Return-Path: 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.02.00; Thu, 20 Oct 2022 03:02:30 -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 + 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 ); 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 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: References: <20221020000356.177CDC433C1@smtp.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; }