From patchwork Wed Jan 13 08:09:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 8023211 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3A3CFBEEE5 for ; Wed, 13 Jan 2016 08:10:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 277E6203F3 for ; Wed, 13 Jan 2016 08:10:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 274802041A for ; Wed, 13 Jan 2016 08:10:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755270AbcAMIKi (ORCPT ); Wed, 13 Jan 2016 03:10:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:58943 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754893AbcAMIKT (ORCPT ); Wed, 13 Jan 2016 03:10:19 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3828EAD69; Wed, 13 Jan 2016 08:10:14 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: James Bottomley , Christoph Hellwig , Bart von Assche , Ewan Milne , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCHv3 15/24] scsi_devinfo: move scsi_get_device_flags into scsi_devinfo.h Date: Wed, 13 Jan 2016 09:09:50 +0100 Message-Id: <1452672599-9820-16-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1452672599-9820-1-git-send-email-hare@suse.de> References: <1452672599-9820-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP scsi_get_device_flags is just a wrapper for scsi_get_device_flags_keyed. The latter is exported, the former isn't. And both functions _and_ the 'key' values are only defined in the (internal) scsi_priv.h header file. This patch moves these definitions into scsi_devinfo.h to make them available for other modules. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_devinfo.c | 21 --------------------- drivers/scsi/scsi_priv.h | 12 ------------ drivers/scsi/scsi_transport_spi.c | 1 + include/scsi/scsi_devinfo.h | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 47b9d13..601ff49 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -546,27 +546,6 @@ static int scsi_dev_info_list_add_str(char *dev_list) } /** - * get_device_flags - get device specific flags from the dynamic device list. - * @sdev: &scsi_device to get flags for - * @vendor: vendor name - * @model: model name - * - * Description: - * Search the global scsi_dev_info_list (specified by list zero) - * for an entry matching @vendor and @model, if found, return the - * matching flags value, else return the host or global default - * settings. Called during scan time. - **/ -int scsi_get_device_flags(struct scsi_device *sdev, - const unsigned char *vendor, - const unsigned char *model) -{ - return scsi_get_device_flags_keyed(sdev, vendor, model, - SCSI_DEVINFO_GLOBAL); -} - - -/** * scsi_get_device_flags_keyed - get device specific flags from the dynamic device list * @sdev: &scsi_device to get flags for * @vendor: vendor name diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 27b4d0a..b91ffee 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -43,18 +43,6 @@ static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) /* scsi_devinfo.c */ -/* list of keys for the lists */ -enum { - SCSI_DEVINFO_GLOBAL = 0, - SCSI_DEVINFO_SPI, -}; - -extern int scsi_get_device_flags(struct scsi_device *sdev, - const unsigned char *vendor, - const unsigned char *model); -extern int scsi_get_device_flags_keyed(struct scsi_device *sdev, - const unsigned char *vendor, - const unsigned char *model, int key); extern int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model, char *strflags, int flags, int key); diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 319868f..cae212b 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -35,6 +35,7 @@ #include #include #include +#include #define SPI_NUM_ATTRS 14 /* increase this if you add attributes */ #define SPI_OTHER_ATTRS 1 /* Increase this if you add "always diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index 96e3f56..aca3c80 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h @@ -38,4 +38,36 @@ #define BLIST_NO_RSOC 0x20000000 /* don't try to issue RSOC */ #define BLIST_MAX_1024 0x40000000 /* maximum 1024 sector cdb length */ +/* list of keys for the lists */ +enum { + SCSI_DEVINFO_GLOBAL = 0, + SCSI_DEVINFO_SPI, +}; + +extern int scsi_get_device_flags_keyed(struct scsi_device *sdev, + const unsigned char *vendor, + const unsigned char *model, int key); + +/** + * scsi_get_device_flags - get device specific flags from the dynamic + * device list. + * @sdev: &scsi_device to get flags for + * @vendor: vendor name + * @model: model name + * + * Description: + * Search the global scsi_dev_info_list (specified by list zero) + * for an entry matching @vendor and @model, if found, return the + * matching flags value, else return the host or global default + * settings. Called during scan time. + **/ +static inline int scsi_get_device_flags(struct scsi_device *sdev, + const unsigned char *vendor, + const unsigned char *model) +{ + return scsi_get_device_flags_keyed(sdev, vendor, model, + SCSI_DEVINFO_GLOBAL); +} + + #endif