Skip to content

Commit 140a4b6

Browse files
DarkFire01HBelusca
andauthored
[CODEREVIEW]
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
1 parent 5cc21da commit 140a4b6

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

drivers/network/ndis/ndis/hardware.c

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,22 @@ NdisQueryPciBusInterface(
2525
IO_STATUS_BLOCK IoStatusBlock;
2626
PIO_STACK_LOCATION IrpStack;
2727

28-
if (Adapter->BusInterfaceQueried) {
29-
return (Adapter->BusInterface.GetBusData != NULL) ? STATUS_SUCCESS : STATUS_NOT_SUPPORTED;
30-
}
28+
if (Adapter->BusInterfaceQueried)
29+
return (Adapter->BusInterface.GetBusData != NULL) ? STATUS_SUCCESS : STATUS_NOT_SUPPORTED;
3130

3231
Adapter->BusInterfaceQueried = TRUE;
3332

3433
KeInitializeEvent(&Event, NotificationEvent, FALSE);
3534

36-
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
37-
Adapter->NdisMiniportBlock.NextDeviceObject,
38-
NULL,
39-
0,
40-
NULL,
41-
&Event,
42-
&IoStatusBlock);
43-
if (Irp == NULL) {
44-
return STATUS_INSUFFICIENT_RESOURCES;
45-
}
35+
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
36+
Adapter->NdisMiniportBlock.NextDeviceObject,
37+
NULL,
38+
0,
39+
NULL,
40+
&Event,
41+
&IoStatusBlock);
42+
if (Irp == NULL)
43+
return STATUS_INSUFFICIENT_RESOURCES;
4644

4745
IrpStack = IoGetNextIrpStackLocation(Irp);
4846
IrpStack->MajorFunction = IRP_MJ_PNP;
@@ -56,15 +54,14 @@ NdisQueryPciBusInterface(
5654
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
5755

5856
Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp);
59-
if (Status == STATUS_PENDING) {
60-
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
61-
Status = IoStatusBlock.Status;
57+
if (Status == STATUS_PENDING)
58+
{
59+
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
60+
Status = IoStatusBlock.Status;
6261
}
6362

6463
if (!NT_SUCCESS(Status))
65-
{
66-
RtlZeroMemory(&Adapter->BusInterface, sizeof(Adapter->BusInterface));
67-
}
64+
RtlZeroMemory(&Adapter->BusInterface, sizeof(Adapter->BusInterface));
6865

6966
return Status;
7067
}
@@ -242,7 +239,8 @@ NdisReadPciSlotInformation(
242239
PLOGICAL_ADAPTER Adapter = NdisAdapterHandle;
243240

244241
/* Slot number is ignored since W2K for all NDIS drivers. */
245-
if (Adapter->BusInterface.GetBusData != NULL) {
242+
if (Adapter->BusInterface.GetBusData != NULL)
243+
{
246244
ULONG Result;
247245
Result = Adapter->BusInterface.GetBusData(Adapter->BusInterface.Context,
248246
PCI_WHICHSPACE_CONFIG,
@@ -274,7 +272,8 @@ NdisWritePciSlotInformation(
274272
PLOGICAL_ADAPTER Adapter = NdisAdapterHandle;
275273

276274
/* Slot number is ignored since W2K for all NDIS drivers. */
277-
if (Adapter->BusInterface.SetBusData != NULL) {
275+
if (Adapter->BusInterface.SetBusData != NULL)
276+
{
278277
ULONG Result;
279278
Result = Adapter->BusInterface.SetBusData(Adapter->BusInterface.Context,
280279
PCI_WHICHSPACE_CONFIG,

0 commit comments

Comments
 (0)