Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84B8DC7619A for ; Wed, 5 Apr 2023 23:50:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A29586006; Thu, 6 Apr 2023 01:49:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="SditY7Pr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC87685FD1; Thu, 6 Apr 2023 01:49:18 +0200 (CEST) Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A34E485FE2 for ; Thu, 6 Apr 2023 01:49:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yb1-xb2b.google.com with SMTP id i6so44565660ybu.8 for ; Wed, 05 Apr 2023 16:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1680738550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nfoqkwvXqTzq9lk8wZf+zFTwp0lrOEJv9Uo/2mlpHXk=; b=SditY7PrLQGa4t1MmzKdDvbXdcZxh5c/BJ1EOyGYpG+CvmZGYQm79So0IGYcn/2Jvu bdDsr3HKR509JPanbTdh5IAvc4Pie25OfgwLyoH5/PVAQmWIf/+QfdYcjgMDsNgmfdRJ huNwq1Ev+JuTeM8h1U/EqCxxygPQNogEhzJzc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680738550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nfoqkwvXqTzq9lk8wZf+zFTwp0lrOEJv9Uo/2mlpHXk=; b=VQ5AHnj4GuWmgW3X+MLAjT+7i4faTG+TbVTl5PBGp1sRcu9y0kW0h9hpT5xH7oCG0T RcO4xVd+nQnEupzw75at1bgMyleVvBSGGeXXmDCdZkD8Z4XoL3aWJN81U1+XuZPNLnd8 iiv5i2ZpLSSLaF5/aczmzpLHPMIaOEHhUMP3VJnv6ZFU+/avzP3FPUkbGelH2pUvol7X NxZGN8gnzoNGbCmk1AmlyiGt7xSYo8RM0YyEScpfibISwvfeZSZWIO7IAGHhEUgfWgjP NVPf8iuOc5xrYYVTCBoK9nzqOPIpUUNJFniNBv8nIDxooEdJwGtPacEXyhFXuYkKwJL0 hSPA== X-Gm-Message-State: AAQBX9dyX3tYyfgEvJUZ8HoQxxJlTHEKgLv6T1+ZK2tEk9k68yWiR+e9 3CpiAbHHSGknWFxh4pBp6H/+zLsaUz6seGsGN5rHrw== X-Google-Smtp-Source: AKy350YFbhYh6IBY/sLBDmnqCgBQj5g9uu2E9gEmFd8XQBC5XnwijI7ycJ4s5jD9SnJFns6sMVxclw== X-Received: by 2002:a25:8c5:0:b0:b30:f0da:dbd4 with SMTP id 188-20020a2508c5000000b00b30f0dadbd4mr682365ybi.30.1680738549966; Wed, 05 Apr 2023 16:49:09 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-acff-1005-f218-7c24.res6.spectrum.com. [2603:6081:7b00:6400:acff:1005:f218:7c24]) by smtp.gmail.com with ESMTPSA id l33-20020a81ad61000000b00545a08184b1sm4215448ywk.65.2023.04.05.16.49.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 16:49:09 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Lukasz Majewski , Marek Vasut Subject: [PATCH 7/9] usb: gadget: f_mass_storage: Rework do_request_sense slightly Date: Wed, 5 Apr 2023 19:48:57 -0400 Message-Id: <20230405234859.1446811-8-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230405234859.1446811-1-trini@konsulko.com> References: <20230405234859.1446811-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When building with clang, it notes that sdinfo may be unused uninitialized in some cases. This appears to be true from reading the code, and we can simply set the variable to zero to start with and be as correct as before. Signed-off-by: Tom Rini --- I'm honestly not sure why gcc isn't complaining here as this seems to be a real issue. Cc: Lukasz Majewski Cc: Marek Vasut --- drivers/usb/gadget/f_mass_storage.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 45f0504b6e8a..f46829eb7adb 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -1117,7 +1117,7 @@ static int do_request_sense(struct fsg_common *common, struct fsg_buffhd *bh) { struct fsg_lun *curlun = &common->luns[common->lun]; u8 *buf = (u8 *) bh->buf; - u32 sd, sdinfo; + u32 sd, sdinfo = 0; int valid; /* @@ -1145,7 +1145,6 @@ static int do_request_sense(struct fsg_common *common, struct fsg_buffhd *bh) if (!curlun) { /* Unsupported LUNs are okay */ common->bad_lun_okay = 1; sd = SS_LOGICAL_UNIT_NOT_SUPPORTED; - sdinfo = 0; valid = 0; } else { sd = curlun->sense_data; -- 2.34.1