Message ID | 20230227112541.14849-1-k.yankevich@omp.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2361119wrd; Mon, 27 Feb 2023 03:32:12 -0800 (PST) X-Google-Smtp-Source: AK7set9u0gmkXBad65a7wsyKbgCDapTk5iK8mPDrR5/P2qFyOoETTCa8IhMv8xIhrDmFNTljO2MJ X-Received: by 2002:a05:6a20:7f8b:b0:c7:5e7a:d536 with SMTP id d11-20020a056a207f8b00b000c75e7ad536mr8313688pzj.17.1677497531716; Mon, 27 Feb 2023 03:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677497531; cv=none; d=google.com; s=arc-20160816; b=cKFTtC8Pj8u/Z8Kn7W5Ib6O6Wv7KQqmLFnnAqwChiN5H3iXGSFeX2j7w0+WCh8E8lR 5SEKw/URytE63zKrPMpEdNUK8+O5eCIgpNNSgiUc2s7Vic3PjIvQFfT5EsKUMsBHHU9y Z01TeyafMd3WZhNxSZIYBieemYTqVKV00CY7WerCRRUc6CmbA66ovCh3vzhlSf85/pVE TVaZ7bLNZyX5z0QHTW+FzXT1T7qBrKkdzFIA4HZX/DSquXlnE/7Xi7KJdzvOh1Nvx8xU YOmwh67+cAMP/SlvhliQDohiVDPxsRThIhNmHS2x0Pp0CRzoL2dImaJqUW9PEQP+dXpR xvSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=npkZ4S3tJPwIKiPTNAyIgxhzCuBQVfEItFbQipX+ld4=; b=aEtpxaZejMvE2PP9wdx8svE8Kn/vtOqJndyt9PKExfSCgsg3x/JmwTI7GUG1Q+hdmx fdSM+syIv6aN9ir6ueURZ6XoQXIw4++3a5HawdPQX5dcE0i97fKA9xj5O/xnYIBgbicg pD2hidBP6rWvhcTshNSeNuMwoG/Y49/d5kmSrA5QKTugDpIsnLOIXrLoWFTF6fhbIAnr e8EhTXdAzQQ6J7iGyXYlP+Qe4ZqA9gERHYWKvb7U1Uum6mAAATBzpbm/4dB5s4ZxK0FF KB1hT+9Tv++Yq1eFAqDAcgI8bjK7Lp46lIhGxnLSak2EjW6eL7D+dq5eCQlntz4ZLqde UY8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a056a001acf00b005a8b073a61bsi7318325pfv.78.2023.02.27.03.31.57; Mon, 27 Feb 2023 03:32:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjB0L1A (ORCPT <rfc822;wenzhi022@gmail.com> + 99 others); Mon, 27 Feb 2023 06:27:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjB0L06 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Feb 2023 06:26:58 -0500 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F6A1E5C5; Mon, 27 Feb 2023 03:26:56 -0800 (PST) Received: from uxi.kar (171.25.167.209) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.14; Mon, 27 Feb 2023 14:26:46 +0300 From: Karina Yankevich <k.yankevich@omp.ru> To: Alan Stern <stern@rowland.harvard.edu> CC: Karina Yankevich <k.yankevich@omp.ru>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>, <usb-storage@lists.one-eyed-alien.net>, <linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org> Subject: [PATCH v2] usb: storage: sddr55: clean up variable type Date: Mon, 27 Feb 2023 14:25:41 +0300 Message-ID: <20230227112541.14849-1-k.yankevich@omp.ru> X-Mailer: git-send-email 2.39.1 In-Reply-To: <53bc0584-51eb-8bb7-de48-ca07fccafc19@gmail.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [171.25.167.209] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.59, Database issued on: 02/27/2023 11:01:50 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 175726 [Feb 27 2023] X-KSE-AntiSpam-Info: Version: 5.9.59.0 X-KSE-AntiSpam-Info: Envelope from: k.yankevich@omp.ru X-KSE-AntiSpam-Info: LuaCore: 504 504 dc137e1f9c062eb6c0671e7d509ab442ae395562 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: 127.0.0.199:7.1.2;omp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 171.25.167.209 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 02/27/2023 11:05:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 2/27/2023 8:42:00 AM X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758983651739894419?= X-GMAIL-MSGID: =?utf-8?q?1758983651739894419?= |
Series |
[v2] usb: storage: sddr55: clean up variable type
|
|
Commit Message
Karina Yankevich
Feb. 27, 2023, 11:25 a.m. UTC
SVACE static analyzer complains that we're possibly
losing information by shifting an 'unsigned int pba'
variables in sddr55_{read,write}_data().
It is a false positive, because of the card's total capacity
is no larger than 128 MB. But 'unsigned int' is more
suitable in this case.
Found by OMP on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Karina Yankevich <k.yankevich@omp.ru>
---
drivers/usb/storage/sddr55.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, Feb 27, 2023 at 02:25:41PM +0300, Karina Yankevich wrote: > SVACE static analyzer complains that we're possibly > losing information by shifting an 'unsigned int pba' > variables in sddr55_{read,write}_data(). > It is a false positive, because of the card's total capacity > is no larger than 128 MB. But 'unsigned int' is more > suitable in this case. Please wrap at 72 columns. > Found by OMP on behalf of Linux Verification Center > (linuxtesting.org) with SVACE. What is "OMP"? What is "SVACE"? And why change anything if there is not a real issue? > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") That's obviously not the correct commit id for such a "fix" as this is not a real issue. thanks, greg k-h
Hello! Sorry for the really long delay! Your reply scared off Karina (it was her 1st kernel patch), so I'm trying to pick this patch up where it was left back in February... On 2/27/23 2:54 PM, Greg Kroah-Hartman wrote: [...] >> SVACE static analyzer complains that we're possibly >> losing information by shifting an 'unsigned int pba' >> variables in sddr55_{read,write}_data(). >> It is a false positive, because of the card's total capacity >> is no larger than 128 MB. But 'unsigned int' is more >> suitable in this case. > > Please wrap at 72 columns. > >> Found by OMP on behalf of Linux Verification Center >> (linuxtesting.org) with SVACE. > > What is "OMP"? Open Mobile Platform, LLC. The website is in Russian only: https://www.omp.ru > What is "SVACE"? The patch description said thst it's a static analyzer. Here's the link to the Institute for System Programming web page about it: https://www.ispras.ru/en/technologies/svace/ > And why change anything if there is not a real issue? We needlessly use 64-bit type on 64-bit arches. >> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > > That's obviously not the correct commit id for such a "fix" as this is > not a real issue. That's correct. We'll remove this tag. > thanks, > > greg k-h MBR, Srrgey
On Fri, Dec 01, 2023 at 07:16:56PM +0300, Sergei Shtylyov wrote: > Hello! > > Sorry for the really long delay! Your reply scared off Karina > (it was her 1st kernel patch), so I'm trying to pick this patch up > where it was left back in February... Note, any submitter should be able to answer questions about their change, as remember, if I take it I am now responsible for it. If they do not want to respond that means they do not want to be responsible for it, which of course means we can't accept it :( thanks, greg k-h
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index 15dc25801cdc..0aa079405d23 100644 --- a/drivers/usb/storage/sddr55.c +++ b/drivers/usb/storage/sddr55.c @@ -196,7 +196,7 @@ static int sddr55_read_data(struct us_data *us, unsigned char *buffer; unsigned int pba; - unsigned long address; + unsigned int address; unsigned short pages; unsigned int len, offset; @@ -316,7 +316,7 @@ static int sddr55_write_data(struct us_data *us, unsigned int pba; unsigned int new_pba; - unsigned long address; + unsigned int address; unsigned short pages; int i;