Re: [PATCH ethtool 3/7] ioctl: get rid of signed/unsigned comparison warnings
From: Michal Kubecek <hidden>
Date: 2020-08-11 21:21:02
From: Michal Kubecek <hidden>
Date: 2020-08-11 21:21:02
On Mon, Aug 10, 2020 at 04:19:24PM +0200, Andrew Lunn wrote:
quoted
- while (arg_num < ctx->argc) { + while (arg_num < (unsigned int)ctx->argc) {Did you try changing ctx->argc to an unsigned int? I guess there would be less casts that way, and it is a more logical type for this. Andrew
I tried now and the number of changes in ethtool.c is not as bad as I thought. I even found one missing check which could allow argc to fall below 0. Michal