Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp351651rdg; Thu, 12 Oct 2023 07:31:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFyIfLzbrxvgVIdU42IUS/yED0icvvF1x2r1wiHZaJJ2Ib7RY1Wl8ZCbqvSkpEO714lknI X-Received: by 2002:a92:c56e:0:b0:351:50f1:1f98 with SMTP id b14-20020a92c56e000000b0035150f11f98mr26614956ilj.32.1697121075907; Thu, 12 Oct 2023 07:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697121075; cv=none; d=google.com; s=arc-20160816; b=mGfyTz/QWsmfRv5WcW0t58vizRzJgqmJjZn2wEqjbTvwktEU1YunPxt4+jihpasb1Z pV+PXqoL6suUclAHsuwKgfErp6x4kgDSCh+Mw5gfrN+bRtpRIa1r1r7no7BJnQtdLONY mYGexOMBjctPVWGlHdmG9Ijo82ETuHMV+0dCWBWGhPuDMtHKzL6Bm5mUSJtq0tdJRltW DhyyjQU4tYs4a/0t21RC/olFqm0ljCfPBAk8L4AteMQUDi3Ak40NuxEI3//vSGCS7m+4 1DgxYD/CQBZZ+iIOPWeGD+Wrx9PDoIRme98dscuTP9CbBlm6z8V6NWHFjhtRX548EwgK iijg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9BtIVBlpSIVQw6t8LBvInNyNxUiBSBsc/dgu+7xr1DM=; fh=ons8ItGhAxv2fRW8NNDjP1bq+bw++FdHlW/QLURqdak=; b=AA7tZLQkXQ6FxYjjBOAbx+H/4S2JVAzm9IzKEDPLWULT6F8E6B8n1V5//jyCmazOay EuHASOMSHjwJU3jDHAMIwnRmo4JiM9Cal3jThbibIvrLnDbnwc0xU4dRVq6RwIV1Jjhf 6DDtJuLuFazRvCnWDU3bqVZbTW+mX+nNubha34/OCYNT1WsgXE96vI4BiWY8Ru9QBLGh ZRlRyOjYWuXlMXdrU4Kya5dO223Ibw5AZhnsYV88o8yJjd7AoJAcnEMIW7iU/uHOM0Zz Meor7Tq2aTeqAfjDePRK1RXj4JyMlZOf4xRzE2K5VWaWkrPmXqI9d62vBwbyQ8eZ96sd lZeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=BnnIRehl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id cn7-20020a056a00340700b0068a4ba92eafsi14698451pfb.54.2023.10.12.07.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 07:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=BnnIRehl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7E81780ABB3C; Thu, 12 Oct 2023 07:31:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347154AbjJLOar (ORCPT + 99 others); Thu, 12 Oct 2023 10:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347318AbjJLOal (ORCPT ); Thu, 12 Oct 2023 10:30:41 -0400 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E479EE7 for ; Thu, 12 Oct 2023 07:30:39 -0700 (PDT) Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-3575732df7fso243615ab.0 for ; Thu, 12 Oct 2023 07:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1697121039; x=1697725839; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9BtIVBlpSIVQw6t8LBvInNyNxUiBSBsc/dgu+7xr1DM=; b=BnnIRehlNpdIkyHHezJpYzvt9OEX133vLDjEs9WwMw6duUBe8RJZbXCCQh5+yLO65A /ioSpGKdnv9lSHQ2Tx1UGszln6WPAeUCYvpZIH0lwS+uf/0nCoTTEy1oXbQlUE73oIqp MNSoVIBqOfgUHAltjn11P+zjO3giLJG60ji5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697121039; x=1697725839; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9BtIVBlpSIVQw6t8LBvInNyNxUiBSBsc/dgu+7xr1DM=; b=EGrXiwccE978/Zuq++dkwnkoy9OOMnZF9w5lvKAcK0ehSSkkPqWrDXD26LR+vbLHE2 u0lkKPH/8slfASP0iea51fQB9ucb4mSfpTn3bG7BEIXHCHKtbf0OH4sz8/dH33B28S3U eeR85b7I+xBJsqFqKSQLhDQDtLvgIhJ15bg1NTt5OxTyamGVFSK9pYo+kuYaHhJdnvO7 /TcS5tQX2Rh6bMYUUJK8ZTz3cCduz6rLi2dujPSulSYR7qSSe0qTz1KrD3jtCoEwlkYs yFmUur9mHRsrsiyGQ3yyMeav1hb/c37HeSD183g+L/tsh6xRyylRayc2KdF/tm7rQ2wM G0og== X-Gm-Message-State: AOJu0YxFQ6Ie8xAxOBSSXg2B9d+/NqFAFqrPuJWf0KoFsyqyIvdpabjZ hisrwqNwa9c1hYKs0Zedt0R3Kw== X-Received: by 2002:a6b:3b83:0:b0:7a5:cd6b:7581 with SMTP id i125-20020a6b3b83000000b007a5cd6b7581mr2814293ioa.2.1697121039213; Thu, 12 Oct 2023 07:30:39 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id f3-20020a02cac3000000b0041ab9b6f5b0sm4059769jap.128.2023.10.12.07.30.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Oct 2023 07:30:38 -0700 (PDT) Message-ID: Date: Thu, 12 Oct 2023 08:30:37 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/8] selftests: Add printf attribute to kselftest prints To: =?UTF-8?Q?Maciej_Wiecz=C3=B3r-Retman?= , Shuah Cc: ilpo.jarvinen@linux.intel.com, Reinette Chatre , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <13a47130763d109aa40de153ecbee9ede22d8356.1697012398.git.maciej.wieczor-retman@intel.com> <4h2eu6yhodrujbvem24v7cwal5tnk2agsqulpxwi4myk7n35uq@phbxlajivrpq> Content-Language: en-US From: Shuah Khan In-Reply-To: <4h2eu6yhodrujbvem24v7cwal5tnk2agsqulpxwi4myk7n35uq@phbxlajivrpq> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 07:31:11 -0700 (PDT) On 10/12/23 01:32, Maciej Wieczór-Retman wrote: > On 2023-10-11 at 13:40:48 -0600, Shuah wrote: >> On 10/11/23 02:23, Maciej Wieczor-Retman wrote: >>> Kselftest header defines multiple variadic functions that use printf >>> along with other logic. >>> >>> There is no format checking for the variadic functions that use >>> printing inside kselftest.h. Because of this the compiler won't >>> be able to catch instances of mismatched printf formats and debugging >>> tests might be more difficult. >>> >>> Add the common __printf attribute macro to kselftest.h. >>> >>> Add __printf attribute to every function using formatted printing with >>> variadic arguments. >>> >>> Signed-off-by: Maciej Wieczor-Retman >>> Reviewed-by: Ilpo Järvinen >>> Reviewed-by: Reinette Chatre >>> --- >>> Changelog v4: >>> - Fix typo in patch subject. (Reinette) >>> - Add Reinette's reviewed-by tag. >>> >> >> I still need information on how you found these problems. Please >> add it to change log for each of these patches. > > Sure, I'll add notes on methodology to patches 2-8. I understand that > this patch (1/8) message doesn't need that addition since the problems > it exposes are in separate patches. > Yes please. As mentioned a couple of times, I would like to see how the problem is found in each patch commit log. > Or would you like me to also note here more specifically what effect it > has in the rest of the series? > Yes please. >> I am seeing checkpatch warning: >> >> WARNING: Prefer __printf(a, b) over __attribute__((format(printf, a, b))) >> #102: FILE: tools/testing/selftests/kselftest.h:81: >> +#define __printf(a, b) __attribute__((format(printf, a, b))) > > Running checkpatch.pl with --show-types shows the > PREFER_DEFINED_ATTRIBUTE_MACRO is raised. From looking at the error > message in the script it looks like a false positive: > "Prefer $new over __attribute__(($orig_attr$params))\n" > > Please correct me if my train of thought is wrong but I think checkpatch > sees __printf() macro defined and it sees it's raw version > "__attribute__((format(printf, a, b)))" which it wants to replace with > the macro. But since the raw version is found in the define line that is > obviously not possible. > This is fine. thanks, -- Shuah