From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C141C43461 for ; Tue, 15 Sep 2020 22:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D19F20872 for ; Tue, 15 Sep 2020 22:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727694AbgIOWWT (ORCPT ); Tue, 15 Sep 2020 18:22:19 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:49644 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727688AbgIOQ0b (ORCPT ); Tue, 15 Sep 2020 12:26:31 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kIDQf-0006J3-1g; Tue, 15 Sep 2020 16:03:37 +0000 From: Colin King To: Hans de Goede , Christoph Hellwig , Al Viro , linux-fsdevel@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] vboxsf: fix comparison of signed char constant with unsigned char array elements Date: Tue, 15 Sep 2020 17:03:36 +0100 Message-Id: <20200915160336.36107-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The comparison of signed char constants with unsigned char array elements leads to checks that are always false. Fix this by declaring the VBSF_MOUNT_SIGNATURE_BYTE* macros as octal unsigned int constants rather than as signed char constants. (Argueably the U is not necessarily required, but add it to be really clear of intent). Addresses-Coverity: ("Operands don't affect result") Fixes: 0fd169576648 ("fs: Add VirtualBox guest shared folder (vboxsf) support") Signed-off-by: Colin Ian King --- fs/vboxsf/super.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c index 25aade344192..986efcb29cc2 100644 --- a/fs/vboxsf/super.c +++ b/fs/vboxsf/super.c @@ -21,10 +21,10 @@ #define VBOXSF_SUPER_MAGIC 0x786f4256 /* 'VBox' little endian */ -#define VBSF_MOUNT_SIGNATURE_BYTE_0 ('\000') -#define VBSF_MOUNT_SIGNATURE_BYTE_1 ('\377') -#define VBSF_MOUNT_SIGNATURE_BYTE_2 ('\376') -#define VBSF_MOUNT_SIGNATURE_BYTE_3 ('\375') +#define VBSF_MOUNT_SIGNATURE_BYTE_0 0000U +#define VBSF_MOUNT_SIGNATURE_BYTE_1 0377U +#define VBSF_MOUNT_SIGNATURE_BYTE_2 0376U +#define VBSF_MOUNT_SIGNATURE_BYTE_3 0375U static int follow_symlinks; module_param(follow_symlinks, int, 0444); -- 2.27.0