Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp196214imj; Thu, 7 Feb 2019 02:54:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IYmFg2iOQPjHgA9C4AmiV55+KEfCnBPaTW0h3wGNkfbgDXN2rAljLdsc8mi2oCsGsg9Om3/ X-Received: by 2002:a63:2905:: with SMTP id p5mr14341292pgp.178.1549536867785; Thu, 07 Feb 2019 02:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549536867; cv=none; d=google.com; s=arc-20160816; b=HMLiwEeO1iW30nK84WqMca0Zkf5/xhvgVGbLT3XHOhvmjMnPkrCQuNZGdZ4aSctOII 7vbZjyrhHzidjLZeVuhI1HS4FKkfUqeW3p4zYS2HERAnhmiEiNcwfcLbBXZfWcp24dj0 VYKMWD1X0CdhjsNHZDb4bv21OfZ3R6x6XcTzShrAxt19A9pKVYqa4d+cLA6IpfX/Y5aX jxF/JVGoDQwjpjuLIatLKcjujvRMGqli348mFvvkoKo5WibhCeWfjAxjRQ0/4DAAADyK jibKs8F36dK8d7XVkhGRPSuPCsBdzFIZPTVzXnm3ZaVN0BOTZaMRwxJiwK+HPcxgDj1s 8cEg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=a5ekLkSNrwhtq4l99n6n85PfY+bg1U6Vfc1uNkjjZio=; b=LaMdrpTYwsAzvAh5TeyjSVQ1cgUEANuaTx5TtcROrmol3ulHF3nIHPSXHOx8gUiLgC KhFZasBRczyazr5OqnBYKLcaHOm2/dkbMD4zx1nUVhnpciefsETh/qE+wMp/G+hOpDok aLtf8Jm5lsKLadQyWxjuSsY9Rk1SefgdMfyLzmKdEHjC8JrT90D0U+84loHyvg/kwlaW GotZQ09y0nzvmaxl/foV/2e1j+Dl5a+BETHpd/cr+y30U9mmQCp6/PJVPUjzWmjcRIgm Tw9QFhC6mZK9Y0M4JNugSFBFYNQt9rpuaDG/herrZ8sy3JDhbv+C1nwwsdR1td5U/zWJ wGlA== ARC-Authentication-Results: i=1; mx.google.com; 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 h189si1999146pfc.211.2019.02.07.02.54.11; Thu, 07 Feb 2019 02:54:27 -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; 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 S1726909AbfBGKxL (ORCPT + 99 others); Thu, 7 Feb 2019 05:53:11 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:37968 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726186AbfBGKxL (ORCPT ); Thu, 7 Feb 2019 05:53:11 -0500 Received: from [192.168.108.68] (unknown [213.36.7.13]) (Authenticated sender: marc.w.gonzalez) by smtp3-g21.free.fr (Postfix) with ESMTPSA id 5A20813F85A; Thu, 7 Feb 2019 11:52:58 +0100 (CET) Subject: Re: [PATCH v4] scsi/ata: Use unsigned int for cmd's type in ioctls in scsi_host_template To: Nathan Chancellor Cc: Jens Axboe , "Martin K. Petersen" , SCSI , LKML References: <20190114044206.6351-1-natechancellor@gmail.com> <20190126075256.29608-1-natechancellor@gmail.com> From: Marc Gonzalez Message-ID: <97d4ab84-f64b-9276-b7a9-3b3be5f5d527@free.fr> Date: Thu, 7 Feb 2019 11:52:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190126075256.29608-1-natechancellor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/01/2019 08:52, 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 find into type 'int', which is used for the cmd paremeter in ^^^^ ^^^^^^^^^ "which don't fit" "the cmd parameter" Regards. > 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 to take a negative > value, 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 > Reviewed-by: Bart Van Assche > --- > > v3 -> v4: > > * Repost with Bart's suggested change and his reviewed by (mainly as an > excuse to repost with the below comment). > > v2 -> v3: > > * Fix another -Wswitch warning from drivers/scsi/cxlflash/main.c, coming > from decode_hioctl (uncovered via a powernv_defconfig build). > > v1 -> v2: > > * Fix build breakage in cxlflash driver from forgetting to update > prototype (thanks to 0day for catching it). > > I apologize for resending this so soon after v3 but it has been three > months since I sent this patch and I have yet to receive a single > comment from ANY of the maintainers that './scripts/get_maintainer.pl' > spits out for this patch so it feels like I am sending it into the void. > > I understand you all are busy people and such and maybe I am being > impatient but these warnings are rather spammy and we're trying to get > that category cleaned up as quick as possible so that new warnings are > easier to spot. I'd appreciate any and all reviews/acks/testing that I > can get on this patch (especially since it is so simple) so it can be > accepted and merged into mainline.