Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1016412ybf; Thu, 27 Feb 2020 03:38:29 -0800 (PST) X-Google-Smtp-Source: APXvYqx6xErmVlVkgltBSyOJ1vPGnZQdr6TEzam9iOEe+NrPqyYIurLvlLLIkYJTO/EmM05Oj8Tm X-Received: by 2002:a9d:66c1:: with SMTP id t1mr2637723otm.73.1582803509733; Thu, 27 Feb 2020 03:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582803509; cv=none; d=google.com; s=arc-20160816; b=tF4y5bhKLKsNLBnTkQIah9+qAdotB/UzWZqggZp9uk5ncK6FbELPJb26dg01sOWEEx Ux5boAAzaTJ3VLjBISpDe3gCBjxULoXEyXtTO7Vx6Krl7cqFHY63Qihv+awNSmz+UA7Z e+SsMYZZ+92uanf5vUcCTHFwvABCMcr1SG3sI3IXkJjMGTnTwbtsPSk/YIBN0wYTGM96 EFvookv3lv7SkIklgXW9GZrgRB36YbgrVMU7yAp/sh88BXouMLotahvBaEb0jFsny7o0 OWMDk6P14MLDWVaWzR1a/ABVXXf52nX7WaNO7/vhDmgThJMOmrZbp4oatiXmEzt4L0c9 jt2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W2IExvbOkgyWnvI9r88ADR0c7T8ydJDDE47tp0M5rgQ=; b=l6KjS1Es17JLaHTfSkxO0i3ZVNy5lxbStHOeEAIZKWXt3dPK/KJrx0aTpILB7RZsAE PXyDpnt/tweQK9Bgr3nTmRq1XCTTZQD3RP584KCO4ZBfyb9XSyYo/rjJmpDyrateVjzJ 0wPiqO5qvjYOLM0htzgp5g5mWdClFhz7jiKAxmkQ6yx73A2SlSGulDs2dPlhkdYTkkiI 04a0eQ2sWEiEnVZtqWADzh/u0VEXuJGyFFtAjaSOVQu7isGLojiFiEzF4+DBS/pzXxWD 2s3FrjFHWWcRd/UA+W06SLGkmvlUobDl/piXDQ8se55LYhDEbOp99pTR3UCxO3iGapZU UeeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C2QTmIBH; 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 n18si1314646otf.231.2020.02.27.03.38.12; Thu, 27 Feb 2020 03:38:29 -0800 (PST) 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=C2QTmIBH; 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 S1728927AbgB0Lgw (ORCPT + 99 others); Thu, 27 Feb 2020 06:36:52 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:32876 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728856AbgB0Lgw (ORCPT ); Thu, 27 Feb 2020 06:36:52 -0500 Received: by mail-pl1-f195.google.com with SMTP id ay11so1041771plb.0 for ; Thu, 27 Feb 2020 03:36:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=W2IExvbOkgyWnvI9r88ADR0c7T8ydJDDE47tp0M5rgQ=; b=C2QTmIBHk62oU8Q9c/vwIkm9nMXTPUoGBGsRzpoiuhyEiHOUOYVck4Nt+nNQqaXuLj mNavyl07qF6yhZTklzwqQs4guI7KuKWp86oamo4c1jVoWEcEBrB16cN/JRz7iP2WYOiB PCILU81QAw+PeNVkuqt061QUorMjFNdpbClLcibVMrYJiAjyRbgEnhxIVdohbXC+z0CL ywgdRK6l+xgb6jXMi2zh6tqFfmvfM57IjYTsNiB/+ihg9U828cUn8xePTKkWi4jGsLvM aBrBFJM8r0AygAwO/LVAcgpfVUpauPFeAUUvTgJngjcu7G5kUaGnCdNbnQKQZ6ieFSGC 3oRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=W2IExvbOkgyWnvI9r88ADR0c7T8ydJDDE47tp0M5rgQ=; b=X56W5WIbV61w5ag3rBEzi4hrqMIagOi4366t1cE7JjSO4tBbwfrqx8aJk3Glw5SZUS vRmBV4JPUhi1IE2oaeTtNhPUpPaR2TpwXNieKyRKl1YljM9l2qK0+AqsA+qGGMh7Ld3/ 8NKueY1diXxkNF7N8x4UzH2BlxhCKdQZb+EJpn+TAg7HSqSGrZI74rVb3Gk/FwJzFMfQ 1tmJxX/G2zEaD7b4zujBQhzr4wkRNewionZq3nXv+2df5+/vJuNhNEalj9hTcNE3lxsO qmw5ImX5PnzRCyWpHrYZgsdG9S5MYb84IMu6KygfL1muA2kzl2QqHBjARo9DXKIEFnGF a1yA== X-Gm-Message-State: APjAAAVZ0IxhtS2N7xXBvMBZfI1joe8TYpKYPHGHdE7oTOpBaUt4m5uS q+sgeFyvBM1975BFaj6IbUs= X-Received: by 2002:a17:902:6907:: with SMTP id j7mr4338741plk.88.1582803411163; Thu, 27 Feb 2020 03:36:51 -0800 (PST) Received: from localhost ([106.51.232.35]) by smtp.gmail.com with ESMTPSA id u126sm6677368pfu.182.2020.02.27.03.36.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Feb 2020 03:36:50 -0800 (PST) Date: Thu, 27 Feb 2020 17:06:48 +0530 From: afzal mohammed To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Juergen Gross , Josh Poimboeuf , Masami Hiramatsu , Peter Zijlstra Subject: Re: [PATCH 14/18] x86: Replace setup_irq() by request_irq() Message-ID: <20200227113648.GA5760@afzalpc> References: <87v9nsmhjj.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9nsmhjj.fsf@nanos.tec.linutronix.de> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On Thu, Feb 27, 2020 at 11:49:20AM +0100, Thomas Gleixner wrote: > afzal mohammed writes: > > Seldom remove_irq() usage has been observed coupled with setup_irq(), > > wherever that has been found, it too has been replaced by free_irq(). > > Please do not copy the irrelevant parts of your boilerplate text into > individual changelogs. Changelogs should have the information which is > relevant to the patch they describe. Sure, i will change. > > + if (request_irq(2, no_action, IRQF_NO_THREAD, "cascade", NULL)) > > + pr_err("request_irq() on %s failed\n", "cascade"); > > What's the purpose of the %s indirection here? Putting that indirection helped me automate making these kind of changes w/ cocci. As there were >150 instances of setup_irq and since "failed", "request_irq()" were common, putting a %s indirection with the timer name that changes in each instance, it was easy to take help of cocci to automatically create it (though not fully). Would you be okay to keep that indirection ?, if not , i will make the changes manually. > Also that error message is not really helpful: > > request_irq() on cascade failed > > Something like: > > Failed to request irq 2 (cascade). Yes, as i mentioned in m86k patch (6/18) [1], i was uncomfortable w/ that string, based on Finn's feedback, in v2, it was modified to, cascade: request_irq() failed though still using %s indirection. > > - if (setup_irq(0, &irq0)) > > + if (request_irq(0, timer_interrupt, > > + IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, "timer", > > + NULL)) > > This is realy ugly. > > unsigned long flags = IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER; > > .... > if (request_irq(0, timer_interrupt, flags, "timer", NULL)) > .... > > takes the same amount of lines, but is readable. Yeah, i had felt it, the reason i went ahead that way was cocci could automate that way for me for three-fourth of >150 instances making things easy for me. Another reason was to reduce manual changes so as to make it less error prone. Seems you are against taking the easy route of taking cocci's help, in that case, i will change as you suggest. There was discussion on m68k (6/18) patch [2], but v2 series on similar lines, not w.r.t flags, but mainly w.r.t return value. [1] http://lkml.kernel.org/r/20200213020330.GC2684@teres [2] http://lkml.kernel.org/r/20200227081805.GA5746@afzalpc Regards afzal