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 X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E42FC433DB for ; Fri, 12 Feb 2021 17:38:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2CBCF64D9C for ; Fri, 12 Feb 2021 17:38:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CBCF64D9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AFE3E8D0077; Fri, 12 Feb 2021 12:38:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A5E9D8D0060; Fri, 12 Feb 2021 12:38:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 974B68D0077; Fri, 12 Feb 2021 12:38:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 7E3108D0060 for ; Fri, 12 Feb 2021 12:38:10 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3BF07585C for ; Fri, 12 Feb 2021 17:38:10 +0000 (UTC) X-FDA: 77810324340.10.7DE9DA1 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by imf23.hostedemail.com (Postfix) with ESMTP id D6027A0009DA for ; Fri, 12 Feb 2021 17:38:09 +0000 (UTC) Received: by mail-qt1-f182.google.com with SMTP id e15so152642qte.9 for ; Fri, 12 Feb 2021 09:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=782gW1pWyuUmVkHuESHjC+pwC08cKYbxVxzT2U7TOYQ=; b=I94FobQ5jbvlkrJVdNN05sFEiH5WHHUenwC7lYNcXNk0LfIqf4m7NkgJkafy1CviFV TUGxoyXHVz0He4KwtvLod/SPaYBA9JxAQBTQkzELFZh+RSXw6jA3WYydXKD/fp5tHmht fwRLuHZeG2N/8A5g0tWYgJnzpn7nQDOqdzX55c7tt6ipFCfo5aNThYADuzG/DdJS7iX7 D/5I155g17bhaKysTXuMMXv+ZGSlBWPMcdzVmvdcu6ewDPkzgIj3HdPBi939uzQx3DwE sSXh937sc7kwyMNT8WMSTNWWssHUypd9l6vHeU66U+a6ZrJTvvLdcmKtpoXhROHZWzuF zdlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=782gW1pWyuUmVkHuESHjC+pwC08cKYbxVxzT2U7TOYQ=; b=VXRCbr9P1K4K/Koj6D+5AkXmNaeDC5UyfrBKnoLPmscfaO5xFKovU5CNzl8TirnChy LVnoMP1SebmYJbiNZTZ8zroLSXF6mL+/nEPcjs9LKuRjhQSbNaSQPNMWTKNT/+zCi9HJ zXcUKL30MNsVr8swjGCWBYuNsGvOFN1YEGk2RzRXezra4mmV9LZAfdvib3rsqaePjBN1 BqVHVwYIYuNrFC5B0q8ydnq9v5Me4ny6Btvpwfd1PyGK/6yiEQsimeUK57hagCZzZMYp SZcWSNbxumdYbeTNdzWMwJXgMmFDydP0QQRyyC19fUQqHtlWOCy5GhYLIb3kQ4zMUUf0 AhbQ== X-Gm-Message-State: AOAM530qJKd1Px8hnlZC+YPZ+3URESzaSWoyZ1qnusb6S7nNEtytYOYF CcTVL6Gb7/O3ZQAYQuJ4u6Ysa6UK8138BKzsJnM= X-Google-Smtp-Source: ABdhPJyljpgE+7S/bPw+i/2asfivVrTwEh1VpmIyNugoc4DFevBtQBWUIAEyrnlHySf2HvbDLAWJMEIHax0MdqohKb0= X-Received: by 2002:a05:622a:8:: with SMTP id x8mr3517678qtw.359.1613151488983; Fri, 12 Feb 2021 09:38:08 -0800 (PST) MIME-Version: 1.0 References: <202102120711.q6HS8p2m-lkp@intel.com> In-Reply-To: From: Harvey Harrison Date: Fri, 12 Feb 2021 09:37:58 -0800 Message-ID: Subject: Re: [linux-next:master 2008/10581] include/linux/unaligned/be_byteshift.h:41:19: error: redefinition of 'get_unaligned_be16' To: Linus Walleij Cc: kernel test robot , Mark Brown , Bart Van Assche , kbuild-all@lists.01.org, Linux Memory Management List , Jonathan Cameron , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: xa5kjtqe7895ggy4mfon4m6cr9zijmwf X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D6027A0009DA Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=mail-qt1-f182.google.com; client-ip=209.85.160.182 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613151489-835104 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, Feb 12, 2021 at 8:43 AM Linus Walleij wrote: > > On Fri, Feb 12, 2021 at 12:53 AM kernel test robot wrote: > > But what kind of syntactic trainwreck is this! > > (...) > > commit: de8860b1ed4701ea7e6f760f02d79ca6a3b656a1 [2008/10581] iio: magnetometer: Add driver for Yamaha YAS530 > (...) > > In file included from drivers/iio/magnetometer/yamaha-yas530.c:35: > > include/linux/unaligned/be_byteshift.h: At top level: > > >> include/linux/unaligned/be_byteshift.h:41:19: error: redefinition of 'get_unaligned_be16' > > 41 | static inline u16 get_unaligned_be16(const void *p) > > | ^~~~~~~~~~~~~~~~~~ > (...) > > from include/linux/regulator/consumer.h:35, > > from drivers/iio/magnetometer/yamaha-yas530.c:33: > > include/linux/unaligned/be_struct.h:7:19: note: previous definition of 'get_unaligned_be16' was here > > 7 | static inline u16 get_unaligned_be16(const void *p) > > | ^~~~~~~~~~~~~~~~~~ > > Inspecting be_byteshift.h and be_struct.h I do see that both of them > define get_unaligned_be16/32/64. > > They both end up calling the different implementations of > __get_unaligned_be16/32/64 on top of that. > > So include one or the other and never both at the same time? > Well that is hard to avoid if one of them is in turn included by other > headers such as the very generic > in this case. > > Harvey, anyone: ideas on how to fix this? > It's been a long time since I looked at this, it seems to have had a few more changes in the 10 years since I was helping consolidate the implementations. The intention at the time was never to include the specific implementations directly (be_struct.h be_byteshift.h etc) and only to include asm/unaligned.h in the places where needed. Harvey > One of them have to change name in the whole world I suppose? > > I suppose my code is working either because they both do exactly > the same thing or thanks to the order I include the files :P > > I have the feeling there is something I don't understand about how > this was thought out, like I must have missed something. All > the collisions are even in the same include directory :( > > Yours, > Linus Walleij