Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5936479ybi; Wed, 12 Jun 2019 11:01:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3aEym4qU94O0BbfNBBYbkB6y5Zzmk1jH6IKQ60ScCfp7As777IUMMF4V8+a/FsOynMWUS X-Received: by 2002:aa7:8052:: with SMTP id y18mr55982178pfm.169.1560362469559; Wed, 12 Jun 2019 11:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362469; cv=none; d=google.com; s=arc-20160816; b=StoVFgoFqeELhjjsGWmRV1hD7hglKITcxGJrRNu1hJkL1K5bZtc91CsqmH2WuCE/xz irjZLtDwQ75SxZH1xsaXhjwW7RTyxot2enBnKtoR+oAD/goOpvk50RfVArUeDtDSwnE3 oxbdWUTTRRcAJ7mLeRag91ViY462vLJfY+HJw56WZ2inICXLK1Vh63CvyBtNqms28pvF 6TYGZu8s345d67UkCyEf0R2kOw8Hc/LDp7tecMrKQtaU5YdDJ/0y0wqVA639zoBEqQWA z8xwoRFW/13p0vXLPK76g3VAzh9uIY+ifieoyJ5g2vHq16J6QbHPTxu5K0gP4MNyCack 9x8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3VrHMiNNbPTpWcXJEeQwNkvaq+Iwwq0qawqb4RHXlZg=; b=tf+nGIiLI50vgvsp8QOvIR/XA/Cdgv7sPx+W6Akxx8PAGXl1itdLbdVcFOsfq66f6o YrPF5GeWUqUYaWfr85nUC+/Zmoqcp2lGiW5LemWyOFCtUN7Yewal0lheyKd61N28c9SA 7OpHmBZGn8xiDTOQdv0kKlt3je5JXXI15I62zPPN1hr69OdywC91crZNwCn/RPZ4AHNw DSHtM3CaC8nCbvSuJoqC89EPuqEsIZFgIenCxgMB2k34PCXECDi/PkW4qB33mP5UM9td vvx8Hi+eO60z5pxE2paDis2E5TTNv93+IPWPAMLs11RhEAfix/EbwVRe6HJhoZCTKYuz pf/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nikanor-nu.20150623.gappssmtp.com header.s=20150623 header.b=VEZqKjqw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si409381pgm.443.2019.06.12.11.00.54; Wed, 12 Jun 2019 11:01:09 -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=@nikanor-nu.20150623.gappssmtp.com header.s=20150623 header.b=VEZqKjqw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439509AbfFLN6z (ORCPT + 99 others); Wed, 12 Jun 2019 09:58:55 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46690 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437126AbfFLN6u (ORCPT ); Wed, 12 Jun 2019 09:58:50 -0400 Received: by mail-lf1-f66.google.com with SMTP id z15so9504616lfh.13 for ; Wed, 12 Jun 2019 06:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikanor-nu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3VrHMiNNbPTpWcXJEeQwNkvaq+Iwwq0qawqb4RHXlZg=; b=VEZqKjqwL6+iGHJMAO9xlj3d1SX01w/7pyFL9dXh8yuSKwAUYA37V51u/JS7ckbvMn eD/8yWhCsa2aQga2YnMxNvYlPMtH5otRHbBCy1h5zzF0Kmr8ONEx5w6sESk/AhoPdbiB dyWTPncbg48IX7710iugaLLcuBMPDaK0X7utC1sNJc2S/7V+FSpjBpEsF+K+gL0s70yv BzturJ1jvXB35VGtNQMFuKq1X9F+EhgpldO8dF5ZCgVwKPBArP0kHMuXUAmm0yzZgNgH 8Kkku8YrFVIGbxkvaQfDm4uQ3HvssFNHU2B5TFTsEtE8q3bLulTUxZ8COEN51yBqc2HF bGHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3VrHMiNNbPTpWcXJEeQwNkvaq+Iwwq0qawqb4RHXlZg=; b=T28qCOVi5fRMizTE9EkM6zeGKc/YbF41Un/jluA9bUl2VKnSIJJIhNP42qu1JDTEuU of7xxIqQgwHFlxnhqQOj3uJmJ+l29nOvYDbdMjkkX6wQe16uP4d7B6N6Z3Gcx4lmr5e7 OQ0mAx/0+DmnGe/0N4Whs+JybWh9t9wKVaJDx4tSQFz9SoHT5T7YEwv8lFs2nNj3Y4k0 sAfhKVUWJnYKCH43TNCrQLBl6eiw6tRFgiCNgZwT/IlYsPRWq614DPWApdEQ4HabPMwZ psJtW6rsRrjKt3O7ew6Q/RdfUgsyBw+tLOhndi7NfvBo41IfpjkctSBg4Dk7ZE3CSybo 3xKg== X-Gm-Message-State: APjAAAVch8bMMz7Ot+8+aT90hpyesm4c9HB+yW1QN66EGBUh2oGWDcAy yEanHExLg1g6PewGRe2UpXfMJg== X-Received: by 2002:a05:6512:4c5:: with SMTP id w5mr2277429lfq.171.1560347928315; Wed, 12 Jun 2019 06:58:48 -0700 (PDT) Received: from dev.nikanor.nu (78-72-133-4-no161.tbcn.telia.com. [78.72.133.4]) by smtp.gmail.com with ESMTPSA id x194sm2621999lfa.64.2019.06.12.06.58.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 12 Jun 2019 06:58:47 -0700 (PDT) From: =?UTF-8?q?Simon=20Sandstr=C3=B6m?= To: gregkh@linuxfoundation.org Cc: simon@nikanor.nu, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] staging: kpc2000: remove unnecessary comments in kp2000_pcie_probe Date: Wed, 12 Jun 2019 15:58:36 +0200 Message-Id: <20190612135836.23009-3-simon@nikanor.nu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190610200535.31820-1-simon@nikanor.nu> References: <20190610200535.31820-1-simon@nikanor.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Much of the code comments in kp2000_pcie_probe just repeats the code and does not add any additional information. Delete them and make sure that comments still left in the function all use the same style. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc2000/core.c | 38 ++++---------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000/core.c b/drivers/staging/kpc2000/kpc2000/core.c index ee6b9be7127d..6a5999e8ff4e 100644 --- a/drivers/staging/kpc2000/kpc2000/core.c +++ b/drivers/staging/kpc2000/kpc2000/core.c @@ -311,18 +311,12 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, unsigned long dma_bar_phys_len; u16 regval; - /* - * Step 1: Allocate a struct for the pcard - */ pcard = kzalloc(sizeof(*pcard), GFP_KERNEL); if (!pcard) return -ENOMEM; dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n", pcard); - /* - * Step 2: Initialize trivial pcard elements - */ err = ida_simple_get(&card_num_ida, 1, INT_MAX, GFP_KERNEL); if (err < 0) { dev_err(&pdev->dev, "probe: failed to get card number (%d)\n", @@ -338,9 +332,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, pcard->pdev = pdev; pci_set_drvdata(pdev, pcard); - /* - * Step 3: Enable PCI device - */ err = pci_enable_device(pcard->pdev); if (err) { dev_err(&pcard->pdev->dev, @@ -349,9 +340,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, goto err_remove_ida; } - /* - * Step 4: Setup the Register BAR - */ + /* Setup the Register BAR */ reg_bar_phys_addr = pci_resource_start(pcard->pdev, REG_BAR); reg_bar_phys_len = pci_resource_len(pcard->pdev, REG_BAR); @@ -381,9 +370,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, reg_bar_phys_len - 1; pcard->regs_base_resource.flags = IORESOURCE_MEM; - /* - * Step 5: Setup the DMA BAR - */ + /* Setup the DMA BAR */ dma_bar_phys_addr = pci_resource_start(pcard->pdev, DMA_BAR); dma_bar_phys_len = pci_resource_len(pcard->pdev, DMA_BAR); @@ -415,9 +402,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dma_bar_phys_len - 1; pcard->dma_base_resource.flags = IORESOURCE_MEM; - /* - * Step 6: System Regs - */ + /* Read System Regs */ pcard->sysinfo_regs_base = pcard->regs_bar_base; err = read_system_regs(pcard); if (err) @@ -427,11 +412,9 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, writeq(0xFFFFFFFFFFFFFFFF, pcard->sysinfo_regs_base + REG_INTERRUPT_MASK); - /* - * Step 7: Configure PCI thingies - */ // let the card master PCIe pci_set_master(pcard->pdev); + // enable IO and mem if not already done pci_read_config_word(pcard->pdev, PCI_COMMAND, ®val); regval |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); @@ -466,9 +449,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dev_dbg(&pcard->pdev->dev, "Using DMA mask %0llx\n", dma_get_mask(PCARD_TO_DEV(pcard))); - /* - * Step 8: Configure IRQs - */ err = pci_enable_msi(pcard->pdev); if (err < 0) goto err_unmap_dma; @@ -481,25 +461,17 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, goto err_disable_msi; } - /* - * Step 9: Setup sysfs attributes - */ err = sysfs_create_files(&pdev->dev.kobj, kp_attr_list); if (err) { dev_err(&pdev->dev, "Failed to add sysfs files: %d\n", err); goto err_free_irq; } - /* - * Step 10: Probe cores - */ err = kp2000_probe_cores(pcard); if (err) goto err_remove_sysfs; - /* - * Step 11: Enable IRQs in HW - */ + /* Enable IRQs in HW */ writel(KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE, pcard->dma_common_regs); -- 2.20.1