Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1437917lqj; Tue, 4 Jun 2024 01:10:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvrZKKkE1e2houITrYNY/1isqunZcOHNNIqmQ/PJNzpI9rKXTuVbrP0ziKDP3isZr+x/4RHziywBBuwf9F6/WCRg4vWwBGgzyOhn8ZGg== X-Google-Smtp-Source: AGHT+IGivkiN7e/Ifr6AsUWmZsarL80XIF1A0iK6P0jQ3GtxvQwzJQ5cLHrCZgoYq/u2DxPFgRai X-Received: by 2002:a05:6214:4907:b0:6ab:9884:1a82 with SMTP id 6a1803df08f44-6aecd6cee0amr115406766d6.51.1717488621816; Tue, 04 Jun 2024 01:10:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717488621; cv=pass; d=google.com; s=arc-20160816; b=s3gnk/jqqizmIGlcb9vU+MCAA4IhzP6P+kM1kbzYc1rPoP8ZrgbOhQefhCLABZP7Yv GRgko5X5PvUNBPe5IKrH04ynzKPRe0pnGcGpn0y8dyWVBgCoQ/iWrxHMjkGKEhd5nvl6 KiX0OeQPqdG0TndqACa37CBpYiDywh6U8sC0BdLcs4c8SfYj9w2LTYHE1WDLvxUz76A6 mBX/l7Fdbkf0q4nEIqXZrN2f9tQw/mKvD8RnxAoPO6RZGUi9KoACK0EPpk+h0OKQioc5 6t/0pVa4gBXCfYprG7JepxtmyAJDSwtV4x/wMxSIkv5IovTRa7R5AxLz8r52OyuUZdtT WSRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=joUjHrBsaFyy/RIvIFrzc8OTrbsgtRmsQsRoilHzhuY=; fh=fip8QCni6mELf/B4YWXKkGZhc2jaQYUntzphMnxx+pw=; b=wU/Bqn6GW19NA5/gLLNfF0irCeQho9psASujRe106x4MYPxGMl5Uim2Fa3MtpA5H7W XE5alMu7zK9QIO/+irNrJqG/H1+RYjv1GSiDff2wYKtwRxewswhHwGu0LDu2KFjJY5eu DFHYPXlbEJYBqfvR2Veh6ZN4pGS1sM12SBvBvPo0jB5PZbh00TEpz7ZzUq4hDhNfOiud jZEeZfNgqDrW4toV5/L5YPxL/VgdqynP1xSS6qZ0cI6PAgx0DZaobepVVhZVF3QbxyH7 YvBfxrrWUBW4bPBDLKmQXg3bzfS7q9C3NOvtT8ryfu41+0bg2LDesu4/ALAD4uxwwnGs q7IA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-200221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200221-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4a732e15si108104446d6.100.2024.06.04.01.10.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 01:10:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-200221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200221-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4FC8E1C21212 for ; Tue, 4 Jun 2024 08:10:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA3C41420D1; Tue, 4 Jun 2024 08:10:03 +0000 (UTC) Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 0B0BF446CF for ; Tue, 4 Jun 2024 08:09:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=42.101.60.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717488603; cv=none; b=RVoR2dYAyAiV3ixDZT1xOK3g+I3oDk+2/wh5JoaZZFME4JfK3s7n/5bUtu7V+BvSWvyXorwwGCftKMPXDyUHg0BRsU30x9Tyb5FmyEWH8gu8tldJk1sBgt63Q3dhxZK0+ijaUiZGP8QvLKGvrpgJzhALMymjUSPpF8zHsrNoqYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717488603; c=relaxed/simple; bh=+G9mKjMwEOKUczjE7ezwTf4S8G52vs1HHeC05ItUBNw=; h=From:To:Cc:Subject:Date:Message-Id; b=oct2jv38BYpuBibYnITwmtXfzAvKhrGNFZAQVZh1acqlYOuXBKgjiImKNslb9fg13P/UCa2gAvvxy3JqYVqZjtNm/cFGTi8auulU3ukGUAuGuuPLlhcGhmvWHD/iaG7TpjuAw8KEogjyo48rQmaBFyq4Sei5tRrq3ITWMeyMaXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com; spf=pass smtp.mailfrom=nfschina.com; arc=none smtp.client-ip=42.101.60.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 25BA56047F7C7; Tue, 4 Jun 2024 16:09:51 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] irq: chip: Optimize the irq_set_irq_type function code Date: Tue, 4 Jun 2024 16:09:14 +0800 Message-Id: <20240604080914.38019-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Optimize the position of ret and remove initialization assignments, making the function look more aesthetically pleasing internally. Signed-off-by: Li zeming --- kernel/irq/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index dc94e0bf2c94..1ce3d29abc90 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -64,9 +64,9 @@ EXPORT_SYMBOL(irq_set_chip); */ int irq_set_irq_type(unsigned int irq, unsigned int type) { + int ret; unsigned long flags; struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); - int ret = 0; if (!desc) return -EINVAL; -- 2.18.2