From patchwork Mon May 2 21:38:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 568899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0D3EC433EF for ; Mon, 2 May 2022 21:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387765AbiEBVmj (ORCPT ); Mon, 2 May 2022 17:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387730AbiEBVmH (ORCPT ); Mon, 2 May 2022 17:42:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2514E0E8 for ; Mon, 2 May 2022 14:38:37 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0B6E31F899; Mon, 2 May 2022 21:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1651527513; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FJ5oQ5H1fPRUi/YmGKm4/wPBtBEBA1n/5FEhzWV4TVE=; b=qexQ11w7YJvzQCIv8dX//ypC312Z5ctA/rM9Ndd69hfowneDMe5MHMEf/5bnhAau0oyjUM vqJ0lxKQdgNp+PTETAG/cxkkZHM7O0b+dmAqCfr7+Rlc8GOV1Z9Fp6LoZq9kPwAtOk8Td9 b4YtPE0YUmL6W7dNnaLH/HV9TEr+Djk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1651527513; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FJ5oQ5H1fPRUi/YmGKm4/wPBtBEBA1n/5FEhzWV4TVE=; b=ZxjnClc5q82wlTjBLrBTHdt+jNkC2aOtBNNHY2IXTsuq5jpn1CthQpQdW0rZ+QvCoOcft1 q5IgdVJlyQT0GMBw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 0691F2C152; Mon, 2 May 2022 21:38:33 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 16045) id 03923519410E; Mon, 2 May 2022 23:38:33 +0200 (CEST) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH 13/24] aic7xxx: make BUILD_SCSIID() a function Date: Mon, 2 May 2022 23:38:09 +0200 Message-Id: <20220502213820.3187-14-hare@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220502213820.3187-1-hare@suse.de> References: <20220502213820.3187-1-hare@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Convert BUILD_SCSIID() into a function and add a scsi_device argument. Signed-off-by: Hannes Reinecke Reported-by: kernel test robot --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index d3b1082654d5..85fe8808399f 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -798,11 +798,16 @@ struct scsi_host_template aic7xxx_driver_template = { /**************************** Tasklet Handler *********************************/ -/******************************** Macros **************************************/ -#define BUILD_SCSIID(ahc, cmd) \ - ((((cmd)->device->id << TID_SHIFT) & TID) \ - | (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \ - | (((cmd)->device->channel == 0) ? 0 : TWIN_CHNLB)) + +static inline unsigned int ahc_build_scsiid(struct ahc_softc *ahc, + struct scsi_device *sdev) +{ + unsigned int scsiid = + ((sdev->id << TID_SHIFT) & TID) | + ((sdev->channel == 0) ? ahc->our_id : ahc->our_id_b) | + (sdev->channel == 0) ? 0 : TWIN_CHNLB; + return scsiid; +} /******************************** Bus DMA *************************************/ int @@ -1457,7 +1462,7 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev, * Fill out basics of the HSCB. */ hscb->control = 0; - hscb->scsiid = BUILD_SCSIID(ahc, cmd); + hscb->scsiid = ahc_build_scsiid(ahc, cmd->device); hscb->lun = cmd->device->lun; mask = SCB_GET_TARGET_MASK(ahc, scb); tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb),