Received: by 10.223.164.202 with SMTP id h10csp2903816wrb; Fri, 24 Nov 2017 20:51:39 -0800 (PST) X-Google-Smtp-Source: AGs4zMZouuHLyI4cTjk1MLhOu2uc89S6R1hra+wJNL9nbEBqIpVgHqoNfQCwTqcyFcxsry1lfADV X-Received: by 10.84.160.233 with SMTP id v38mr8038196plg.179.1511585499715; Fri, 24 Nov 2017 20:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511585499; cv=none; d=google.com; s=arc-20160816; b=zXDdihpom7zZAvnRkh6K3vJPQmVtYo20vMxN6hI4fVxpLzZNWWV37InNVNI62/UY71 y67vsCJ+oaornhT1tjK5+opOCupve6BhKv3TkI5l186+XQ5kbbpsBHcTLjXR9MfP2YEu RWcBdOVRFGUVIATCoJJ80/abiJhuZ9lZd95/kArDgWIr72XNy/D2J3Lh4U0SiWq7aaEU 6r7m9KjS3Rbba4rcbD0qr5Lg8fuFAvOM32t0dmVPNw63a9/0bTbJBsMerEPuBKO69AbQ xJYhkteKtPO2vTs6FK7J9DhmX3KunhE8iIWi+3VsFEPMUEbxsyb9xZXgx+Be2Hy01gVJ WRYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ahQUMV+kDIg0DSYEzsf1mBy3XjMwoIiLzJBeBVGY/5M=; b=XEAjqDRRJf5qaRaUjumk0ta6m6ssggqRXQdmXJtHClyNx8wfzPZiRO3ydSfSgK17wS NCK/CImSflV1d2Jv1UDsUcqJ3RZFNzaZ/UIDl+2v7iL2i6qQBuBhgIQwKok50f22xJVz iw1NISraEGnQZGvQG058C4/60SZ6l1aNRfXwugV4fndDlpVV7i31hD+G1yn4QWeTFbPt FdWWX4a+DK7ld77+EYWf8zBEVJuRqncwu0mIsXpIxgEr7PdgJNOHhViu5oyw3VUXOjtS wLoLj1icO3uKibbYYgeXohYfdHxrELd+ODSJPe/rrShXH8nr5MVNN+/0CV2ZONsA0PYz JWAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ARKCrsD2; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si20170662plq.609.2017.11.24.20.51.26; Fri, 24 Nov 2017 20:51:39 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=ARKCrsD2; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750880AbdKYEun (ORCPT + 77 others); Fri, 24 Nov 2017 23:50:43 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33458 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbdKYEul (ORCPT ); Fri, 24 Nov 2017 23:50:41 -0500 Received: by mail-pg0-f67.google.com with SMTP id s75so16462902pgs.0; Fri, 24 Nov 2017 20:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ahQUMV+kDIg0DSYEzsf1mBy3XjMwoIiLzJBeBVGY/5M=; b=ARKCrsD2nyhogCuz8eOLVaK5htS3PTI360wgpjUeueC57trbEBxrc9+fWW9Kc0Hdz+ x7dy6rjtPkhVAgWY1i+h/PXcaJzH+ZgD9MjgHUy08GRpmmJ5n0fkOAw3664ovdMx1JFs XzZZwUuNo3poq9B5UxZA+M8r2rJrfzCdTlbXyUu3oWueo3J36vr4T2bAgXE3nPMqX3E2 sWjI44U7EcSDiWTijib5IXUByNDBsGfg6HYOckbdZT3qMllNR2Vb62zkBOp7TyT0Ez1A gaS/+TpsRsZe+0yytXxN6m/mw9P6+HZaYwZyONRDiwB9amlhm5qKF1ERg1n0F19NYrBF xvoA== 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; bh=ahQUMV+kDIg0DSYEzsf1mBy3XjMwoIiLzJBeBVGY/5M=; b=iFzUNR60S7g9aL45gXJI8fu4r8sJUs2XSLQl+IBI8nVQJbte83SBNxCkyov0DD+vLj u7MDEmMUb69US+DAOTzd6P3aru3edi6qrlRVjU7NXrNkC0HoNiEHdjvirqqOyXWYTmXa MuylXT12eme7DVNkX7/kVCuHvYbjDZXr9A+n9YCWUAmeO+NWiZnhSzPkNXORvbCUpScn tW/pBNKUmHtbuZ7lhWbPLEFpkwT8HUhKgddQdKBR8VwZt2doxEL0JnUsMqTkg9MjsBRK kalPkxMbAGuUaNCnkXMQQFxwUeLgW+JdxKb276AM1kLV7kc+UQUApS6dJa8benoq5iUK iUJg== X-Gm-Message-State: AJaThX7Sd3ePkBIBXDT1tQzGyswrBW7vRtmBWGOT1QEoWx88VjSUzZSx yunTa9PfldE5Sjc/rtrtEzU= X-Received: by 10.101.96.213 with SMTP id r21mr23312676pgv.395.1511585441285; Fri, 24 Nov 2017 20:50:41 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id e3sm11365263pfe.92.2017.11.24.20.50.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Nov 2017 20:50:40 -0800 (PST) From: Arvind Yadav To: b.zolnierkie@samsung.com, tj@kernel.org, joe@perches.com Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Subject: [PATCH v2] pata_pdc2027x: Remove unnecessary error check and coding style error. Date: Sat, 25 Nov 2017 10:20:29 +0530 Message-Id: <5d7dd8491f0483a93952f26ed557f107c92e006e.1511585163.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here, The function pdc_hardware_init always return zero. So it is not necessary to check its return value. So make the function return void. Fix these checkpatch.pl error: ERROR: space prohibited after that '~' (ctx:WxW) + mask &= ~ (1 << (6 + ATA_SHIFT_UDMA)); ERROR: spaces required around that '?' (ctx:VxW) + long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ; ERROR: that open brace { should be on the previous line + const struct ata_port_info *ppi[] = + { &pdc2027x_port_info[board_idx], NULL }; Signed-off-by: Arvind Yadav --- changes in v2 : Make function return type 'void' instead of 'int. Add sapce between ':'. drivers/ata/pata_pdc2027x.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c index ffd8d33..d1e8b63 100644 --- a/drivers/ata/pata_pdc2027x.c +++ b/drivers/ata/pata_pdc2027x.c @@ -277,7 +277,7 @@ static unsigned long pdc2027x_mode_filter(struct ata_device *adev, unsigned long ATA_ID_PROD_LEN + 1); /* If the master is a maxtor in UDMA6 then the slave should not use UDMA 6 */ if (strstr(model_num, "Maxtor") == NULL && pair->dma_mode == XFER_UDMA_6) - mask &= ~ (1 << (6 + ATA_SHIFT_UDMA)); + mask &= ~(1 << (6 + ATA_SHIFT_UDMA)); return mask; } @@ -520,7 +520,7 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int b void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR]; u16 pll_ctl; long pll_clock_khz = pll_clock / 1000; - long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ; + long pout_required = board_idx ? PDC_133_MHZ : PDC_100_MHZ; long ratio = pout_required / pll_clock_khz; int F, R; @@ -649,7 +649,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host) * @host: target ATA host * @board_idx: board identifier */ -static int pdc_hardware_init(struct ata_host *host, unsigned int board_idx) +static void pdc_hardware_init(struct ata_host *host, unsigned int board_idx) { long pll_clock; @@ -665,8 +665,6 @@ static int pdc_hardware_init(struct ata_host *host, unsigned int board_idx) /* Adjust PLL control register */ pdc_adjust_pll(host, pll_clock, board_idx); - - return 0; } /** @@ -707,8 +705,8 @@ static int pdc2027x_init_one(struct pci_dev *pdev, static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 }; static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 }; unsigned int board_idx = (unsigned int) ent->driver_data; - const struct ata_port_info *ppi[] = - { &pdc2027x_port_info[board_idx], NULL }; + const struct ata_port_info *ppi[] = { + &pdc2027x_port_info[board_idx], NULL }; struct ata_host *host; void __iomem *mmio_base; int i, rc; @@ -753,8 +751,7 @@ static int pdc2027x_init_one(struct pci_dev *pdev, //pci_enable_intx(pdev); /* initialize adapter */ - if (pdc_hardware_init(host, board_idx) != 0) - return -EIO; + pdc_hardware_init(host, board_idx); pci_set_master(pdev); return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, @@ -778,8 +775,7 @@ static int pdc2027x_reinit_one(struct pci_dev *pdev) else board_idx = PDC_UDMA_133; - if (pdc_hardware_init(host, board_idx)) - return -EIO; + pdc_hardware_init(host, board_idx); ata_host_resume(host); return 0; -- 2.7.4 From 1584962079579995499@xxx Fri Nov 24 15:33:47 +0000 2017 X-GM-THRID: 1584962079579995499 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread