Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3674211ybi; Tue, 18 Jun 2019 04:52:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqysuxkglNAJH/VrOIVAYhFX6NcA08HmJjZo1k/0UnlA4+brgj6P1TBS8QjNZf4nhsTiAKU/ X-Received: by 2002:a17:902:8490:: with SMTP id c16mr33852659plo.1.1560858725937; Tue, 18 Jun 2019 04:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560858725; cv=none; d=google.com; s=arc-20160816; b=ieaoJlCLvIOtoBew2fgwfXpNpaJEeLQroZfe9VTk1qfwDFbDPaE9epMi3ZrKDQ1hR3 FHFi7fRgwMZtfndcegQc+1aRar4vWX7+nbEKDgaJ+GmgsYkHGWzl2MeWH9oKc9VVeceN 2ING5FkPGDP8dwxgFLvzbeXGPJRW4K5wt+5OwNP4zRjJBvuTh+73VkqVZwEjlvGEsz2X XQVOVL0GTBSeKGrFms6JyoMwVtewX5J1/AS5XfojfXLTKcIosDPaa2sFvxS07Rd8GV5J n4cHAXdA+lAd487wsyq1VNXbldS8uH/VImtt3PcaPBnjA/w50RVroC6msMYn1t2MUjYi DrDA== 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=hOk9gY1GdDIpq9WFwxD8Zh8kzeuAf1EMdWtPmOoiuzs=; b=dpItZmHXHstRXl6EmoWGyi/k8dWCRlu37+MAUkxCS1WAaVstN9QNGKVMDPN5m4ql41 H1L2652A/VZg6MJnewaOd+4cJd5Rh6CZ6hGfxv9V8TIYmyxRpQZ61cREGssQAGct0Glt tS7dG1alHrGGEQiB/KZc4Ht88W+fK5TaFiLR/PXR61+rwCveF5VBQkhUBw9U7/76DHMU rT++E3q51B/gXmySnMogfkqWf2+4w4nK1xpfIDbwwmwtJkIa2ZiDz2mIpCp1J2f/yFTi Jmome/Vc4zfJa7dCeiVfbBUj4DRGQj75AvFqVw+O/P1Gk/P58ClBvPCVH+qp0FknmRKA SyMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AqKDmnWs; 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 h11si17037pgq.170.2019.06.18.04.51.50; Tue, 18 Jun 2019 04:52:05 -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=AqKDmnWs; 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 S1729870AbfFRLvk (ORCPT + 99 others); Tue, 18 Jun 2019 07:51:40 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43797 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729712AbfFRLvj (ORCPT ); Tue, 18 Jun 2019 07:51:39 -0400 Received: by mail-pg1-f196.google.com with SMTP id f25so7554775pgv.10 for ; Tue, 18 Jun 2019 04:51:39 -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=hOk9gY1GdDIpq9WFwxD8Zh8kzeuAf1EMdWtPmOoiuzs=; b=AqKDmnWseRoJeA/3BNBy+a5FBQW8eiNJDcZX456wTgOVsvBSVCHPmSWSzyAqPWRcnA J3EMYFNhOSO7hI6qVXjTVW6N+OWkKYCZ/ULBswodowOiCTfgz53MwYqZLt53MlEEwcLa n9Rbfk34fPHEx8BW92+P7a74aqJ6Q1G0Rb7X4RxW/YBd20UuEMmtby24fuj5ZNN2lurZ 6lgR/Qo4D7469iHpS6H5A/RNHhH14xLvp7qsomG/KZp/q7PISrhgK/7KRiz/EI1fO6BC E9lLuceW7vfY1ZGb7dGZI2feReXQ5TZTeOyIzcSn8pk6c8pdcDSJUH26wZCVwCG4U8vK U2WA== 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=hOk9gY1GdDIpq9WFwxD8Zh8kzeuAf1EMdWtPmOoiuzs=; b=foeFYWaE/XxEW8Tla1dZ5/HpK+a32ATC9hrBFPRs9ghPLwNMO47yg/mb4csbFBUaBk 7jZ0koy9PawXphxC/uhmI/kCJBvVDCpOXLQXjtdtnjszR5mXsaZ/oTH9cFmf40sMl0IF OfnJSbW9JNxngTQKVqDLyH4iBHt3w00AUnL2NSkePKdflFmgmlC3AnZ7kHnIsNdCQPnA amkZDttJvxoDlvSVgxl8kGIPjEFjAg/nDRDX8eXnkVmPG1T7QyBh7DC/xpgcn7LRIVKi jdvgmsMrKYjUt5gBwyKHN9jXHz0YOpB+z3XnHv7KdUJUWf7JSlhAxz2xe1wVAoR6Mg3D mD9g== X-Gm-Message-State: APjAAAVnQD+D61HTD1Ncq6uO2ui0U2pDCNXpazXQ3Itej53wacGYOf47 3/6Pb7Si7Qf/DQb1sU4D1r8= X-Received: by 2002:a17:90a:ac0e:: with SMTP id o14mr4782406pjq.142.1560858698876; Tue, 18 Jun 2019 04:51:38 -0700 (PDT) Received: from localhost.localdomain ([2402:3a80:971:2367:ff63:bd87:123c:3583]) by smtp.googlemail.com with ESMTPSA id s9sm2070256pjp.7.2019.06.18.04.51.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 04:51:38 -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 Subject: [PATCH v2] fs: cramfs_fs.h: Fix shifting signed 32-bit value by 31 bits problem Date: Tue, 18 Jun 2019 17:19:47 +0530 Message-Id: <20190618114947.10563-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 --- V2 - use the unsigned constants for all flags, not just one 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