Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3979322ybi; Tue, 18 Jun 2019 09:35:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGEFsyTx6dKq6iiQUGlenhY+Q+OY6h0Sk3Gq9bBSaEW/5CaEgSmhU+hoIDfa/eiIUTd9bU X-Received: by 2002:a17:902:7087:: with SMTP id z7mr2956999plk.184.1560875709472; Tue, 18 Jun 2019 09:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560875709; cv=none; d=google.com; s=arc-20160816; b=jw3xxTYHuG+HwUwOIdI+AVdyaKPfgIqBxslElGreA91QioIlFsYugA0e9EWBn52XaC wEDaM+vmFSxrDKNLIVeBInkbCr97UzZNMcxCJUPYqdnuz/awq5iiza//vpsg45aFnAI+ M0Q8ALdI9TG+01s/8FI66ad7ZEJ1/qeIiC9w+P79rpxdJehIRuO7nJdFlA5xzTojMEUq /QPBprCurgYRIaj8GMeU3Ojaq7+72eoTMWbdFrpRQwXlLWWiDbpZugjn/ewvnNus49gp 9WX4ge58Sq/bJ0di+5Lo7XQpZxPnspxF3fTca2hntSoqS71iEOi84+kB4vjhi+ej7Sm8 KQWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rxDQL9GgjzWaRaA2EXv46RSRTEziDfpy9C7Cc/aMUTo=; b=XklauCqAtG5ahqzqGu7m4NshpmqTBRjWn3E/rFQFZdjoqIlMbLIw50VgThBIjnaRym B0AIVlVQXxeIsuNorSBPcFe95oa7ZVmnL5f4H/hcwnRocW8QPten6rMJaInGVB10pWtO ofJ99mHTCmFd2NW0gnJZvTEBfplKbdNA6fn0V0/QljoFKrGJXoi1aRiwy2LnJxbxwdhQ fUdbqOE6kxhqRcdcaIPCJWehbg+J2OqWgyo9A+N0+8vtUg6tCCLMG/zjL8MOZIdzqN0y uhmIqoZ17V4AFB0FBC1lDY9sy7ukflVMPs6n1d4jq1kBEiz5SAmdCZY0LGWXxkTK/y2Z 8CVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IuK5zbEt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si556943pgp.88.2019.06.18.09.34.54; Tue, 18 Jun 2019 09:35:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IuK5zbEt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729514AbfFRQe1 (ORCPT + 99 others); Tue, 18 Jun 2019 12:34:27 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43011 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729319AbfFRQe0 (ORCPT ); Tue, 18 Jun 2019 12:34:26 -0400 Received: by mail-pf1-f195.google.com with SMTP id i189so7959164pfg.10 for ; Tue, 18 Jun 2019 09:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rxDQL9GgjzWaRaA2EXv46RSRTEziDfpy9C7Cc/aMUTo=; b=IuK5zbEtumCGEVO+M95zgIPLSoHM80jvjDIHH3aB8i5itoV5++AeLukMeJUQJevVRX JvpcQjrMIxuqQnzZq6W5DE75LD6KRKjJ+cwdpOuHF8h8E6YpGUil//KPhnO5E3cKuNA5 SP5lVgPfv8dYAbxOxcPAna+aQCi5MrZBERoEi42AZQEgSRAWW/DXrcKGYUTj3MO7ms+k ypUcd8HgV1MleTbvnSep+BKKheFuVCEeFiO/cG0zUHKA4p2Rx+M/YjIhaTpgvpDAA/QX 510Mnfy+uRLtrwE+wj551G5O9AgNefwGw87zZPE5cz4TQ0fig1vRx1nQZnzRYIjjzFW9 tGxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rxDQL9GgjzWaRaA2EXv46RSRTEziDfpy9C7Cc/aMUTo=; b=sBvqU7DXET0TNPOoKDgo4CZKdWqk0hdwCBEWjrGAM6hJl6anECSINMV+21JOqNj+9G DDq80x4JqXuchngesoAgiwe0JRECVl/miSkyB0sL/MYOo5C8XJwgh2H0RzX5j4jbhbg4 DBN7a3e4cUkWoxbScZkV3q4/mokzxl/Ouk7qRS9vcLbDO5XZHwE/9E94g8LG/GPm0IPK BfVMmPs2K7XTxWKaoVh8KgcEqiuiHs30jhHOtRDvrcbsPE+po5CcPVYtn6OUfx8Vdqgb BK6m0BxSCq6jaEkwuyIs6P6hlELMa05OuKcXZch7DqtMaL0mn8efRGVQdMx9GFrbmGhY LxBg== X-Gm-Message-State: APjAAAUWD9VQ70EM8fJJ0vpqC60xAfinFp9aZSOe7+U8n8LqT9zM/uu7 8yA/wXlLFBdhgCzNOfE616Y= X-Received: by 2002:aa7:8b17:: with SMTP id f23mr86080378pfd.194.1560875665996; Tue, 18 Jun 2019 09:34:25 -0700 (PDT) Received: from localhost.localdomain ([112.196.181.128]) by smtp.googlemail.com with ESMTPSA id z22sm12103041pgu.28.2019.06.18.09.34.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 09:34:25 -0700 (PDT) From: Puranjay Mohan To: Shuah Khan Cc: Puranjay Mohan , linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, hch@infradead.org, Nicolas Pitre , Christoph Hellwig , Greg Kroah-Hartman Subject: [PATCH v2 RESEND] fs: cramfs_fs.h: Fix shifting signed 32-bit value by 31 bits problem Date: Tue, 18 Jun 2019 22:03:52 +0530 Message-Id: <20190618163352.4177-1-puranjay12@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix CRAMFS_BLK_FLAG_UNCOMPRESSED to use "U" cast to avoid shifting signed 32-bit value by 31 bits problem. This isn't a problem for kernel builds with gcc. This could be problem since this header is part of public API which could be included for builds using compilers that don't handle this condition safely resulting in undefined behavior. Signed-off-by: Puranjay Mohan Reviewed-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Shuah Khan --- V2 - use the unsigned constants for all flags, not just one RESEND - Added Nicolas Pitre to CC list, added reviewed by tags. include/uapi/linux/cramfs_fs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/cramfs_fs.h b/include/uapi/linux/cramfs_fs.h index 6713669aa2ed..71cb602d4198 100644 --- a/include/uapi/linux/cramfs_fs.h +++ b/include/uapi/linux/cramfs_fs.h @@ -98,8 +98,8 @@ struct cramfs_super { * * That leaves room for 3 flag bits in the block pointer table. */ -#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1 << 31) -#define CRAMFS_BLK_FLAG_DIRECT_PTR (1 << 30) +#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1U << 31) +#define CRAMFS_BLK_FLAG_DIRECT_PTR (1U << 30) #define CRAMFS_BLK_FLAGS ( CRAMFS_BLK_FLAG_UNCOMPRESSED \ | CRAMFS_BLK_FLAG_DIRECT_PTR ) -- 2.21.0