From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) by mx.groups.io with SMTP id smtpd.web10.4853.1683584921061505048 for ; Mon, 08 May 2023 15:28:41 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=lXyT2RWC; spf=pass (domain: gmail.com, ip: 209.85.219.181, mailfrom: mike.maslenkin@gmail.com) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-b9a7e639656so7938763276.0 for ; Mon, 08 May 2023 15:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683584920; x=1686176920; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=D5BSKdriYHUg3AKuo7253z3aATwrwrDwYAJx2nL7ny4=; b=lXyT2RWCM8fcTlFjhCKWeM2Gc48UV5CZ5YbLuOwfhln5iSPWXDVV5B+nt9O6u5Ciew kORlCj7fi5v0R14g1bJM2ETt6+YRzuRo3jGXkVMhQVvaPWcGdSaXDcLoO1tUsfPN1NTs zemw7XsFoHcu3Lwnqq9FbLGwci24jntrbRpcUyYJgcwlczKaLzJqxTJNviPYI91EI5vq evgW2/2LTgRSC8ufecrI15vL+K678yCjotuNkJG5BAHOKf9zLOENZ1FoLK8zQG0DFxJ6 8kWQXpdxr8rbSLN+rN3FvpKdn1OOxYhW7yyyer/E6porhznbzwmnHsZAjjzqCHBAm5w7 K2Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683584920; x=1686176920; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D5BSKdriYHUg3AKuo7253z3aATwrwrDwYAJx2nL7ny4=; b=hGTcWHlP46OeQEJ37lbGsvy9f4pvTG9pHOyYYJ+ZYxFjzArmmrU9wzhShAi3/M/wiN p1/2rvkkc+9vasYXFsTpLUxND7DO2+686RSrtt5k2WyACwCA74yN/uFqT1Kd1yqb6Loe mzzou5RWK+1p59O3wWrLbctT+ul/Vu+L9bSZr0lrQ+QejSyvYsivK4VQ/ZUsAObyY2lh L9jeW8tURwK8sQ/xIphdUh2wlQGQboqn9VXVKYN1VYTPZvmNh6Lt0mPyPsadpf1ulwg+ IcchmGQIdrY8rf9pAOsgmKnqUdxFu9acGjQmVXNJ3iSeL/TqHBjcoKm6cLFFYm16fQPz Zv4g== X-Gm-Message-State: AC+VfDym4Ln41HPRWji7djk7ambvnNm8L5J4kRmWfYU83RZKOzDdwxg0 MumobUskTaVP/ZUAy1br1y3kdmLLCelzIVwaI4La3SaykZOpOw== X-Google-Smtp-Source: ACHHUZ7kBOD5LowjL1UgvzAQNthHGdkP5vcu1bZLH30dJcNhFb96bKxiRllt91+P/x6qJgvxMgaPp0LV569LXyXxLCY= X-Received: by 2002:a25:bd0:0:b0:b99:4af6:185d with SMTP id 199-20020a250bd0000000b00b994af6185dmr13635802ybl.6.1683584920118; Mon, 08 May 2023 15:28:40 -0700 (PDT) MIME-Version: 1.0 References: <20230508215246.217002-1-pedro.falcato@gmail.com> <20230508215246.217002-2-pedro.falcato@gmail.com> In-Reply-To: <20230508215246.217002-2-pedro.falcato@gmail.com> From: "Mike Maslenkin" Date: Tue, 9 May 2023 01:28:04 +0300 Message-ID: Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/SataControllerDxe: Remove useless null check To: devel@edk2.groups.io, pedro.falcato@gmail.com Content-Type: text/plain; charset="UTF-8" Hello Pedro, Technically speaking ASSERT (Private != NULL) doesn't cover this branch. It should crash before as result of UninstallMultipleProtocolInterfaces() call. Obviously it make no sense in release target (under normal condition when assertion is turned off), while this code does. But I would suggest to remove ASSERT (Private != NULL) as well since it is useless also. It needs to be very lucky to get NULL as result of BASE_CR(), but actually SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS() and CR() definition care about this. There will be assert if signature doesn't match to dereferenced memory area before Private != NULL check. In fact, this patch just reduces indentation level by removing useless checks.