From patchwork Thu Sep 27 23:56:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10618745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5523174A for ; Thu, 27 Sep 2018 23:58:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE5E02A1C5 for ; Thu, 27 Sep 2018 23:58:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A27702A568; Thu, 27 Sep 2018 23:58:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B5C02A1C5 for ; Thu, 27 Sep 2018 23:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726081AbeI1GSk (ORCPT ); Fri, 28 Sep 2018 02:18:40 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44009 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbeI1GSk (ORCPT ); Fri, 28 Sep 2018 02:18:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id z14-v6so4403783wrs.10; Thu, 27 Sep 2018 16:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SN+JYmJRqYokRoD2ZgX9a7MU1MsQLO/fU4W70YYMQV8=; b=UR52nlSXceCiiZT+WWYZ8xTIemuxiT4AC6YezGcHljuPvtfkOlLemWJIblixc+BpPc GDoLfslUrdX/9M7jQ3VOBpxKwClRpc12IbDLXl1j8vjMKDqd7E7kY07G/FhVbKNDYirc 5PYsxpIY/GRUMPVc8Kdm7hkSTp4ACcmbZamI1kvcFhfjd4QVHcna6LG0b4JHTxOi9Phs 5nXVb2/KrckckpZqhf7CjO08HRWjxUzlLaSfx1NiybkgnMMKc0jdh+NbgDlPAujA8JMb lKzrWMOID54mcaTSl3TQcii9xVheXlOYN0ksHVTnAro95Nfn8QwcWx2BMCLi6eS9mcxf zYLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SN+JYmJRqYokRoD2ZgX9a7MU1MsQLO/fU4W70YYMQV8=; b=ioDXoBwUjU03QqiJRYu238lc7/LAd3ZVloErJg697kRGiIAAkIA78CkYKWKXvcuwfG 33+fotkwZUJHt4NAPETqVRJ/6nXVJOIjGPhqFvYghT5oCZWlConzZ0PwZoIk7phr6PO8 nHqPKUwQBAPiO5cQW4tqVrfSfhbD+7wHk7KswZSwYZmpazWgxlLTs/OdQ4acguFnGvcv rtU347Ey2Ebay2qW7n9CcSNbWZ+hIZJzNYskLHUqdLHxnadYY97UFqkODTEZmuZeApte m6tF7kGJYJa8X+KxrXpK1ysavuiBBr3mJZqYAotxU4amvk6FzSUyxxnc5dlibhrItO1J gapQ== X-Gm-Message-State: ABuFfogGzplXws/GUAiHp6wzC7ra+WcdeJjk2uBYNDnahtjwDnm0T1Tb 7+xYwvvpuOtwtH/cX2hnuP0= X-Google-Smtp-Source: ACcGV60kaHwyUQYovqNXNx7Y77ImqnAiFmmMMR0g0xhkTOXELZF9RDMNGnusxi4VgUHX3Kr7NqB43w== X-Received: by 2002:adf:8567:: with SMTP id 94-v6mr10797806wrh.223.1538092667288; Thu, 27 Sep 2018 16:57:47 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id v10-v6sm3332687wrp.0.2018.09.27.16.57.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 16:57:46 -0700 (PDT) From: Nathan Chancellor To: Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH v2] scsi: bfa: Avoid implicit enum conversion in bfad_im_post_vendor_event Date: Thu, 27 Sep 2018 16:56:52 -0700 Message-Id: <20180927235651.27151-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180926045435.9213-1-natechancellor@gmail.com> References: <20180926045435.9213-1-natechancellor@gmail.com> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns when one enumerated type is implicitly converted to another. drivers/scsi/bfa/bfa_fcs_lport.c:379:26: warning: implicit conversion from enumeration type 'enum bfa_lport_aen_event' to different enumeration type 'enum bfa_ioc_aen_event' [-Wenum-conversion] BFA_AEN_CAT_LPORT, event); ^~~~~ The root cause of these warnings is the bfad_im_post_vendor_event function, which expects a value from enum bfa_ioc_aen_event but there are multiple instances of values from enums bfa_port_aen_event, bfa_audit_aen_event, and bfa_lport_aen_event being used in this function. Given that this doesn't appear to be a problem since cat helps with differentiating the events, just change evt's type to int so that no conversion needs to happen and Clang won't warn. Update aen_type's type in bfa_aen_entry_s as members that hold enumerated types should be int. Link: https://github.com/ClangBuiltLinux/linux/issues/147 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- v1 -> v2: * Update aen_type's type in bfa_aen_entry_s to match evt drivers/scsi/bfa/bfa_defs_svc.h | 2 +- drivers/scsi/bfa/bfad_im.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index 3d0c96a5c873..c19c26e0e405 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h @@ -1453,7 +1453,7 @@ union bfa_aen_data_u { struct bfa_aen_entry_s { struct list_head qe; enum bfa_aen_category aen_category; - u32 aen_type; + int aen_type; union bfa_aen_data_u aen_data; u64 aen_tv_sec; u64 aen_tv_usec; diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h index e61ed8dad0b4..bd4ac187fd8e 100644 --- a/drivers/scsi/bfa/bfad_im.h +++ b/drivers/scsi/bfa/bfad_im.h @@ -143,7 +143,7 @@ struct bfad_im_s { static inline void bfad_im_post_vendor_event(struct bfa_aen_entry_s *entry, struct bfad_s *drv, int cnt, enum bfa_aen_category cat, - enum bfa_ioc_aen_event evt) + int evt) { struct timespec64 ts;