Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1552105ybd; Wed, 26 Jun 2019 20:26:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwODgJe7ESy5/m+mbRSm07uSf0aIcfe6xAomKW0K2W9LaDzgOY+MveLVwuuSfuHmBZ2i5z/ X-Received: by 2002:a17:90a:36a9:: with SMTP id t38mr3180463pjb.19.1561605967181; Wed, 26 Jun 2019 20:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561605967; cv=none; d=google.com; s=arc-20160816; b=dhFsCPtToRhilVeHhrMzAKBLiPknfbU5tiVBNzop68ASc78Tfo+RO+Fx5061iRyg03 MP+GXA9bdYFjA9WP5833qKnln6qY4p/mgjvGNSeqyjEWw1lJpvKGksraXlPxtgdNPYgR Xnki8hXTXmckb3cx2lGYSoAo6l5VRHGJNwOfXKoWnvYYNttI9T8YTRriRqJYXsAYuQrK q2zzdeR/6TBW3756pHjyrbVFk+9IUQJGgfmqfTBEL/ffbuhFYXRX4VW3RFWafAZrYhVz V7mG4nL07+JjGoLwl4GO/UJB6QY5e+7i6gvRy7gcDG/I/E7g/vVoq8XYMd7hRukuqIWN YOOg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DspknQs36A/5uQZX53aWrrdTwDH7n/43l0dEQF/NX0g=; b=YbYi7T2yq0m3xpwOlHg/qhpAvIXxreksoJd1ccPi6zTqBX/oplwAsrw+1vEILVLtqk r5Z3XVL4X2XNM19Nqhe0l+sIjpEfebn0TLYzcXbAAlQXHaRqjd/07UAyo2B3tcMyc0Fs NA80SL5uUY2tSqTbFummP1M5tCiabQ9oO5uoQEUu/TviI5mqKDeuhPrVSZtT/2uA36lS nB7sMCzJisaSnpbEViJe+S9Ne3R/r/ieGTwMoNkS/CziWpoaSHxWT47XV849GsQCELR/ T09no1bzg6pPHRi7gTQrt1dFW1D1fHb8gk8jVlr7De9DlDJwAfGU6oPwNaMzKriVdcG/ pPNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FnmR6S3U; 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 d7si851536pgb.354.2019.06.26.20.25.50; Wed, 26 Jun 2019 20:26:07 -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=FnmR6S3U; 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 S1726839AbfF0DZh (ORCPT + 99 others); Wed, 26 Jun 2019 23:25:37 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:45750 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbfF0DZg (ORCPT ); Wed, 26 Jun 2019 23:25:36 -0400 Received: by mail-oi1-f194.google.com with SMTP id m206so461604oib.12 for ; Wed, 26 Jun 2019 20:25:36 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=DspknQs36A/5uQZX53aWrrdTwDH7n/43l0dEQF/NX0g=; b=FnmR6S3UdvxSAXrt4YakXY+vA/wkVhU4l9+b1MXMa7h47IiKVdslEShfoIOjhVAu+A CHE+plwYBAfdLkY7mCGM2sBx+LHdtyh3KQNMcT1egYV6b3/82KUnTlGJIm9IcfZlGrvE aYCkPHKdxlFQGh5+5WTbawbIFIJHDRsskbAp6a3oQn1XcLXFfDDAdcZXF3kIA9xExHUD uW4jwOgqNAC5JiKaqpKFNetlim8XkuaYVoStRsdp9W9uFkc76yRwEJ+5UrYEF9VB67jy YpT8T+29gg6/tS9FTzjwY9s/5T8VjnjN6HxxkfONF+7Hvs5DNjJdgS0MRRlk0Z3uH1Qc IG9A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DspknQs36A/5uQZX53aWrrdTwDH7n/43l0dEQF/NX0g=; b=WsdDKHCt2z5C2fSRhie82IkTn0AbF08ribERrCe/y8moIL7qtMKNbBU+jN83tyD6Oa kQoL9CGJSZbn0wkY8VCY2GcIlO5RjMuoVkpnDR4TdKVE1rqd6oHyYQgp82/4wxfDvY/Y OxGtdkcA9ZbJJGQ/uuAeSoL+WOMssqPs4RAm+g/XMcTld3OHjhRrIOR1yd2j7ZuHFH2v djIq1p9z0BXuMPXDrpaM7bH9qnWgDQCO+xvHPZjreYX3iBhyrofPozrEcL0jgtcpX0+h hKuuFW/1jDvo0V2EWTjFDZNJHDof8YXh1cdkdetBI5ugvxKGRDkIcZyZX7enveutaePu Hnqw== X-Gm-Message-State: APjAAAU10mAz/Oc8WHS+MQC/wWrJ0ywmkRRE5m3lCnD25v1MiQAEe4wd +qGxrNwnTTw5x8E1Dt7UGDY= X-Received: by 2002:a54:4f95:: with SMTP id g21mr303543oiy.23.1561605935712; Wed, 26 Jun 2019 20:25:35 -0700 (PDT) Received: from rYz3n.attlocal.net ([2600:1700:210:3790::48]) by smtp.googlemail.com with ESMTPSA id y184sm417647oie.33.2019.06.26.20.25.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 20:25:35 -0700 (PDT) From: Jiunn Chang To: skhan@linuxfoundation.org Cc: linux-kernel-mentees@lists.linuxfoundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, oded.gabbay@gmail.com Subject: [Linux-kernel-mentees][PATCH v2] drm/amdkfd: Fix undefined behavior in bit shift Date: Wed, 26 Jun 2019 22:25:31 -0500 Message-Id: <20190627032532.18374-3-c0d1n61at3@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190627010137.5612-3-c0d1n61at3@gmail.com> References: <20190627010137.5612-3-c0d1n61at3@gmail.com> 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 Shifting signed 32-bit value by 31 bits is undefined. Changing most significant bit to unsigned. Changes included in v2: - use subsystem specific subject lines - CC required mailing lists Signed-off-by: Jiunn Chang --- include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index dc067ed0b72d..ae5669272303 100644 --- a/include/uapi/linux/kfd_ioctl.h +++ b/include/uapi/linux/kfd_ioctl.h @@ -339,7 +339,7 @@ struct kfd_ioctl_acquire_vm_args { #define KFD_IOC_ALLOC_MEM_FLAGS_USERPTR (1 << 2) #define KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL (1 << 3) /* Allocation flags: attributes/access options */ -#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1 << 31) +#define KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE (1U << 31) #define KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE (1 << 30) #define KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC (1 << 29) #define KFD_IOC_ALLOC_MEM_FLAGS_NO_SUBSTITUTE (1 << 28) -- 2.22.0