Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1828079imj; Fri, 8 Feb 2019 08:01:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYgWkV5AzdKdgQIw5uADSOATwsvqJNYWKLTaE1QtbanSzBsY6yN6xNfy+dWBlx7nk6F1HEa X-Received: by 2002:a63:920a:: with SMTP id o10mr20550213pgd.141.1549641700016; Fri, 08 Feb 2019 08:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549641700; cv=none; d=google.com; s=arc-20160816; b=f4KtwFUQZDg4pmJy/2HUtaBw9pfwhYedd5YffjqOa4zFl0EQCtZ38w/WLrzjSfYj4H o8o8VB7olSiVAx/RFKfKBy7W2zEKIDNJaRw+Vc9gOcZDJy1MQcLKxWKkhj+9jeCTuPJV iJa6Yi/hwvpHYW6hKaNCOsCxkROs76p1/PtKB83miTZf22O3KYvDCiCQtLLwlichxRTg /8kUoaeFOInIqNUUOdhIfBeAczRUQ9mOaX1Ng1mHT1MSgUKCZnM6k633XjCrDUL42PaD 43NTo0pWAG27o3aCmLnS1VzBtoPYLUUwr4jpH8LWZQgg7zWujLC7+zI6Aug/R52GHHvj Ys0w== 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=kGjk9Uusr20Af6UI6iePXn6HwsWauY7BPE5RDjaNmrI=; b=SpAtf7n6nFqnhw5suFx7fhviEmA0GfcWu1keFbOpWE0ucPDkMa9VpL+rMHMo0UZ8P8 FYCKQlnBtM17xtTD+0hjkZWKVQ8rnMBRtvJnrMvpTuY56irEPmWNVo0cTU/5zz1NMfDN vfNiNA+R5Rjm4iIzqYzELSAh7zT4p+XVfME9t9+PMiZWeDyb54LjiNDrH7Az2jRH+K52 GrTguVdVQTCm09qOtUzNhpGuKuSAxi78OxmZeLoyBs7wfd2TKe4teYI85e/jT3p5wsiA +4JHWqEDgRhUuDoferm1gx2PWQQ6WzbMTAbN5tU7D8J5cJhjBBDjdrOlBC5n2Xdy5q5V Fs4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=beEMonpI; 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 e6si2461926pgp.504.2019.02.08.08.01.22; Fri, 08 Feb 2019 08:01:39 -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=pass header.i=@gmail.com header.s=20161025 header.b=beEMonpI; 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 S1727235AbfBHQAw (ORCPT + 99 others); Fri, 8 Feb 2019 11:00:52 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:43722 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726939AbfBHQAt (ORCPT ); Fri, 8 Feb 2019 11:00:49 -0500 Received: by mail-ed1-f65.google.com with SMTP id f9so3159027eds.10; Fri, 08 Feb 2019 08:00:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kGjk9Uusr20Af6UI6iePXn6HwsWauY7BPE5RDjaNmrI=; b=beEMonpINWdA1LJAYQWU/Gk3hMSIGOl6llYdzFB+oOJPuMGIkHT9PZETUovzJTz91j gd2lkKUIKF9XC0bBy/0ZQsd941wBFO66aMiAyZq2pYuLXp4RtoIN5K1optwN/3t4gvQt TOCsinmsTEdMOqjuvtYDFPv8oALvlO6LfMjLqVnU41zawXmtSjQQRM75AuR2E834C/fD dbRFAHjV6qQwnk7sGtR6kex89el/rHsSIO5U+6n9sV1y0l2jpM8mUYUj1WrlhxjWSVMj gszGlVlaJO1XTWGlBJNZcuRkJkk0Faq67jD+Z/MX3gSRmWcLd15TYEpVSqGPVcjCeJRl mhvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kGjk9Uusr20Af6UI6iePXn6HwsWauY7BPE5RDjaNmrI=; b=H68aXH9g/Httom0Mg4ZwL9xZDeNp7ZkSWyfZkB82F8huAqaOaWuHleAT6E+PmKpdyV jLZYOW93EO5Clb9I9IrDB5I0RfXnYd+kh5TaXLuHj+tuG8rTf7Wr6urIG+iZQ8MYkrLQ efLPHZ21U1xnRF7JKKrcmpvQATRMB+9B9qVbm7qgR/0SZiVP6KWnREIgF5vn7FvFixtm QZpuCkhwDXjWmCVbxSljMb7N/4Exgt+8gFOrafVkX8MemYU0QiLncVlk1lOqB9/g0L1p /BQXqP5+k3Vtj8SOj+5YvEKJC3mXYaEmXU6fG2lvfEduxYq/lSBlU/3NevVZ/npEjzT5 ndAg== X-Gm-Message-State: AHQUAuYuPEPtPpbPrLyo7z8kxngX3/nIlMmrDPU+rCxAJrQqQ1eGnvnN SmMUHDYVshuUvYntymtiy9c= X-Received: by 2002:a17:906:1687:: with SMTP id s7mr10753271ejd.137.1549641647060; Fri, 08 Feb 2019 08:00:47 -0800 (PST) Received: from archlinux-ryzen ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id i19sm556804ejv.46.2019.02.08.08.00.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 08 Feb 2019 08:00:46 -0800 (PST) Date: Fri, 8 Feb 2019 09:00:44 -0700 From: Nathan Chancellor To: Christoph Hellwig 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: <20190208160044.GB26005@archlinux-ryzen> References: <20190126075256.29608-1-natechancellor@gmail.com> <20190207160719.28895-1-natechancellor@gmail.com> <20190208080501.GA18530@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208080501.GA18530@infradead.org> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 08, 2019 at 12:05:01AM -0800, Christoph Hellwig wrote: > 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 Thank you for the review, it is much appreciated! Nathan