Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8026718ybi; Thu, 6 Jun 2019 05:36:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKJFLEAWbKlE+QFhUaqpXySG+ETBF27QcC3rqLjQuFmkbSzv72tiOrMS48cUEBE5rFbHcJ X-Received: by 2002:a63:140c:: with SMTP id u12mr3189921pgl.378.1559824607772; Thu, 06 Jun 2019 05:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559824607; cv=none; d=google.com; s=arc-20160816; b=V15z3O/dR/87jdek3vEe2eHw2/42I3z0+tTigVEoYFtazKNQxcAqdRO1RRn7iU21Sg ByIC0YxeYLj5PsBB2UoL3/fBqgJaVK2tPBUmHlg6M72RZ3npqkL2Vgf0nM4dSkr+FZ/B L8hzx3ySiCaditg9+yP5EM4A4zuVLGKfl9CgiOuyRm7Ji1LnndjKTEWWydpXooBAXRxB 122b1d5OA4Tp5C2Q4ww5xAdGroB8gPxl4M5WgSMk+edEj9TAefRfq9h/pYtX7Hn8YwjU G1PlUzij7Z57/wZ6VFg4tonGtBzCoaOAZk10vTKBVbpfRWQVg2I+XV9gJqpM9s4Wyt4D 3OhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y2hmulEThShe7yuxn2FDcx828sdufBDLO8yrZJpI96k=; b=xrD3/ni5DNjlwn/gUAe+NkNT/4hTMEL25kdw9sk8fdcmgJ+vsKoszeV/F2QbvTPhzg WG/0PIMXaXTpU8N1lHCEYICZr5BTaUJZUQhLUtcfPelhnoaANPh34iQKsUb4wMCH8hn7 eVK2Ctw6Z6d/OKw+VM/WtNQbwNLyiHURL10ktBviCxzC+OROC6Eb+jyp8iHz58NYb/WH Mxrx1b/5fZpiNTI8QTMxMyif6hTeN1JumIth05BnhzeRbbV9dzrVeHg5IFzPBs2FTc3D Wat9iHjK1kwzfUUdpH8hDccLrnxGcjA8uEdlYp6uWfdAkPQ+MDXQ9FxYcsMkfFqE0EdZ l8EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=C9+6sUZf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si2005343pgq.187.2019.06.06.05.36.30; Thu, 06 Jun 2019 05:36:47 -0700 (PDT) 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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=C9+6sUZf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727551AbfFFLfL (ORCPT + 99 others); Thu, 6 Jun 2019 07:35:11 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:51826 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbfFFLfK (ORCPT ); Thu, 6 Jun 2019 07:35:10 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x56BSh8h146272; Thu, 6 Jun 2019 11:35:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=corp-2018-07-02; bh=Y2hmulEThShe7yuxn2FDcx828sdufBDLO8yrZJpI96k=; b=C9+6sUZfQ7+PaLFXKvcdZ8fP5unf0Hvhk3clst84/Vly+0WEaLItmHwPhVfCpChOcBdn 4VHiUXttyiNBfLzvvATxJcIs8G1HQYYUBfcvDmxUEWk2dkY9TsHIuOu4mG9xjvB2GQkA kVhHh9qgnrHRNTyg3LbJm3qzUEs2l8ifYAVLPc3ijyo/ohRNs9NIp/Ddj8RVPje3F4TS 3qEuBqc2x68nlk+I3VW8LFL39mjIOl3qQdpq2iigQYRlJ+byAOQjIjh3315kC5QXvBBE 34GM5dtWdpIlZxhZci4c3NFhE3pIp1aFGYPLiRcAeA1N0jm2H6gH66iftvEt9PcOBvCZ wQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2suj0qqrgc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2019 11:35:05 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x56BZ5hs155775; Thu, 6 Jun 2019 11:35:05 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2swngmf4a5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2019 11:35:05 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x56BZ2dK028471; Thu, 6 Jun 2019 11:35:03 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 06 Jun 2019 04:35:02 -0700 Date: Thu, 6 Jun 2019 14:34:55 +0300 From: Dan Carpenter To: Simon =?iso-8859-1?Q?Sandstr=F6m?= Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 7/7] staging: kpc2000: fix incorrect code comment in core.c Message-ID: <20190606113455.GM31203@kadam> References: <20190603222916.20698-1-simon@nikanor.nu> <20190603222916.20698-8-simon@nikanor.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190603222916.20698-8-simon@nikanor.nu> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9279 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906060085 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9279 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906060085 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 04, 2019 at 12:29:16AM +0200, Simon Sandstr?m wrote: > Step 11 was removed from kp2000_pcie_probe in a previous commit but the > comment was not changed to reflect this, so do it now. > > Signed-off-by: Simon Sandstr?m > --- > drivers/staging/kpc2000/kpc2000/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/kpc2000/kpc2000/core.c b/drivers/staging/kpc2000/kpc2000/core.c > index 2d8d188624f7..cd3876f1ce17 100644 > --- a/drivers/staging/kpc2000/kpc2000/core.c > +++ b/drivers/staging/kpc2000/kpc2000/core.c > @@ -501,7 +501,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, > goto out10; > > /* > - * Step 12: Enable IRQs in HW > + * Step 11: Enable IRQs in HW I don't have a problem with this patch but for the future these numbers don't add any value. And the numbered out labels are sort of ugly. The label name should say what the label does just like a function name says what the function does. Really a lot of these comments in the probe function are very obvious and don't add information (delete them). 491 /* 492 * Step 9: Setup sysfs attributes 493 */ 494 err = sysfs_create_files(&(pdev->dev.kobj), kp_attr_list); The comment is probably less informative than the code. 495 if (err) { 496 dev_err(&pdev->dev, "Failed to add sysfs files: %d\n", err); 497 goto out9; What does goto out9 do? 498 } 499 500 /* 501 * Step 10: Probe cores 502 */ 503 err = kp2000_probe_cores(pcard); 504 if (err) 505 goto out10; Hopefully, goto out10 deletes the sysfs files but we don't know because the label doesn't give any clues away. We have to search for it and then come back. 506 507 /* 508 * Step 12: Enable IRQs in HW 509 */ 510 writel(KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE, 511 pcard->dma_common_regs); 512 513 dev_dbg(&pcard->pdev->dev, "kp2000_pcie_probe() complete!\n"); 514 mutex_unlock(&pcard->sem); 515 return 0; 516 517 out10: err_remove_sysfs: 518 sysfs_remove_files(&(pdev->dev.kobj), kp_attr_list); 519 out9: err_free_irq: 520 free_irq(pcard->pdev->irq, pcard); 521 out8b: err_disable_msi: 522 pci_disable_msi(pcard->pdev); 523 out8a: 524 out7: 525 out6: err_unmap_dma: 526 iounmap(pcard->dma_bar_base); 527 pci_release_region(pdev, DMA_BAR); 528 pcard->dma_bar_base = NULL; 529 out5: err_unmap_regs: 530 iounmap(pcard->regs_bar_base); 531 pci_release_region(pdev, REG_BAR); 532 pcard->regs_bar_base = NULL; Something like that is way more useful because then you don't have to scroll back and forth because new the label names are useful. regards, dan carpenter