2020-08-14 13:23:00

by Wei Liu

[permalink] [raw]
Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code

On Fri, Aug 14, 2020 at 08:38:53AM -0400, Sasha Levin wrote:
[...]
> +
> +#include "dxgkrnl.h"
> +
> +int dxgadapter_init(struct dxgadapter *adapter, struct hv_device *hdev)
> +{
> + int ret = 0;
> + char s[80];
> +
> + UNUSED(s);

If s is not used, why not just remove it?

Indeed it is not used anywhere in this function. That saves you 80 bytes
on stack.

> +static int dxgk_destroy_hwcontext(struct dxgprocess *process,
> + void *__user inargs)
> +{
> + /* This is obsolete entry point */
> + return ENOTTY;
> +}
> +

Other places have been using negative numbers for errors. I guess you
want -ENOTTY here too.

Wei.


2020-08-26 20:21:30

by Iouri Tarassov

[permalink] [raw]
Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code


On 8/14/2020 6:18 AM, Wei Liu wrote:
> On Fri, Aug 14, 2020 at 08:38:53AM -0400, Sasha Levin wrote:
> [...]
>> +
>> +#include "dxgkrnl.h"
>> +
>> +int dxgadapter_init(struct dxgadapter *adapter, struct hv_device *hdev)
>> +{
>> + int ret = 0;
>> + char s[80];
>> +
>> + UNUSED(s);
> If s is not used, why not just remove it?
>
> Indeed it is not used anywhere in this function. That saves you 80 bytes
> on stack.
>
>> +static int dxgk_destroy_hwcontext(struct dxgprocess *process,
>> + void *__user inargs)
>> +{
>> + /* This is obsolete entry point */
>> + return ENOTTY;
>> +}
>> +
> Other places have been using negative numbers for errors. I guess you
> want -ENOTTY here too.
>
> Wei.
>
>

2020-08-27 00:14:02

by Iouri Tarassov

[permalink] [raw]
Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code

Hello

On 8/14/2020 6:18 AM, Wei Liu wrote:
> On Fri, Aug 14, 2020 at 08:38:53AM -0400, Sasha Levin wrote:
> [...]
> > +
> > +#include "dxgkrnl.h"
> > +
> > +int dxgadapter_init(struct dxgadapter *adapter, struct hv_device *hdev)
> > +{
> > + int ret = 0;
> > + char s[80];
> > +
> > + UNUSED(s);
>
> If s is not used, why not just remove it?
>
> Indeed it is not used anywhere in this function. That saves you 80 bytes
> on stack.
>
> > +static int dxgk_destroy_hwcontext(struct dxgprocess *process,
> > + void *__user inargs)
> > +{
> > + /* This is obsolete entry point */
> > + return ENOTTY;
> > +}
> > +
>
> Other places have been using negative numbers for errors. I guess you
> want -ENOTTY here too.
>
> Wei.
>
>

2020-08-27 19:11:15

by Iouri Tarassov

[permalink] [raw]
Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code

Thank you,Wei. These issues will be fixed in the next patchset.

Iouri

On 8/14/2020 6:18 AM, Wei Liu wrote:
> On Fri, Aug 14, 2020 at 08:38:53AM -0400, Sasha Levin wrote:
> [...]
> > +
> > +#include "dxgkrnl.h"
> > +
> > +int dxgadapter_init(struct dxgadapter *adapter, struct hv_device *hdev)
> > +{
> > + int ret = 0;
> > + char s[80];
> > +
> > + UNUSED(s);
>
> If s is not used, why not just remove it?
>
> Indeed it is not used anywhere in this function. That saves you 80 bytes
> on stack.
>
> > +static int dxgk_destroy_hwcontext(struct dxgprocess *process,
> > + void *__user inargs)
> > +{
> > + /* This is obsolete entry point */
> > + return ENOTTY;
> > +}
> > +
>
> Other places have been using negative numbers for errors. I guess you
> want -ENOTTY here too.
>
> Wei.
>
>