Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbbFZDGa (ORCPT ); Thu, 25 Jun 2015 23:06:30 -0400 Received: from mail-qk0-f178.google.com ([209.85.220.178]:36157 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbbFZDGX (ORCPT ); Thu, 25 Jun 2015 23:06:23 -0400 MIME-Version: 1.0 From: =?UTF-8?B?5Yav5Yqb?= Date: Fri, 26 Jun 2015 11:05:53 +0800 Message-ID: Subject: [PATCH] drivers/scsi: fix macro in sg To: dgilbert@interlog.com, JBottomley@odin.com Cc: linux-scsi@vger.kernel.org, linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1642 Lines: 52 This patch fix the macro transport_class_to_sdev to the resonable name and use the macro. Signed-off-by: vonnyfly --- drivers/scsi/sg.c | 6 +++--- include/scsi/scsi_device.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 9d7b7db..be7f132 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1454,10 +1454,10 @@ out_unlock: static int sg_add_device(struct device *cl_dev, struct class_interface *cl_intf) { - struct scsi_device *scsidp = to_scsi_device(cl_dev->parent); - struct gendisk *disk; + struct scsi_device *scsidp = transport_class_to_scsi_device(cl_dev); + struct gendisk *disk = NULL; Sg_device *sdp = NULL; - struct cdev * cdev = NULL; + struct cdev *cdev = NULL; int error; unsigned long iflags; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index ae84b22..f6a5473 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -227,7 +227,7 @@ struct scsi_dh_data { container_of(d, struct scsi_device, sdev_gendev) #define class_to_sdev(d) \ container_of(d, struct scsi_device, sdev_dev) -#define transport_class_to_sdev(class_dev) \ +#define transport_class_to_scsi_device(class_dev) \ to_scsi_device(class_dev->parent) #define sdev_dbg(sdev, fmt, a...) \ -- 1.7.10.4 -- Thanks and Best Regards, Feng Li(Alex) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/