Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2487229imd; Fri, 2 Nov 2018 12:15:37 -0700 (PDT) X-Google-Smtp-Source: AJdET5eAzr5m4bL+TMJ8ilfoPsVTOeNyEOeUmXaWCK49fYzjEUeASQbB7mIdPNIygHxaVP/xBgIz X-Received: by 2002:a62:4dc4:: with SMTP id a187-v6mr12931109pfb.92.1541186137665; Fri, 02 Nov 2018 12:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541186137; cv=none; d=google.com; s=arc-20160816; b=0VBD1kNzKAqA64YPgOkhcp2INnp/KvD/AfMv5VEkj9GSltXaLS2xKE6WdaKbUZeF6C PlxclVl3y/0kYJTvOuXNfpYYzmcjRpWLUGlP3AwhytY25s22Q2yAE5DYeFiyMrcFdfw2 oLEKq0TewY4JoTS7FuakMMyHtN390SwOJfxgTv2OmNk3R2QyUNXysUp1iTjYdFE5D4sW 1DHlypGlH7im+9rx1YNz4FnW/HCeV9AR9f+wY7CwFWjG13hGeaG6lE4bzXMc7uhjUpjB 0MuGrrdzErSgsj0quuG6hXgylUb9VRv45N5A4w32JD27CIr+Iyuh2Bc6i/r4P/3qLJZu FOqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JDk1X3K4DSQkY1TL+z8S6gHQ4fsyb/pjGxgKFSecu0A=; b=KPHBFgD6Rj5jW64hrSKm63ymfo2zpP8NuW7qbICiXfQWHipz6zc6S2wkBmzEsvjiq1 zOCxbG2EGE7gekMZRKbpiLQRLX5YD75OaCkrYpQ4r3sK5Sg1vz+2wInAsf1ggCOztFWF DYqLi2KkQ2qo13v7SowIFANq1XFO99uGr/yzYgyRSO1/QHmGJlbWcQebkOlNEdpsgOy2 q5aqrHIRZH5C9wEil/GpWPTl45Ipdu1gdwramv69S9W3V1NmuQgQ/t/H1A2u/WFTEMnb pudIAc3iorlwTinA7b/6jMlHbJ9rxC9Ps9BdRp+16kf4HCv6rh/4//kwozmP7O9lV1XJ tbkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LMeVSXft; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v141-v6si23179346pfc.193.2018.11.02.12.15.22; Fri, 02 Nov 2018 12:15:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LMeVSXft; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726191AbeKCEXY (ORCPT + 99 others); Sat, 3 Nov 2018 00:23:24 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:33028 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbeKCEXY (ORCPT ); Sat, 3 Nov 2018 00:23:24 -0400 Received: by mail-it1-f194.google.com with SMTP id p11-v6so2173487itf.0; Fri, 02 Nov 2018 12:15:01 -0700 (PDT) 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=JDk1X3K4DSQkY1TL+z8S6gHQ4fsyb/pjGxgKFSecu0A=; b=LMeVSXftNyh8+Fn/zG5SQdXRbewBOYgyQkFtP9dcO4B3MmWtyXgshkHyOcJ0mFnoYG FpdlXLbA33kAJGyztxPolkiWtCNPuYlKYLWs8s1Db0HRiicPCuM07hqiCcSoeRqGh/17 O9k3g3P+WhtnybTu9xsvmUKmhJaQW7uuwf7/5lIi0ycVOQLz6iFyKebdhmGlONZBeDCN LGKFoX0TtP17pFPYIns5CQCNPI2ibJUIPGUKTT5XPeATfRz0T1dyyB44khowFbegJ+d0 cXohLzJdWZC28VWpUp+aWYL40T1t7HJjZfY/jB860zmAYstP/cuLTGr0eMs22QFQNQD3 MPXQ== 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=JDk1X3K4DSQkY1TL+z8S6gHQ4fsyb/pjGxgKFSecu0A=; b=KSu7bggnNBmGBdYuwz5ySlJrxJ66UQ9LtG51gpv4W6ChVRdkSdWqfW+ndWHtsmas3f FiBK1tlZ8WwIcMZe+NgVsUlM5Y7Mk2GQQvUeNZi7fwgBjm8tKxJrWwii4qKraW/7r14b 9366FGHXicwFOAaJ0NmZhqoY7HG0bhhqEt9m5R0i422OH3AUx71uTC8n7iY9ugQsAmq+ Mp62rPA04D42sA7wLYfTgKRftj2JBKRCeYyPPaByzTX4RPSSzRMqqvBP2Jc9EYxOkwpw lCA6bou4hD3ni/VOnw9+MqCbIwYXs+6AzqSV/m7yU1wxamSPfsmH7pU69XEZMPEoJgi+ mOXQ== X-Gm-Message-State: AGRZ1gLiGuBJfpaaVe9Q+gVYamp4icI5kNmx91zjGoDwUGSca1YNvOXD VidlOloUVeOZFr6LTfUAbaqJwJ8tO7akbKgzRZ4= X-Received: by 2002:a24:16cb:: with SMTP id a194-v6mr234586ita.40.1541186101294; Fri, 02 Nov 2018 12:15:01 -0700 (PDT) MIME-Version: 1.0 References: <20181102152637.GA3105@hp-pavilion-15-notebook-pc-brajeswar> <20181102182905.3klrdw4dxapeoiib@tower> In-Reply-To: From: Matt Turner Date: Fri, 2 Nov 2018 12:14:50 -0700 Message-ID: Subject: Re: [PATCH] include/asm/cmpxchg.h: Remove duplicate header To: jrdr.linux@gmail.com Cc: Michael Cree , brajeswar.linux@gmail.com, Richard Henderson , Ivan Kokshaysky , Andrea Parri , Ingo Molnar , "Paul E. McKenney" , linux-alpha , LKML , sabyasachi.linux@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 2, 2018 at 12:09 PM Souptick Joarder wrote: > > On Sat, Nov 3, 2018 at 12:31 AM Matt Turner wrote: > > > > On Fri, Nov 2, 2018 at 11:55 AM Souptick Joarder wrote: > > > We run the static analyser "make includecheck" which list out files where > > > duplicate headers can be removed and based on that we thought to remove > > > from this file. Didn't understood about the existence of second include ?? > > > > > > #define ____xchg(type, args...) __xchg ## type ## _local(args) > > #define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args) > > #include > > [snip] > > #undef ____xchg > > #undef ____cmpxchg > > #define ____xchg(type, args...) __xchg ##type(args) > > #define ____cmpxchg(type, args...) __cmpxchg ##type(args) > > #include > > > > asm/xchg.h has a comment at the top that says > > > > /* > > * xchg/xchg_local and cmpxchg/cmpxchg_local share the same code > > * except that local version do not have the expensive memory barrier. > > * So this file is included twice from asm/cmpxchg.h. > > */ > > Thanks Matt. Sorry for the noise. > Is there any way to exclude it from static analyser that someone else will > not do the same mistake in future ? Since this is not an uncommon pattern in C, I think any static analysis tool that attempts to find duplicate includes should attempt to recognize such a pattern. That, or humans should review the output of their static analysis tools. Or you could try to compile the patches produced. I think any of those would have caught the problem with the patch.