From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E5A6C54EBD for ; Fri, 6 Jan 2023 20:35:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 982698E0002; Fri, 6 Jan 2023 15:35:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 932F98E0001; Fri, 6 Jan 2023 15:35:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AC8D8E0002; Fri, 6 Jan 2023 15:35:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6D1208E0001 for ; Fri, 6 Jan 2023 15:35:19 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3EA74140ECA for ; Fri, 6 Jan 2023 20:35:19 +0000 (UTC) X-FDA: 80325529158.26.90D3E5D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id B6F5216000A for ; Fri, 6 Jan 2023 20:35:16 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="hBC5oAW/"; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673037317; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/+ywmFzjmOxKFjuWdyH/7WIPX8vR48fvhI6fnLdcaGs=; b=xRmEfp4UrWNcQ02bUyoMIHs5Lamq4F9BL9uUDZrDyOq6pCb6rwIYyK/HLEO0Kb0GydPfmS xJMXcWXQK64WSZFtyHogSGVKh/Hvmf4+ZI8kdMJisb+E2XFFyiDpyfBhlPIWD8QjsrJiGW i+HPlvUUNTFpWTA2qTeN7zu5UwZMW5I= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="hBC5oAW/"; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673037317; a=rsa-sha256; cv=none; b=WgtM2znuKroBmruvzrmHRdCqYGG5mt7zvSwj4NCGV1J8odLaRGjWx/rlS6yEVk2fRDR277 8ZsyNzmIwQIWZd/oOMVIlrh7b+b3UUDI5jz1TWedpcr1r2MgXUrSKzCXeVEAaqPMWSILQM i7zJHVM7/o3KJIHCi4yn7AN+ZAgqk/Y= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/+ywmFzjmOxKFjuWdyH/7WIPX8vR48fvhI6fnLdcaGs=; b=hBC5oAW/uNU4kZV3mETyOEesnc kUprwIvvs/cepzlZ+y0PQcvTNxBM1L6EVEmnEGaGgV0T4arcJjGIs40CNCGq1B3p17utvahf1Y4GP lMmqmtIBy2xHV36Q+tY3NsfdFnTx0mopXiIhJmmnRL9jDNklrqZcbWOUn52MUDhQD0702zQVUXlf7 0OQ9p4OGl4G+O2oyBlWuohhuUTKgE46VI4C0Bc9xo7CgLu2wTAusM2kNWiKliBFHD1D3mr+Fj8gbD 0AmK09uQNL4YcKYEs2mwyVSeXe1yh8CNEnPWMuGBTClYp4kE4Efkwk+4TTAdD6MWlO/JnGtZC4ctn 1yu957Og==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDtQi-00HU5f-Lt; Fri, 06 Jan 2023 20:35:08 +0000 Date: Fri, 6 Jan 2023 20:35:08 +0000 From: Matthew Wilcox To: kernel test robot Cc: Jesper Dangaard Brouer , Ilias Apalodimas , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt Subject: Re: [PATCH v2 02/24] netmem: Add utility functions Message-ID: References: <20230105214631.3939268-3-willy@infradead.org> <202301061057.hnJABXCX-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202301061057.hnJABXCX-lkp@intel.com> X-Stat-Signature: p9pi5413bpqht4ycdrso51myq6zqxtaz X-Rspam-User: X-Rspamd-Queue-Id: B6F5216000A X-Rspamd-Server: rspam06 X-HE-Tag: 1673037316-609491 X-HE-Meta: U2FsdGVkX1+HodYutN6nE3l40KbMYpnkZx9rDmGGDrduJ8B5JOVWAJ3YBJ27WV0eZOJ+okJXdCjrWOny+aXPcbU/jLDjeFfPHy5LZX9jRMJywLJ8/SiM0jcw1zUP/zzIQ20I3Mvpri8z6pUZ5dHIqkkvwQ/CiTWqxj5SLvTXJ36nG2CLQEMtX48xeY2qBb/epFLwx1Kl5MMua3Po/9pMgb6ZqVQnYQtAF1e3b8D/7UzWyN9mt8y2gtQZGp6zHPg3wLE/F8tmSOlObgWAFFSWaBmW49fFrC7oxlCEY/YpWCJ+ZbRjGAFPr9NfGgJWhc1RigxQMkPqSjbkzjtjEKzLn8zaC4j+62vVYTf+kh39rM2px5/tqYKwS3V+HWUVzEnYijGU16cjpggnEmKe8ZtRvu0vtZAU+tpB9YfZGkrjxvd95f96Q984R8tNy1HUFwnHFEODw4laToM0yrJDIxi67xy2qzOJ4ufEd642CkA8d5IqoCcRpRbHFH/jwUeSD8hBvGuldw099sua+5oI+4ogAw46cpx9wtGS/CDRPgTScmjfCSMf7qUvTPQCeC/kBvDrMp74TdqZoOqev8O+ZWkUf63VXpUt8TtPAHzoN6sp91QB0YD/PTzjNlkR3AaxFlAEolzEHih4dVyUQ+xzVfHJRb/tYkgRXUDsaNdEdkZqqAmm7GLLoSuEpIrXy8Kp53NRwRt10nWdA9gtcJu8bMMYFNGqlT3NugiRbgpGOBnhfP0nlQWZ3F985SBlNP/wyWJDI/lMe9mHTeH3WoxJCHO2N54T2JkfG1ABCJoZjsR3qa5TSM1uZm9VwAJ9wnHfZRddROCq4eZcmBJL2Drxiq5wkWR7LbGyNngm X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 06, 2023 at 10:24:30AM +0800, kernel test robot wrote: > >> include/net/page_pool.h:111:21: warning: due to lvalue conversion of the controlling expression, association of type 'const struct netmem' will never be selected because it is qualified [-Wunreachable-code-generic-assoc] > return page_to_pfn(netmem_page(nmem)); > ^ > include/net/page_pool.h:100:8: note: expanded from macro 'netmem_page' > const struct netmem: (const struct page *)nmem, \ > ^ OK, figured out what this error means. #define netmem_page(nmem) (_Generic((*nmem), \ const struct netmem: (const struct page *)nmem, \ struct netmem: (struct page *)nmem)) Because I defined this with _Generic((*nmem),...) instead of _Generic((nmem),...) (like page_folio() is defined), clang always selects the second case and not the const case. Apparently lvalue coversions remove the const (backed up by https://en.cppreference.com/w/c/language/conversion) but I had no idea that _Generic applied lvalue conversion to the controlling-expression (it does! https://en.cppreference.com/w/c/language/generic) So, yay for clang's extra warning. I'll fix this up (as below) and send a v3 next week including the various R-b that I've received. -#define netmem_page(nmem) (_Generic((*nmem), \ - const struct netmem: (const struct page *)nmem, \ - struct netmem: (struct page *)nmem)) +#define netmem_page(nmem) (_Generic((nmem), \ + const struct netmem *: (const struct page *)nmem, \ + struct netmem *: (struct page *)nmem))