[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH v2 3/3] xen: fix violations of MISRA C:2012 Rule 3.1
- To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 19 Jun 2023 12:29:11 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BOxnPM11Kr+uQ/ZTLcD8VI2cjsEOcTsTfR98ZlNN/60=; b=hp7/7a3U+poRk/3YoSXch+R5dLMZgTCLx4SdlroyYTjXhFMCYLPDdcGooiO0wCkizO9WGp5MzoQ5yOIP7Y3YT1b4X06OwLB8ZIwFkw8PYs5iwyDWPUZO4cxfDpDk71TEzPcn7K7Sh5KF/nQ5O5xpVJLNza2Q2pg2pMPAN3sRduGvcmR5PHfQimY93pjiLNnvx0hYCCWWdzaOMBdI/VgzS83GsYutylrYFLPkcYUryIfu3PpWWWmO7vFs7H11Kllj1HpPRd85dkv8qk1uGm+cXDgTrlEjjS9FLu/EQJoSmfT5fMpyEYE/OULZNhkQoRhCJhl0ZFKjT9cH7y7uJiDkVA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y6LSNOMJqI3tEMaue9Udd9oOwMGncZWUnFyHQon8R5AZVv9vwwF9Ar4H8Rm/sZ/TYyimsBnPFNgjy74IzKza2GLdTFi/5fNf5kFLiaOYbVkwq06mZCAlZxEe7y7cwpqchs3QaSsMzRPq04T/PF/jHibfqCGwxKMoo+YA0C95gjoSFWHzc4gphANlAh4jMsbCwjIvxDWqCa5PhWFjEXp3JLvkwheHRkw1FsYRY6AIltwjZw0Z6bHD8+2nRnRnBXcYEvbOYzuW5IfQx/XcH5BxmUUfbL7xuV1bBbp/OvET/ekY0AAQvgr1cxH7/81sT4JdODckrv93cMc4Ga5c9fVLfg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 19 Jun 2023 10:29:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 19.06.2023 11:56, Nicola Vetrini wrote:
> --- a/xen/common/xmalloc_tlsf.c
> +++ b/xen/common/xmalloc_tlsf.c
> @@ -140,9 +140,6 @@ static inline void MAPPING_SEARCH(unsigned long *r, int
> *fl, int *sl)
> *fl = flsl(*r) - 1;
> *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
> *fl -= FLI_OFFSET;
> - /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
> - *fl = *sl = 0;
> - */
> *r &= ~t;
> }
> }
As indicated before, I don't think simply dropping the commented out code
is appropriate here. Personally I'd prefer if it was kept (using #if/#else),
but I'd also be okay with replacing it by a respective assertion. That said,
if other maintainers think this is the way to go, then I don't mean to
stand in the way.
Jan
|