Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp846779ybf; Thu, 27 Feb 2020 00:33:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxuKaLTl3rpz+AybhFPspKDZIkFEYMyDq64fljx+Ue2dZwSjErBZS0kFGu5PxLPBruyfsYx X-Received: by 2002:a9d:d06:: with SMTP id 6mr2442354oti.176.1582792401752; Thu, 27 Feb 2020 00:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582792401; cv=none; d=google.com; s=arc-20160816; b=z5Qy6FpxsBkHQojIAu74CYGCYhgNQ8CARglcsKEzpAPv35nbYU+BU+YoHo1MSJAKCv MgEHdGkTvc3jLSMOIrvD2a7hZbQdX+4gsI6EttZmz6ws7D+0ksdwx3YbEGGIkKaVcP5E AhmB2vHWbUK0z7D4nZ7bZ196OLydSyLEsv+k84PkXlUJD/5MHPcdqJKDUXYSQM+ZFM7p yGFeHovuQ/ZoDztmF6qgwZmbrwrCKjQ0ZEBQCGHyXYuJ+fbR6PiACtSPFLhLf3XhxDgm 070fqT5PYnyStEqD7BbiBLexwhU4Ugqz7GyPN1D6GmuV/ApjnNVIqg4A7BmqdPcZaJHU xhYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=S8Vr6HwWIuSO5vYn2b36W0hIHX0GN/MmrmM3vHRNCp0=; b=X1/Pe6zSob+PRh4cWObZsMTri+7SIqjsMyQE/ZjH5CEJ0uQ46lQmmJn5PNt+td9vQ/ mWr/0VNaxKcN4PsRnMbGZg1mL3Q2hf0RvBz9eowlvY3db0o5nAAGWd70kdg/bgSUXOUR 4KeEdg+oSrnV1OAk3lFuMJIlMW1KpY06sm8VZ7f7Mu2fywfmCiBwr6JORG2GsxvpPHJR L3w9R+i5ZV5mwxuc8x/UtkhxbJBXwqaQhCNio7f0PAuhoNXnKCC/O7NWW1H6rgLyEp4T N2syFZY1zytjHcJNhF8qkC8hlXRgwCcsoYl/VlcsC5Kf5o8n6CiVZ/5wn4h9L5vmxxnZ SFWw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18si1056159otp.61.2020.02.27.00.33.09; Thu, 27 Feb 2020 00:33:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728566AbgB0Ic6 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 27 Feb 2020 03:32:58 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:32881 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728440AbgB0Ic6 (ORCPT ); Thu, 27 Feb 2020 03:32:58 -0500 Received: by mail-ot1-f68.google.com with SMTP id w6so2186515otk.0 for ; Thu, 27 Feb 2020 00:32:58 -0800 (PST) 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:content-transfer-encoding; bh=OeGtTXktVcqacz7cYnWdrEZYsOucMfq/ZWYQMhH1UAI=; b=Vg1yt3ftDzobeDLlbheHZBnRkwGlD2gpWJjHqM5Qs/TKNaPBqhYgNGOk1o7bzXZbnO jU4db5dj9/7aZ1GMtUKq/1ah3stww9AFEOzIpAuhkljZ5vR9pdaFqHi8nGf4gwbiUw2g vHvZEpAp4PVjWmyQ9dCmM2XPhd5VMYiLUeqFYUSSE4/Pt/mfiW3u8H+EpPmjt/dzR8pa dMUbRYT/hVH9WuwJFUA/2W4KKNDAjCOG/TfNT4TMb/D8JKJy3khRJZyr3gJDvW7piv7B kebLbrzyCEQqPQFqkCKC5Oqct/b+qZVl8MPJbXPZC+/+2PTgy+aQEMhZcN8cuSN9YAXi b24Q== X-Gm-Message-State: APjAAAXwzB4vu8rZTLmSYIxEBZvrNkgv7crtPdDpQTYyEdlJaJn+CSSi 7pUD8RNFsokxGJrMFBdY9cHdV3zXHWUcHJgd4nM= X-Received: by 2002:a05:6830:10e:: with SMTP id i14mr2360889otp.39.1582792377824; Thu, 27 Feb 2020 00:32:57 -0800 (PST) MIME-Version: 1.0 References: <73c3ad08-963d-fea2-91d7-b06e4ef8d3ef@linux-m68k.org> <20200227081805.GA5746@afzalpc> In-Reply-To: <20200227081805.GA5746@afzalpc> From: Geert Uytterhoeven Date: Thu, 27 Feb 2020 09:32:46 +0100 Message-ID: Subject: Re: [PATCH v2 06/18] m68k: Replace setup_irq() by request_irq() To: afzal mohammed Cc: Greg Ungerer , Finn Thain , linux-m68k , Linux Kernel Mailing List , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Afzal, On Thu, Feb 27, 2020 at 9:18 AM afzal mohammed wrote: > On Wed, Feb 26, 2020 at 10:42:00AM +1000, Greg Ungerer wrote: > > > - setup_irq(TMR_IRQ_NUM, &m68328_timer_irq); > > > + if (request_irq(TMR_IRQ_NUM, hw_tick, IRQF_TIMER, "timer", NULL)) > > > + pr_err("%s: request_irq() failed\n", "timer"); > > > > Why not just: > > > > pr_err("timer: request_irq() failed\n"); > > The reason to use %s was that it could be automated by cocci script & > the o/p didn't look bad. Second arg to pr_err is what cocci > presents me & there is wide variation in the name across the tree as > Finn noted. > > Excerpts from v1 cover letter [1], > > - setup_irq(E1,&act); > + if (request_irq(E1,f_handler,f_flags,f_name,f_dev_id)) > + pr_err("request_irq() on %s failed\n", f_name); > > [ don't get mislead by string contents used, this was for v1, just to > show how the result was obtained. To take care of Finn's suggesstion, > instead of modifying cocci & then making changes other changes over > that (i could not fully automate w/ cocci, and Julia said my script > is fine as is), it was easier to run sed over the v1 patches ] > > > And maybe would it be useful to print out the error return code from a > > failed request_irq()? > > Since most of the existing setup_irq() didn't even check & handle > error return, my first thought was just s/setup_irq/request_irq, it > was easier from scripting pointing of view. i felt uncomfortable doing > nothing in case of error. Also noted that request_irq() definition has > a "__much_check", so decided to add it. Most (all?) of the code calling setup_irq() is very old, and most of the calls happen very early, so any such failures are hard failures that prevent the system from booting at all. Hence printing a message may be futile, as it may happen before the console has been initialized (modulo early-printk). Just my 2 €c. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds