Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1948916rdb; Tue, 5 Sep 2023 09:34:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkQ9lWmajXbWZM8n5Msz3RoMbfRAqMdDbNVwQ8SuTjdFth163SDcKPvGPPxHJ6f7Z0v1An X-Received: by 2002:a05:6a20:8e1f:b0:14c:e1ee:7608 with SMTP id y31-20020a056a208e1f00b0014ce1ee7608mr18523989pzj.9.1693931679717; Tue, 05 Sep 2023 09:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693931679; cv=none; d=google.com; s=arc-20160816; b=Lmjqv0Jq99lGEJ4baK/OFOBVLwGxzIMWcJwZOXzHGcjSakp5bV0yB/Wb4wzrt2ZKmR avBH7c18QFbI3LVFgDm2ue/aDZj29fjLNKu9kS7AMi7LCJlJXicnRgOm37AOlD+AfIpj f7a9oljsbsCkGGM5eHzi9y6TkFdF3oGr6VzaLUvWolErveVvjqOkrgmuGQYgcuDh7RCL rxawk/mLG1VLliHrrhqXk4PO5MWXpqtFSSf+WUSYolZ+pt18hMil5nhRo56sREHLu1aM VR7VJktY+bDlJ3ObYUg86fVdObgwZO1wOVM7MguJRt++cqHqnY5pDcfy5s8MQlyqgQDT nFag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=B5xttubAjfpVJ9TlFf8lBuiXqsHl4DTS+lc+fVwUflM=; fh=Uyg1xVbYgfsTwRa9bHlGfQbylZV4WKs5st8vFvG1rPo=; b=PhzY+UFQ4QyqMdwklUlFs59rwYFVT8Qw9hZF3EYj7dJSa9mU9Hd0btXZGOZ7tBOmv7 FLThju9vjZXxKvWh7h3syHL/Gud2yOA1zgT6FubSAC2wg8ul27ASAQRAA/vcDkXra+7n L81Hejf/qrw58w9D+EDOrLCv68/YoefgefjPC7IUJkodqm6JtQPcFmyT2N3crXCr8BK7 dC+ugJNFQdrPGTbfBltNXLeQt9z+RRbil1WPj2SEoXCtGwnj6AMY0xQWVL1xEPp05Lv0 xFRhcZuGOY1vDyP+80FwioYM+mbVez9mp6gKhhDTYjGuoBBJsFebDXLfwXaP+xrC63sl GHOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a656445000000b00563e15edb8fsi9632026pgv.544.2023.09.05.09.34.31; Tue, 05 Sep 2023 09:34:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbjIEQBi (ORCPT + 53 others); Tue, 5 Sep 2023 12:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244934AbjIEBhv (ORCPT ); Mon, 4 Sep 2023 21:37:51 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12117CC8; Mon, 4 Sep 2023 18:37:47 -0700 (PDT) Received: from [IPV6:2001:250:4000:5122:7a94:e7cc:c027:4d89] ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=PLAIN bits=0) by mx1.hust.edu.cn with ESMTP id 3851awA0021528-3851awA1021528 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 5 Sep 2023 09:37:00 +0800 Message-ID: <3cec1ac9-5cbf-648c-69ca-12e757bb7617@hust.edu.cn> Date: Tue, 5 Sep 2023 09:36:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH] ath9k: unify error handling code in ath9k_hif_usb_resume To: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , Kalle Valo Cc: hust-os-kernel-patches@googlegroups.com, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230903123230.2116129-1-dzm91@hust.edu.cn> <87v8cqs165.fsf@toke.dk> Content-Language: en-US From: Dongliang Mu In-Reply-To: <87v8cqs165.fsf@toke.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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-wireless@vger.kernel.org On 9/4/23 18:06, Toke Høiland-Jørgensen wrote: > Dongliang Mu writes: > >> In ath9k_hif_usb_resume, the error handling code calls >> ath9k_hif_usb_dealloc_urbs twice in different paths. >> >> To unify the error handling code, we replace one error handling path >> with a goto statement. >> >> Note that this patch does not incur any functionability change. >> >> Signed-off-by: Dongliang Mu > Hmm, if you're cleaning up that function, how about changing that else > to an early error return? I.e. change the if at the top to: > > if (!(hif_dev->flags & HIF_USB_READY)) { > ret = -EIO; > goto fail_resume; > } > > and drop one level of indentation from what is currently in the top > branch of the if statement. Yeah, this is more elegant. I've sent a patch v2. Dongliang Mu > > Also, while you're at it, please reorder the variable declarations at > the top of the function to be reverse x-mas tree order (moving the 'int > ret' declaration to the bottom). > > -Toke