From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f66.google.com (mail-oa1-f66.google.com [209.85.160.66]) by mx.groups.io with SMTP id smtpd.web10.12048.1686314015300828041 for ; Fri, 09 Jun 2023 05:33:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@ventanamicro.com header.s=google header.b=W+1EdQkv; spf=pass (domain: ventanamicro.com, ip: 209.85.160.66, mailfrom: rsingh@ventanamicro.com) Received: by mail-oa1-f66.google.com with SMTP id 586e51a60fabf-1a196784a4cso507985fac.1 for ; Fri, 09 Jun 2023 05:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1686314014; x=1688906014; 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=eQpzF02tWKH+r5IgYFnF7FV/cNUR63ZpvVzgc9+t2dw=; b=W+1EdQkvFTho3XL9UDdbyYeBLbhYHl9DEwekdzrkvn6IWKWt5BAc6NpdEpQ7roUHYA hb5SA/slTIbAZF+DMKqLGx9h9k+5nDFxt4rOeMvyDrAaR3cC2J+Dm4kYapcHfjg1RCMU VK4rjkiPnq+oWeXAuhKX504QaE+06bq4dqtY2M5Jo4JgAzipW5pBFtXOi+qQ1ceyr9Hw 0rDxAY7f9tr5YqlDhwG5aRcKm+oCIY9WIt4xZnj+yQQ/tU92cWUkZ+OeV1aPSBdEDHNz qnyZJcHwMiaIYn2DKzg+vuYbkgUPX+XxwOX6Jo/oWuQ3BP9Ztfv/LZpsg12RL1BTchR1 gnVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686314014; x=1688906014; 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=eQpzF02tWKH+r5IgYFnF7FV/cNUR63ZpvVzgc9+t2dw=; b=NfqGkMQDBfzBbwDrasI57/QOsL7hUMxHetiqk+wX3+JL130kCFGNXhgrXAm0OhYWI0 YRJXUIyK0ZSDYWzZBJd4LoiloT1uGnfgFPBUzv4SFnNKtEZZ2riFsHqdYR+uRJIw9cBM za+lJQNdH82BVFWKNXU4xbY3P6LrQmhyA4B411FNdCdzMRK66u/1EUVQKq2SKTHx+9Mk EXK9vKTY1N3aw1anCUJFTIwj7ckqYlGxJ66Fbmm52FsvPkeojwvyrN7lruTroc7FOdzj M8qozYkzkRG12P1Os3c8BPikv2ZPJlr30eSEwNlLCUupmANqWUQvX03+slTdvStxOfTc UOlw== X-Gm-Message-State: AC+VfDyksweTqBEkewxOHx9+IdE7iCgBONg8YqmjZrPFgDlAruBgHvXO Vk+2Wh41gEJwDx6cgMHw60myKkIv0eoNBo52W46hi4K8 X-Google-Smtp-Source: ACHHUZ7h7KiAgIt70/DLAlRzseazFEKHPNagWgUi0q4f9Jz/BHshmBHyICwk/LlzKrROH1EU48LQBg== X-Received: by 2002:a05:6870:1986:b0:199:d0fa:edec with SMTP id v6-20020a056870198600b00199d0faedecmr750360oam.4.1686314014268; Fri, 09 Jun 2023 05:33:34 -0700 (PDT) Return-Path: Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:5b04:3850:5513:420:9d99]) by smtp.gmail.com with ESMTPSA id w1-20020a056870430100b00187e500e7b3sm2033013oah.49.2023.06.09.05.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 05:33:33 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [PATCH v2 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue Date: Fri, 9 Jun 2023 18:03:22 +0530 Message-Id: <20230609123322.191390-3-rsingh@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230609123322.191390-1-rsingh@ventanamicro.com> References: <20230609123322.191390-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ranbir Singh The return value stored in Status after call to SetDriveParameters is not made of any use thereafter and hence it remains as UNUSED. Add error check as is done after calls to SetDeviceTransferMode. Cc: Hao A Wu Cc: Ray Ni REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- Notes: Add error check instead of Status storage removal MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg= /Bus/Ata/AtaAtapiPassThru/IdeMode.c index 75403886e44a..d04b1d95a7f5 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -2549,13 +2549,18 @@ DetectAndConfigIdeDevice ( //=0D if (DeviceType =3D=3D EfiIdeHarddisk) {=0D //=0D - // Init driver parameters=0D + // Init drive parameters=0D //=0D DriveParameters.Sector =3D (UINT8)((ATA5_IDENTIFY_DATA *)(&B= uffer.AtaData))->sectors_per_track;=0D DriveParameters.Heads =3D (UINT8)(((ATA5_IDENTIFY_DATA *)(&= Buffer.AtaData))->heads - 1);=0D DriveParameters.MultipleSector =3D (UINT8)((ATA5_IDENTIFY_DATA *)(&B= uffer.AtaData))->multi_sector_cmd_max_sct_cnt;=0D =0D Status =3D SetDriveParameters (Instance, IdeChannel, IdeDevice, &Dri= veParameters, NULL);=0D +=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "Set Drive Parameters Fail, Status =3D %r\n",= Status));=0D + continue;=0D + }=0D }=0D =0D //=0D --=20 2.34.1