From patchwork Fri Jun 26 03:05:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Li X-Patchwork-Id: 6678201 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 8428EC05AC for ; Fri, 26 Jun 2015 03:06:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D7092066D for ; Fri, 26 Jun 2015 03:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83065206B0 for ; Fri, 26 Jun 2015 03:06:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751579AbbFZDGY (ORCPT ); Thu, 25 Jun 2015 23:06:24 -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 Received: by qkei195 with SMTP id i195so10444917qke.3; Thu, 25 Jun 2015 20:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=/RALPpCb1GhOE4LaZQXGb7kk+o0qTOUXcaLcMvK7OWI=; b=SR/PXNR3YG836iLo/bgNbeiENXBMQD4eaKr/SAPhZ/RF0FhvcM8ejEGM1zSnQVqWFQ z+9yjVEF9dJqHE4T0bdGRCDyN9cxLvwdaazZ6m3H+F+Ctib4byVK1vQu4mss8ajspzNu bcmaJKHxrqOpNMOhOAe6KIPsMkneDGl2bTsspjrEihJAH12d9S56ZyOUTnLtE9hlfWHi NDPyaK89rOOWnsLn849DNrXnHeeVJN0QMD6i7sM6HkmgI4G/LaMEdfEBVrM7Lb7QEO24 z8yJLgnK7gyinEFCm8//Zv6f22+65l5o1+22YkIKvvh7XGyfoLCD8VQwTjfgM0w5K9SD 78pg== X-Received: by 10.55.55.74 with SMTP id e71mr105535815qka.65.1435287982998; Thu, 25 Jun 2015 20:06:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.35.36 with HTTP; Thu, 25 Jun 2015 20:05:53 -0700 (PDT) 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 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 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(-) -- 1.7.10.4 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...) \