Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5156447rwn; Mon, 12 Sep 2022 05:22:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR51t2581wTjnixXInC7rR7kuvaYl91PCSTG2Z5+PV9VXaEF1Cshsa/IEqBoqhhLJIB20q1j X-Received: by 2002:a17:90b:1d8c:b0:202:c689:fa33 with SMTP id pf12-20020a17090b1d8c00b00202c689fa33mr6819807pjb.58.1662985373859; Mon, 12 Sep 2022 05:22:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662985373; cv=pass; d=google.com; s=arc-20160816; b=KwjR2CivT50yjTcUi1oHWtN9MzrOMwwVNuZSQFtgRQ6XuT/99yRJK4kADIes61+BHN zY3/g7GnNUNGTdG4yFrGm8vVlq9l5c9aCVrWjCihrP9fgG8hKCzrp2tmRjk1Jwf1fZ8b 9PIfM7T7XyqwcFtyx7N7qFdDz7vK/T7MASiN2m3IflcFQe5GxjDobe0o7qFC/FvIRJPF b8r9ZFdAz9DMcDSwWYanA3A5GPAP4szXWNsK8P42o3j0l8OgS1OHDWaoiFKxp7Qsnm2y es1FjsxEuUlMDy8iKIfDAC6PZKab4IjsJmKz2TDa3cSp1Oj/jF3yUIWmbIK2H/LA5Khk 7oSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=QwhAhppyPMDhvZvf6Ew+xbVwUeTU2A/e6iTQtM4Rq1Q=; b=Ev4oSuKP2ZUEyy20JxJugddTyXocLHThm2v76fgFxExncC9nFMnFk8Tz7bDoGxyW/W mM3ifLijcLuZ3haDxsIBausUJnwE3eshkJbXQQk/qreeXIYofdyZzLQQ+aMh4LqVb0Qd rcSdaR8BG13PYSG9q+O4ut6qB3rnuRTTz6I2hpUJLFsQscuDVMPxxMulj0G69iPjVddX IhmJKaUUQUW30b40/7FqTTY9coawAdGMA1X7XALq1w6RLjg/EPYhypfrisDmO/Csv8Nr lfcbpgmIfhtscVwmOksUN7gj0dA5xzire4ClV+MVC6Y/3t9tyx1C44wwGHTzULZ/yvDO zyHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=G4NBw+f8; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pm5l+RO4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a17090276c400b001782bd8d032si3606634plt.523.2022.09.12.05.22.39; Mon, 12 Sep 2022 05:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=G4NBw+f8; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pm5l+RO4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbiILL1h (ORCPT + 99 others); Mon, 12 Sep 2022 07:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiILL1f (ORCPT ); Mon, 12 Sep 2022 07:27:35 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF82D23178; Mon, 12 Sep 2022 04:27:34 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28CBItZN008055; Mon, 12 Sep 2022 11:27:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2022-7-12; bh=QwhAhppyPMDhvZvf6Ew+xbVwUeTU2A/e6iTQtM4Rq1Q=; b=G4NBw+f8VDDqQ6EjyH1xRp9TQ8qBH2tpqrisJH2/L1MBJc5GCBOTyltfNFj+8VgIzj8Q JErR8EsYTsMhzCJmAKF2fyh3wxXvedIi5gnNKkqxVdqBeX99PAPGux8x51AEMbf0PwNj 7ER79FtntjB2rzPW8SYcNTGt4V1ek6YMLj4JCRoaKUIH6eHYzGM0UfpKIYiJchmmV9wA b2XETQeXKcj8E+gD3fn/0p92nVBb0ge82QvH5v0Zuv+VOx1MfNBacnmAjSN9b1Q4UXbe yPXHHHnTYPNueFoLg6eQ/9Me3GW+POA55kp3XMYItgEfTbxiFOycVjd2AoIfsACjQfbM 6A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jghc2k7ug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Sep 2022 11:27:05 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28C9rG6o029544; Mon, 12 Sep 2022 11:27:05 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jgj5awpun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Sep 2022 11:27:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=icfrVnWyl2ufSRbKVRNsGVyQl+E9eFrXV2OPHQMoqmW38dEPgwE47PnspaZYaT5eSBVvWACNVNGvmdanLtG1xFvA8U1CRnCxjNa02HLTt5ma0ITNDNbDPKf+sH4Zahf1CF8IvGYm3H3KrllIO4z2Rn32wpG8NsNRn6LqtLXp6L34WWNXPi0vTMWU/NmATjzd3RYaVSN3U+7A/58MKWkCqsLGHlLuOdZya83s9CIjVvHuHrZJBbQi8djcb5nM9VLsTqfAu6mgbMYH1GH53LaE9cSvLSbpHrswyg5GZTv6/ViYJUBWge2lSZfVwGDPsHome9mwdXlw8JJY+vyAtMHV1g== 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=QwhAhppyPMDhvZvf6Ew+xbVwUeTU2A/e6iTQtM4Rq1Q=; b=TfsqBl8MPOOy2kruDmXLN+KE4X2Vxo1Zand5tjRVEDt4KBNVckKlPo0rZyFZ3pDX6251stjBcv28LETUbQbOwmLWVaMc1qO0pNgTM7cYvYi34EVoUCpFRoXSpkAw6Tr625gzFL4/ljbLA+/lQEX/w0/KDvGogqSf+anHa5Omg4xUlz0UgwwSsgqZMrGC//wg/naiJpKXjpXE+ApCNRt0hzckXMKrITPNPqbAwScdxNLXfkK+gFMDxHXt6mQrZrvCXh8+OU1il7SxgTOTGtzM3EoU08WBG79jCN5PDwJwi+AeCzsmVsLq1YG+96+SnbxHL93OBZw1y9L7e6LAUhauJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QwhAhppyPMDhvZvf6Ew+xbVwUeTU2A/e6iTQtM4Rq1Q=; b=pm5l+RO4UCMUwdcYEtNJE3OcpCD4L3JWMBITvEM7ZvyNf/EuoudfQKNRouBbt9xOZX6MVWNFnvalYiPcbDIWHbNM9tLkBrJpPcupQmnrk2BiSl3rwnO/n23QoWQbPRx9EM2EKQ4UsjyvZTJ0tIKX7jEsacmEWvM5dKQAklZMpU8= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by MW5PR10MB5668.namprd10.prod.outlook.com (2603:10b6:303:1a3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.20; Mon, 12 Sep 2022 11:27:03 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::a493:38d9:86ee:73d6]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::a493:38d9:86ee:73d6%6]) with mapi id 15.20.5612.022; Mon, 12 Sep 2022 11:27:03 +0000 Date: Mon, 12 Sep 2022 14:26:46 +0300 From: Dan Carpenter To: Yu Zhe Cc: dinguyen@kernel.org, bp@alien8.de, mchehab@kernel.org, tony.luck@intel.com, james.morse@arm.com, rric@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, liqiong@nfschina.com Subject: Re: [PATCH] EDAC/altera: add platform_get_irq error checking Message-ID: References: <20220909053839.2293-1-yuzhe@nfschina.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909053839.2293-1-yuzhe@nfschina.com> X-ClientProxiedBy: JN2P275CA0044.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:2::32) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2365:EE_|MW5PR10MB5668:EE_ X-MS-Office365-Filtering-Correlation-Id: 811550f8-d9f7-4206-8445-08da94b1b6f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JyrA5yNLidM4Y5X34IvYYU1OoUsaF471OlPVSCD2+CIkX/mRaHPVEIXk9VBWLRnX2FPjcLkGLeL/q9hkkmYVBr6Ko2ghjOAEqr6CWUcZavFA6+WSKwlESlFwlWXeDgPIQTlyqcU6eRosgBsAl/S1I97YlLwJbX3FR0epTYekwpQ1jANpbM0YQrjBLbP1W638IesEefqoI/N10QJnrBHAlEKPvYWIxQPNzuN+PEBx85lKVR+lEmzPAz5Qp0vQta8opUBJCKdQd9vC5sy6D5HazT5JneBzwkXRbVw+b/S3ghKHLBEV8jHEXlfOo/Sohw2SNXUbdwmy80p9mBIiq0B0iYBPKnfOsSLp4NREnVMA5AwcYUUalQmv39LCKLBo57Sq30Iawe7ypWSJr+JwV2wevibTkBb/01kyVC78zaDdNA4lHALMBfkaLA1i878hMHIA4KpDywqNrlVnDCuLKF+LOxuiLJRO6BGCcN+ZZvyhYoqSRK9HZz0Wp0FrDgevBw1Lg8SS98FCu6w4QgtLhpgljqg2L3E7GQr8e6prZSXVGgZw3L9g6W2ACU1BkmiUrLfNmqm8MKyLs5j8HspJ2mLC6mq7fSzC4IPE/4bKf/jwtTQwEWX9CJofrOG9XZn4b3qIP+g4khPAoFV6o4OnpPcrgDsnNCq4tJMXUEK9b5ss0TnTLuxWMCSJP5LTJ1UB0K9AIGmbAGGvpH7J3LSnwGttIA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(376002)(39860400002)(396003)(346002)(136003)(366004)(316002)(6916009)(33716001)(8676002)(7416002)(5660300002)(38100700002)(66476007)(66946007)(4326008)(66556008)(8936002)(83380400001)(41300700001)(6486002)(478600001)(9686003)(6512007)(6666004)(6506007)(26005)(186003)(44832011)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DHxgjc8bYZ1z2tauk3iYaSVwYR25+XyahZDJtN2dCM+MgHqRdBwX3k9IIlsM?= =?us-ascii?Q?LPWoRiAu8At2aJL2i5z664elI5JYCKfWxHfCDAoKO44TQrk63EO/2o459m08?= =?us-ascii?Q?RUyyY16oDUh5qDD57S96QCH+n4KMJfn76dSQAjz/n430rLexrbm/0ldftOVU?= =?us-ascii?Q?EIMzn14mvdqg9uzYLGGESsThMb3upZ6K35kHOri1OXH3GDLXrMaMN4l+G5Zq?= =?us-ascii?Q?P0FEZ1pSb/ktEeo5pEYBcDWrUwGZrJoFO4sWWXAsrHGP/oJ81gXvJRPkj2bN?= =?us-ascii?Q?Hfd2PR7KL0P3NNQIgIS0me92YRbEexPzG/GX3f+i7oE3XBrUl/1S35oqOGuk?= =?us-ascii?Q?cxPii6OzBFitacgD1Kbwj0+cXVGS04BHtJOm1GDRoHzEZ5xKJObr/A25M5Ea?= =?us-ascii?Q?nvAXkm+pW4UMF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ascii?Q?hzUdYFOMGXl/ux1NBlT6HUawjyUrVCcBzdhayac19VseghmioN9vt5XzO2Vd?= =?us-ascii?Q?OGbaMxyIoQX/LDR2Wod0kBi7e5fAsYwI8mkCfUpF4hvIvkdx2IIqVNr+DUjp?= =?us-ascii?Q?zQaweTnf6xFAGs3XyQd/9a6Qni36omS+It194easJYyuzIdl2+sI2qqiwXvl?= =?us-ascii?Q?EP3sMSBazWXQfDxTTQwVTBRYls/mI1jCQhtssXj5DoBmuCgKLzvg5Nz7JcWk?= =?us-ascii?Q?LkElvBpxPd/VYUxVrpvNjsoWssEjdrseYNxrSeSm?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 811550f8-d9f7-4206-8445-08da94b1b6f6 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 11:27:03.0764 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JZQPXPQIysfgvSShhoRP0vkTHct0laqffnub1xasTaSkA/Co2KRUDZakIbrJq2nL0CPeCaANGqs/pmklq8sttmQbSodurn7NTI/lnoj5Ksc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR10MB5668 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-12_07,2022-09-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209120038 X-Proofpoint-ORIG-GUID: kIxxc7mxmjIw_bkOAPnX-9CYW0BdfB0o X-Proofpoint-GUID: kIxxc7mxmjIw_bkOAPnX-9CYW0BdfB0o X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 01:38:38PM +0800, Yu Zhe wrote: > The platform_get_irq() function returns negative error codes on error, > check it. > > Signed-off-by: Yu Zhe > --- > drivers/edac/altera_edac.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c > index e7e8e624a436..79c7c97c7a46 100644 > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -355,6 +355,8 @@ static int altr_sdram_probe(struct platform_device *pdev) > > /* Arria10 has a 2nd IRQ */ > irq2 = platform_get_irq(pdev, 1); > + if (irq2 < 0) > + return irq2; This will break the driver. Only certain hardware has the second IRQ. (Read the comments later in the probe). In fact, the code works fine as-is because devm_request_irq() will fail later if this IRQ is required. This code is not beautiful. It should only request the IRQ in cases where it is present, but it used to work correctly and now it will be broken. regards, dan carpenter