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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 222E9C38142 for ; Tue, 31 Jan 2023 16:44:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbjAaQoD (ORCPT ); Tue, 31 Jan 2023 11:44:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjAaQoA (ORCPT ); Tue, 31 Jan 2023 11:44:00 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A14EDC for ; Tue, 31 Jan 2023 08:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lYYVU1erHhilKe3XQ1styn4N+tweXgnzouZSuxfsB/WEq0xf5bhO//oHlxRM5yUvjLRe+zvkk7zdxjlXoichm4sXWVWsKBOCtFSpsi48KoAE0X/rzOfhkew3MFwuthM/bRzk1COXnisIKTi3+4sB4U6LQb8dSTaMAOgiQEx7X4STapl/uHD6L3z7YzMVFr6ThllooV/PZ+fWfvfVJIh77oLEmbkF/2FG1GXh6EeOa1Mp7r9LQmaJlwMf4NOmyb5AARKLLidB94Ct0gmGIGJDbld+DQFiyETw/d70/PHspvFMjxTH4ZqOYmrqltMSTAXQrRkpzM6RZ3H/DVxiFLx4+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GUIxaOdzqFHGT62Y052PdH4lAzzWd0VSMkgA/mkk8wM=; b=b5LZRJcgG6L9OtVMzAIpmf8nYmzROyMqprwWYq6AeimVD73POkyEXSEzNYSXpld58Fjmgv+UYCTZTkke6B6VotI4QoztHdfwoCgqYgl/zPyNTX7BfD2NXsbMBvEfTvgp5of+mojiXJpv4sVom8sQtAU6TKklEKVx/hV4NH3tEaEvKSu0aSRJrFEXGcdl9HUPTOle4PgqsDeS7xs8t3YmaN4wrjWNsCIjAiUin+NMqwwNJd1gi5Ea2M28GjRh4hS7V+GEYwC0dl5tJoCrglDewVx/NDmDtgWldI0xWcWz/bqmFQZ4YkFqgNaZmA/iTmtIPL6d+p3SaAi3a/G21BTqFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GUIxaOdzqFHGT62Y052PdH4lAzzWd0VSMkgA/mkk8wM=; b=mJ8lgv5jSLu8ewZO2QkjVCaENnqIkyam4m61ktzjS738zlzQvngtw0is1Qkan3GeriME3ZqYmnwnueQZrboTet981XuH8UFzT8lROScWb95RbehQndKgJckjvQSvkD0kuP1TmHgTne+tNYirgYUskEvhXoasnFD6toDfo3NFuH7QrP+mwlUykTvF/d/Mb1R7rqc0/6ZY5vn9pvwA/qJwSuZBf1tjIBXHZwtsJe7RTjSiRP54cIBrt0ZC7wZauNpwdPrpQ+qTOJy+susNNeWArOL5mjY3IWgJq5VsnbW3BRY9yrvFiFoYSzBudc1Sd5+trDw+6hNw8FCDEJXdC25Z2Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN0PR12MB5762.namprd12.prod.outlook.com (2603:10b6:208:375::12) by SA0PR12MB4574.namprd12.prod.outlook.com (2603:10b6:806:94::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 16:43:57 +0000 Received: from MN0PR12MB5762.namprd12.prod.outlook.com ([fe80::6fa0:875c:39b1:1960]) by MN0PR12MB5762.namprd12.prod.outlook.com ([fe80::6fa0:875c:39b1:1960%9]) with mapi id 15.20.6043.038; Tue, 31 Jan 2023 16:43:57 +0000 Message-ID: <0ef7b7be-4132-669a-448d-ce7c9f198d57@nvidia.com> Date: Tue, 31 Jan 2023 10:43:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 4/5] genirq: Use the common function irq_expand_nr_irqs() Content-Language: en-US To: Thomas Gleixner , Marc Zyngier , Michael Walle Cc: Sebastian Andrzej Siewior , Hans de Goede , Wolfram Sang , linux-kernel@vger.kernel.org References: <20230130005725.3517597-1-sdonthineni@nvidia.com> <20230130005725.3517597-5-sdonthineni@nvidia.com> <87h6w711yc.ffs@tglx> From: Shanker Donthineni In-Reply-To: <87h6w711yc.ffs@tglx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA1P222CA0033.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::6) To MN0PR12MB5762.namprd12.prod.outlook.com (2603:10b6:208:375::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB5762:EE_|SA0PR12MB4574:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fb79d9d-e434-4972-d84b-08db03aa58fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EEpaAgS9gz7u+VbvvhrNeag/5H3yQxUYtdPIYMmuQIvP39st4rSGgzwVvq5LnKZ2QD9mDupU/iASGWnYykZOuJ+BLk1HQsyEBLQq5iEH97ExMjvUA0rbB8T+pNvVlGJhyEKUultBwV23YzifjDy0DoQ3i4m5Yd7nxu3QemaeP7EzgrCpP+OdVXY+Aa1siHZj0uZat7XhrBms4jMWAbYkZzehipW/OQi3l3+X0p4JlAaXoXT4juT7JDDxNfzN5q0ERXJfdwTE3nz3JuKVsnw14joBU5ikjP+03tKkWaq2Mw+rt17T6k7yYS//cQnmuoJX6+TtcaLiTre4duC+XodO5aedE9PlWSLZDV7eL8nJXI8RyLr42wuGTFysH2M4sDpu7rS71an9ikr6ei6rcjwO0yUfNIGKiF8UQOBnjcE+r91zDjne0//RHL3WMA/Jkes0X89c6xec8F8T9SkDo/yh0nHC1LVhk0YhRkg8oDo6tXOsrCUarzPkk7dGIkN5W2FIEdv7W1X9pyASDzmGU4okz3GmswvxkELdpfWoOatbdF9OLFmdWsOkZUwB08mNsdxWAehIzIpSmtq4C7cwHamTNqCq+dduFx0RwN37qnY0AqIgXXkRIDlm2TqJTegUVjnDyGWmgs34FPTgUonXV06sZgzLFaVvG9mL7+4wgrqhz/yXUeL69heUyFKyD+UzvkqTGgqoFE8+89kO0PISRTeE9x+IxCTyvIWPZaof/KH1/WY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB5762.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(39860400002)(136003)(346002)(376002)(366004)(451199018)(110136005)(54906003)(41300700001)(8936002)(6506007)(66946007)(66476007)(8676002)(4326008)(316002)(66556008)(26005)(186003)(478600001)(6512007)(53546011)(2616005)(6486002)(86362001)(31696002)(5660300002)(36756003)(38100700002)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?O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LanRaY213SjFqeWNpeHRqQUl6WlNrWGpEb1N4Z0hE?= =?utf-8?B?aWd6MVhVRFM1YWM5WFhJdTBsSDEyWnBnZ1lVcUtrRm5Iai9xREM0UEhwblNW?= =?utf-8?B?UzFoR2c1TkZkWGVlSnQxQkVGaHNzVlErM1VYQ1JzNTIwMGNqMzRpUUZPN05u?= =?utf-8?B?QjJqdWJCcXJIMFhMaUNpY0w4VzhtajBVb1dPTERJa2tUeVVtTm93dUdRNlYr?= =?utf-8?B?S3ZQTWxRRlZRMVdJcTJXbytvanZTeldJM0RFd1h5U0hZU3dZc29PN2JBaklh?= =?utf-8?B?MDZ5TlZUWjZqM1M4cjEzUmQ4V2VnSlY1QjdsVGFUY2JlUTRTZ2dnUExBTU5V?= =?utf-8?B?Q25VbjEwM3FRU29ZQmJqNVNzNGZJWVBUWEFiL0ZXTUt1NlV0dHg1WlJmaEtW?= =?utf-8?B?TVE9PQ==?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb79d9d-e434-4972-d84b-08db03aa58fd X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB5762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 16:43:57.7442 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k/QvzuIBpTykLvAxRWeeuiI2ug+yg50kwkKf02j3s8VwPKSma0BYNFPNYuI12DdPVNmyWqwt0tpaz449xhT+JA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4574 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/31/23 03:35, Thomas Gleixner wrote: > External email: Use caution opening links or attachments > > > On Sun, Jan 29 2023 at 18:57, Shanker Donthineni wrote: > >> Subject: genirq: Use the common function ... > > genirq: Unify irq_expand_nr_irqs() > > irq_expand_nr_irqs() is implemented as a stub function for !SPARSEIRQ > builds. That's not necessary as the SPARSEIRQ version returns -ENOMEM > correctly even for the !SPARSEIRQ case as the .... > > > But this common function is non-obvious for the !SPARSEIRQ case. It at > least needs a comment > >> +static int irq_expand_nr_irqs(unsigned int nr) >> +{ >> + if (nr > MAX_SPARSE_IRQS) >> + return -ENOMEM; >> + nr_irqs = nr; >> + return 0; >> +} > > or preferrably something like this: > > if (!IS_ENABLED(CONFIG_SPARSEIRQ) || nr > MAX_SPARSE_IRQS) > return -ENOMEM; > > which makes it entirely clear and also allows the compiler to optimize > is down to a 'return -ENOMEM'. > I'll drop this patch since you're suggesting to remove !SPARSEIRQ support.