Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1382928imj; Fri, 8 Feb 2019 00:07:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IbmK/LQwT5rr9H/H8fi5CqTdzxb1IWDtEAwxfYByBHdsYRiwZ9lMQHSFcfXG7sXcxy2//Jf X-Received: by 2002:a65:6150:: with SMTP id o16mr16979129pgv.434.1549613225071; Fri, 08 Feb 2019 00:07:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549613225; cv=none; d=google.com; s=arc-20160816; b=voRSKvCKpZlJz/ITtRnriEqSOJoweaKAIqb2MqybHhTO9KN6rYor7+AN9Np+3CWhUT sqmMWe3QF12pnNRiKULwnerickl+nDF48Lej+r0v80mha1P4amnu6ESFCZNh35DW7iu2 N/PYAybhMM6nHvYD6GRUukEcqS8nUqHQ6SBRVP9+NQbYAkuQKAa8UOrsRG6qFri7tytS VqTssp1pLuUHEUIikEN76lgmubXyDEj0deA7McsputZ/psGoyQ6qDQ6mJ+PVWgLyc4zD 0mq9qOypy8KPuHwMT6qxEFH+cMLmswYFML4z9waVplx5l+4YAU+epXbYloL9Cu+zpFgT IJ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=X1F76fWoZNI6hEwrCsNg4vhyIqrimKHVVutkEcsBSuk=; b=Xvop0PSMTEES/y1Q8eIYkMSBgKRA0nRaVT0KSbowr1FNSdTFL9L6ck8GmrLd6H24k0 AK1luf/HKmMdBXON08iwuQYeA/u+xDG3BuaI3rPXhhjbq0Cao6SmoOIBFaIVEWLNAOTj WME/WaFd2WL8AXy/N0fcF+piQEoNNxhUfgXW+xESo8Gq3efsW0QCiVzJjzbmeu9rj//Y KIusPlfaJGL00kj2m9SUR5oucfOQ7C1Qeth/MEZzKmu4+MD8vgaLWi7KyYme5qzOt73M wzF9CQX97B+yM8zvlqLhh0eDMkhX7JJy92xXb6/KjFi6DdApIRPpOcgbb8HT+kN7SAMh v3NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Rad8Vb6w; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s78si1571381pfk.37.2019.02.08.00.06.49; Fri, 08 Feb 2019 00:07:05 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Rad8Vb6w; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727259AbfBHIFL (ORCPT + 99 others); Fri, 8 Feb 2019 03:05:11 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:36624 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbfBHIFL (ORCPT ); Fri, 8 Feb 2019 03:05:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X1F76fWoZNI6hEwrCsNg4vhyIqrimKHVVutkEcsBSuk=; b=Rad8Vb6wlSAhoSYZwFrZgbJiy gQoxababoRVcz7XVxD0ZPGL4F06bJQb6/2npG8eHvQXIAqGxgZnHo0vDxcw+ZdgFqWvlCNKed6wiM GsLO5TYCbGaYzMcP6/etyhLlEAKj7/Gzc+9+t+wPMzdwaqNMkNZiZZGPrMFqg4dgSuMRqq9j2qp2g V+Z+5yv0tbhMR6/OVP2OIGDQaMDV+8j3Udt6lwxdtEyJJ+5VSY8QVdVjnA/WWrodLh3+4bF9YTN45 ZoK2tgiJ1jkFgzFx/+MfY77VmEBP9Rqc2pWdfZYCcxLeets6wzmG0vGCec3pNTdazpF1EmRklg/Iu kmVdGzObw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs19h-00052r-6y; Fri, 08 Feb 2019 08:05:01 +0000 Date: Fri, 8 Feb 2019 00:05:01 -0800 From: Christoph Hellwig To: Nathan Chancellor Cc: Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , "Manoj N. Kumar" , "Matthew R. Ochs" , Uma Krishnan , Brian King , Adaptec OEM Raid Solutions , Marc Gonzalez , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, esc.storagedev@microsemi.com, Bradley Grove , Don Brace , Bart Van Assche , Nick Desaulniers Subject: Re: [PATCH v5] scsi/ata: Use unsigned int for cmd's type in ioctls in scsi_host_template Message-ID: <20190208080501.GA18530@infradead.org> References: <20190126075256.29608-1-natechancellor@gmail.com> <20190207160719.28895-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190207160719.28895-1-natechancellor@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 07, 2019 at 09:07:20AM -0700, Nathan Chancellor wrote: > Clang warns several times in the scsi subsystem (trimmed for brevity): > > drivers/scsi/hpsa.c:6209:7: warning: overflow converting case value to > switch condition type (2147762695 to 18446744071562347015) [-Wswitch] > case CCISS_GETBUSTYPES: > ^ > drivers/scsi/hpsa.c:6208:7: warning: overflow converting case value to > switch condition type (2147762694 to 18446744071562347014) [-Wswitch] > case CCISS_GETHEARTBEAT: > ^ > > The root cause is that the _IOC macro can generate really large numbers, > which don't fit into type 'int', which is used for the cmd parameter in > the ioctls in scsi_host_template. My research into how GCC and Clang are > handling this at a low level didn't prove fruitful. However, looking at > the rest of the kernel tree, all ioctls use an 'unsigned int' for the > cmd parameter, which will fit all of the _IOC values in the scsi/ata > subsystems. > > Make that change because none of the ioctls expect a negative value for > any command, it brings the ioctls inline with the reset of the kernel, > and it removes ambiguity, which is never good when dealing with compilers. > > Link: https://github.com/ClangBuiltLinux/linux/issues/85 > Link: https://github.com/ClangBuiltLinux/linux/issues/154 > Link: https://github.com/ClangBuiltLinux/linux/issues/157 > Signed-off-by: Nathan Chancellor > Acked-by: Bradley Grove > Acked-by: Don Brace > Reviewed-by: Bart Van Assche > Tested-by: Nick Desaulniers Looks good: Reviewed-by: Christoph Hellwig