From patchwork Mon Jul 18 16:23:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 12921429 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9047CCA479 for ; Mon, 18 Jul 2022 16:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234422AbiGRQYk (ORCPT ); Mon, 18 Jul 2022 12:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235228AbiGRQYR (ORCPT ); Mon, 18 Jul 2022 12:24:17 -0400 Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE7542A26D for ; Mon, 18 Jul 2022 09:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1658161456; x=1689697456; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/RBNCH80TDQvkYUuIaUt35rVQdjltJAKEvEYkHGTvIE=; b=kZA9LVA341TJNDwX7fRUe/uTPpKDb9847o+O8NxPwgm0dfGxh+I9Vgyv UyM5XXJQY19j3Os0jPTngzUVg8HHlE02sXiQn3pmV0XrzujbHMlUI+WJx QqBgFqRGVb3FWuhWr0ZMDItHFJyAkPXetLZMWlYCwYNibfN08NqQDuKgV o=; X-IronPort-AV: E=Sophos;i="5.92,281,1650931200"; d="scan'208";a="219602872" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2c-90419278.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 18 Jul 2022 16:24:04 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2c-90419278.us-west-2.amazon.com (Postfix) with ESMTPS id 013E844380; Mon, 18 Jul 2022 16:24:03 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Mon, 18 Jul 2022 16:24:02 +0000 Received: from 88665a182662.ant.amazon.com (10.43.160.159) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.9; Mon, 18 Jul 2022 16:23:59 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Kuniyuki Iwashima , Kuniyuki Iwashima , , kernel test robot Subject: [PATCH v1 net-next] selftests: net: af_unix: Fix a build error of unix_connect.c. Date: Mon, 18 Jul 2022 09:23:50 -0700 Message-ID: <20220718162350.19186-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Originating-IP: [10.43.160.159] X-ClientProxiedBy: EX13D35UWC004.ant.amazon.com (10.43.162.180) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch fixes a build error reported in the link. [0] unix_connect.c: In function ‘unix_connect_test’: unix_connect.c:115:55: error: expected identifier before ‘(’ token #define offsetof(type, member) ((size_t)&((type *)0)->(member)) ^ unix_connect.c:128:12: note: in expansion of macro ‘offsetof’ addrlen = offsetof(struct sockaddr_un, sun_path) + variant->len; ^~~~~~~~ The checkpatch.pl will complain about this change, but the root cause of the build failure is that I fixed this in the v2 -> v3 change. [1] CHECK: Macro argument 'member' may be better as '(member)' to avoid precedence issues #33: FILE: tools/testing/selftests/net/af_unix/unix_connect.c:115: +#define offsetof(type, member) ((size_t)&((type *)0)->member) [0]: https://lore.kernel.org/linux-mm/202207182205.FrkMeDZT-lkp@intel.com/ [1]: https://lore.kernel.org/netdev/20220702154818.66761-1-kuniyu@amazon.com/ Fixes: e95ab1d85289 ("selftests: net: af_unix: Test connect() with different netns.") Reported-by: kernel test robot Signed-off-by: Kuniyuki Iwashima --- tools/testing/selftests/net/af_unix/unix_connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/af_unix/unix_connect.c b/tools/testing/selftests/net/af_unix/unix_connect.c index 157e44ef7f37..5b231d8c4683 100644 --- a/tools/testing/selftests/net/af_unix/unix_connect.c +++ b/tools/testing/selftests/net/af_unix/unix_connect.c @@ -112,7 +112,7 @@ FIXTURE_TEARDOWN(unix_connect) remove("test"); } -#define offsetof(type, member) ((size_t)&((type *)0)->(member)) +#define offsetof(type, member) ((size_t)&((type *)0)->member) TEST_F(unix_connect, test) {