From patchwork Wed Nov 16 15:14:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101511 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp208206qge; Wed, 16 Nov 2016 07:15:10 -0800 (PST) X-Received: by 10.99.208.21 with SMTP id z21mr9324764pgf.79.1479309310135; Wed, 16 Nov 2016 07:15:10 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si32269847pgh.58.2016.11.16.07.15.10 for ; Wed, 16 Nov 2016 07:15:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbcKPPPJ (ORCPT ); Wed, 16 Nov 2016 10:15:09 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:51107 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753423AbcKPPPI (ORCPT ); Wed, 16 Nov 2016 10:15:08 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M1od8-1cwFd51Uks-00tlra; Wed, 16 Nov 2016 16:14:49 +0100 From: Arnd Bergmann To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Anil Gurumurthy , Sudarsana Kalluru , Johannes Thumshirn , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bfa: turn bfa_mem_{kva,dma}_setup into inline functions Date: Wed, 16 Nov 2016 16:14:27 +0100 Message-Id: <20161116151445.3208739-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:D4Movj7H0uUYY0LMlfhZIb/vClJ0o7+wz1lBNvuQpXGJwzO3JGG UVmLDRTkkLS4Q2adRbSpAmA5T+ltiiePGB2tEaoTcGG/NN5T5ywAaId90O8SfTpVQk5Y7Cn M7q7/2ebHVWfT4HIBUgUs3ci2LFzrw5u93WJlIk9D3uEP30z/gRgirLn3622gHFMdoBV8/2 0KDakRiNfWR/XCHJcpCiA== X-UI-Out-Filterresults: notjunk:1; V01:K0:jgxXSSIDjVA=:pFimemwHvkg7adUvaxwzYO /70A8AOLhs3l8sKpz7jpODpDqBO6yFlraR57OrhvGfJkqK4je6RWkgHQLjXTCFYfXal/zM7Bk UEBISjhXOoRp6LdhP96X/fmd3h5qQjrl/7tnQdUM+fJPYTkTzPNRNV1cP8gMDDA2i7qlEfzlv 2ZUeoZ8ehUSzDLfXD/SfA/DFvyXe4FG436SekciirsYja9tEXLYjwrw6pNDkiLCaTJzUh9dvj aPcctTRQjheM2+pM2NcStSuShIjl3d/shVMApGUu9G1ARg3l+BfkUtAh19ef4RswGKUM2sDsy MzGc+Q51jtY0AtR8VekyNNB2D1p6XEN52YcNTGGLFNyqFWjXlYzFIzs7Cv/VCOMMOjP7oELL6 +e6P4SXHSDV3+F7R2P6XEKk2wL/swCuXInjGPd4d9ni7RY/otr+cz8YPSXC+zY1+9rUY8rw+s v+eJ2K8/9vLzVQ9un7lP0dsn1E0tbzBvD/yZlL+Ft72H2X0LZydxGwevsKeSaKUybkQQ3HfAA Z6BZnZBQgGrw/5KStzE/qXuLgZP0GTcfoEDICohcnztYAvxWztjlcPeXK5jbHRdCpxJXrVD1M cYZdZQJ55IKftV7C4iGexGMEhAaquB90Fs0e0BZea3A841dBfWjYAua1pxaHqj6+61k2ho8uB uvkaoMxqjlFrnT+SHcG86LdwdxZ9TArqwvUYrg+rREEpuN24UoVfIO3SF5in/DudvtSY= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org These two macros cause lots of warnings with gcc-7: drivers/scsi/bfa/bfa_svc.c: In function 'bfa_fcxp_meminfo': drivers/scsi/bfa/bfa_svc.c:521:103: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] Using inline functions makes them much more readable and avoids the warnings. Signed-off-by: Arnd Bergmann --- drivers/scsi/bfa/bfa_ioc.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 523fb02109b6..c27ed80f12ab 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h @@ -111,20 +111,24 @@ struct bfa_meminfo_s { struct bfa_mem_kva_s kva_info; }; -/* BFA memory segment setup macros */ -#define bfa_mem_dma_setup(_meminfo, _dm_ptr, _seg_sz) do { \ - ((bfa_mem_dma_t *)(_dm_ptr))->mem_len = (_seg_sz); \ - if (_seg_sz) \ - list_add_tail(&((bfa_mem_dma_t *)_dm_ptr)->qe, \ - &(_meminfo)->dma_info.qe); \ -} while (0) +/* BFA memory segment setup helpers */ +static inline void bfa_mem_dma_setup(struct bfa_meminfo_s *meminfo, + struct bfa_mem_dma_s *dm_ptr, + size_t seg_sz) +{ + dm_ptr->mem_len = seg_sz; + if (seg_sz) + list_add_tail(&dm_ptr->qe, &meminfo->dma_info.qe); +} -#define bfa_mem_kva_setup(_meminfo, _kva_ptr, _seg_sz) do { \ - ((bfa_mem_kva_t *)(_kva_ptr))->mem_len = (_seg_sz); \ - if (_seg_sz) \ - list_add_tail(&((bfa_mem_kva_t *)_kva_ptr)->qe, \ - &(_meminfo)->kva_info.qe); \ -} while (0) +static inline void bfa_mem_kva_setup(struct bfa_meminfo_s *meminfo, + struct bfa_mem_kva_s *kva_ptr, + size_t seg_sz) +{ + kva_ptr->mem_len = seg_sz; + if (seg_sz) + list_add_tail(&kva_ptr->qe, &meminfo->kva_info.qe); +} /* BFA dma memory segments iterator */ #define bfa_mem_dma_sptr(_mod, _i) (&(_mod)->dma_seg[(_i)])