[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 05/18] arm: cppcheck: fix misra rule 20.7 on arm/include/asm/string.h


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 20 Dec 2022 10:38:56 +0100
  • 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=54sLO94CEgeqfB5DE1j/NEXE7jCLxSHQUAP2HF88qYM=; b=iO++/KhXKtt8f8f8aNSpmlAwA4QE3W+dINCHokqMwmwy6bMGeKcdjen4pPXLBUkX4Mr/C9afsH+2KzbjadsgNhMINrr7foxSEeF9Z9ljpHoKrvjc/adzHEV9KEa75zrkuQ5EslsY8MjFeEvtR3xn4zWBMw+VdtqFE47FWCOjSq4cKb0Q8hoZTQNjj4K+jhuf23UjUEB2cJAtjp7BHcsEQkaJru8adnLsmZMGSx1ygIADudg3ZUno1gZEGv01qcTyuHoLekS8vSSb7L0OJknvI8MGeU0JRm9NfOuog1rW5sGmeFhweXjnNJ1Pfj7kkZFPmMt02hVy8V0zKwhW7/NuiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jiTRgSGAyCoG5vk2OfEBbdehqm89SbZU+eRLGkOrl3hGT6k6yqrKS3htCCTebAg50acJvlZZJQIK/ml2DMyh4WJP7eyx5Bul1z515KmQ9tropBa64L0Fr+UkW5gHx9PONxh6JizZnQUj8OAyFEffGUsOvl3Va+H6gM/LxQindAHNlK09rcTmymyyRPjeHWuryrsJvtg+cEvLTBV1e6eu8zX8eIacZEuMQA0oPb1+2isYOeXo6d0LjOpHtEikU9/3FTJxYdDo0fK2e6wyMNh/gsf8NdGhB6PGr4h7ykmnRR++Az6MNb1QcCX6pYHaN9WOnrqMQf8DNwft/pE7PWG/SA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: wei.chen@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 20 Dec 2022 09:39:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.12.2022 10:12, Julien Grall wrote:
> On 20/12/2022 08:50, Luca Fancellu wrote:
>> Cppcheck has found a violation of rule 20.7 for the macro memset
>> about missing parenthesis for the "n" argument, while the parenthesis
>> are not mandatory because the argument is never used in an
>> expression, adding them will not harm code and readability, so fix
>> the finding adding parenthesis for the argument.
> 
> This is something I have argued against in the past (see [1]). So...
> 
>>
>> Eclair and coverity does not report this finding.
> 
> ... if neither Eclair nor Coverity report it then I think this should be 
> a bug report against Cppcheck.

Furthermore in reply to my "Arm32: tidy the memset() macro" you said [1]

"In this case, Linux has removed __memzero() is patch ff5fdafc9e97 "ARM: 
 8745/1: get rid of __memzero()" because the performance difference with 
 memset() was limited. For Xen, I think we should also remove the function."

So either you want to follow that route, or it would rather be my patch
which ought to be considered for merging, not the least because it also
deals with yet another MISRA violation.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2022-08/msg01185.html



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.