[dpdk-dev] [PATCH 1/1] virt2phys: virtual to physical address translator for Windows
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Fri Apr 10 04:59:09 CEST 2020
> >
> > > + PHYSICAL_ADDRESS *phys;
> > > + size_t size;
> > > + NTSTATUS status;
> > > +
> [snip]
> > > +
> > > + status = WdfRequestRetrieveOutputBuffer(
> > > + request, sizeof(*phys), &phys, &size);
> >
> > Better to put a (PVOID *)typecast for &phys here:
> > status = WdfRequestRetrieveOutputBuffer(
> > request, sizeof(*phys), (PVOID *)&phys, &size);
>
> What do you mean? Without a typecast the built-in static analyzer emits a
> warning (and all warnings are treated as errors for a driver):
>
> virt2phys.c(108,46): error C2220: the following warning is treated as an error
> virt2phys.c(108,46): warning C4047: 'function': 'PVOID *' differs in levels of indirection from 'PVOID **'
> virt2phys.c(108,46): warning C4022: 'WdfRequestRetrieveInputBuffer': pointer mismatch for actual parameter 3
>
Never mind, I thought you were referring to the existing typecast in
WdfRequestRetrieveInputBuffer(). Thanks for the suggestion, will add in v2.
--
Dmitry Kozlyuk
More information about the dev
mailing list