From patchwork Mon Jun 3 15:50:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 165630 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4645355ili; Mon, 3 Jun 2019 08:52:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkYj7e9rVabEXEpSw00vEO1vtS8DKK5SZQwHjeGRrRF4xwra5majHJwPXejuiGBh+C2RQQ X-Received: by 2002:a17:902:2a28:: with SMTP id i37mr30092332plb.52.1559577153679; Mon, 03 Jun 2019 08:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577153; cv=none; d=google.com; s=arc-20160816; b=Rta8M5HeM22lafuBsYqtUf+9q69fHhoTxBGML3L5DYORTqmvaRj3uYq56CjQdJ9gUs xcqNwLB9Lj84IZA1Cewujmg/gIMFwHwAUsDTyVc/HZICG5kuTZCIfROO1rqcb60g3jfD ulYDOR7erkoNMe7BWnvFbzar2Avy/OL/6LSTQNVgBfQ6BZowWR6pd+CwDtaRqXSf46gh 7ytJL26ySVIt9Rpw6yZY/uBnr5gVSP1FgQFi/6WxEzbR1o/TShWeSiFVUZ6nM5tbHLJO EiUAKRwGqGoANqjJt/NEAkvQIA/oINj+27oF7vvux3Hq44zogapVmxfaaQ1kg9HlL9d6 IXmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=aw1SpsRbJR/v6Zuyo0LlMNQnBzlfe35DrdWpsEqW79I=; b=e9H6zW7oCk2MI50+Nty8lzmBd16bcxFzZghruVtQ3Nn5LyiQdnA82igKEs5CHsfmGe Govk5/HgETP1Xc71K2+LtwxEyG4QrsslK60Z2S21H5aUGzlHv6J6BzV50oRD2GD5aN2U s12Lb5n0ArFP70MR0POQOZawXUaPghaAMOPBsQIqdXfEh+m0kmEkl751s+c4sxsFgysK zquibChFk/3QZJ0CMX6tUbedzObknPc+/q5Vcp/BBjPZyOr2lYl5ZLMR0edX9rDkv7Dt UA0NVnoWMJ417ACAWFteZDS63o7sldz8ummpMacwpsHKsqLsb7rrcFpbW3xsM8nIjIQc WPCQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a8si18113998pgm.592.2019.06.03.08.52.33; Mon, 03 Jun 2019 08:52:33 -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; 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 S1729637AbfFCPw2 (ORCPT + 30 others); Mon, 3 Jun 2019 11:52:28 -0400 Received: from foss.arm.com ([217.140.101.70]:54108 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729607AbfFCPwX (ORCPT ); Mon, 3 Jun 2019 11:52:23 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0216B15AB; Mon, 3 Jun 2019 08:52:23 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BA3583F246; Mon, 3 Jun 2019 08:52:21 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, "James E.J. Bottomley" , "Martin K. Petersen" Subject: [RFC PATCH 55/57] drivers: scsi: Use bus_find_next_device() helper Date: Mon, 3 Jun 2019 16:50:21 +0100 Message-Id: <1559577023-558-56-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> References: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reuse the generic helper to find the next device. Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Signed-off-by: Suzuki K Poulose --- drivers/scsi/scsi_proc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index c074631..5b31322 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -372,15 +372,10 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf, return err; } -static int always_match(struct device *dev, const void *data) -{ - return 1; -} - static inline struct device *next_scsi_device(struct device *start) { - struct device *next = bus_find_device(&scsi_bus_type, start, NULL, - always_match); + struct device *next = bus_find_next_device(&scsi_bus_type, start); + put_device(start); return next; }