From mboxrd@z Thu Jan 1 00:00:00 1970 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 F266DC433EF for ; Tue, 3 May 2022 14:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236784AbiECOQa (ORCPT ); Tue, 3 May 2022 10:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236780AbiECOQ0 (ORCPT ); Tue, 3 May 2022 10:16:26 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C80E117E0E for ; Tue, 3 May 2022 07:12:53 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 196E668D0A; Tue, 3 May 2022 16:12:50 +0200 (CEST) Date: Tue, 3 May 2022 16:12:49 +0200 From: Christoph Hellwig To: Hannes Reinecke Cc: "Martin K. Petersen" , Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH 13/24] aic7xxx: make BUILD_SCSIID() a function Message-ID: <20220503141249.GM22590@lst.de> References: <20220502213820.3187-1-hare@suse.de> <20220502213820.3187-14-hare@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220502213820.3187-14-hare@suse.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org > +{ > + 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; This still look weird. Why not: unsigned int scsiid = (sdev->id << TID_SHIFT) & TID); if (sdev->channel == 0) { scsiid |= ahc->our_id; else scsiid |= ahc->our_id_b | TWIN_CHNLB; return scsiid; ?