From patchwork Wed Sep 26 04:54:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10615297 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 D099215A6 for ; Wed, 26 Sep 2018 04:58:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C22302A44C for ; Wed, 26 Sep 2018 04:58:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5F672A721; Wed, 26 Sep 2018 04:58:40 +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 5478A2A44C for ; Wed, 26 Sep 2018 04:58:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726372AbeIZLJm (ORCPT ); Wed, 26 Sep 2018 07:09:42 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37886 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbeIZLJl (ORCPT ); Wed, 26 Sep 2018 07:09:41 -0400 Received: by mail-wr1-f67.google.com with SMTP id u12-v6so25459522wrr.4; Tue, 25 Sep 2018 21:58:38 -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:mime-version :content-transfer-encoding; bh=t/U/3xhzcXZArG3vw7amUM76vNzuqmicA2916lx0mzM=; b=gQHh3K0OyAeJGj/U0JMQgs6VLMjCVSAhfh3zR1vvgXAPOwuo5iOYeIXlUlsoKUVaBE 2ED4R3pMEsTHv/giP0X8QI4iNvclaf0hH3gHdcBxgtFMQXnuU3GSZxT3f6MJ2yV6FB2T y3owipyJAdLvdsgET1H0+kp9exbgfMcDNrzGy+eRYxSmfhYpbEz8IKfDn3amVIrxVCnz MRQTtWCrqhRugLcZKbhTjbu4fRk+t6YTHhCp8m++d9m8+SIdztCXHopzCVCL8O54xnwG peBL33DB5XOzBeDC8dc9h+vdaDXdZpmRB+tjXgbifLmJnOZ5PHaClYx1lknYXHH0MZLy pORQ== 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:mime-version :content-transfer-encoding; bh=t/U/3xhzcXZArG3vw7amUM76vNzuqmicA2916lx0mzM=; b=sknTNQyqva3C1UeArJMBlOqO6ii98JY4bsBWhKaCw8+fyyKrazdhyruCmfHyGw0uAm u7OhCC1vqx48Fa6bJdUR0jrWuuohm+xERPU/NLV25UR+UAtB7L72+XgUus0ZYAJMoF+n P69ZP7xmpUet6Mf+qCnje7C7b1EOuvenDq/c0YRCZZixtMiBU76Q21Yeco2Je/gWcAnc qZ12eGddvpDEr65WBCCx09Nv/fcKQ+ka+4g8Y8xu+IfbXgYZvjbUbSGPojlRXeTiFebH QUspOFvBnFtbS4/D7PiRTWp2IQIk1vIO/RZYaFRThkxnOE4Sd1qrRDrKKfHnFZ9msxly 1Dvw== X-Gm-Message-State: ABuFfohxMbsnNi83sL8pGrvFIjCkbykmzWhfAG8kTPVl70zE/Al1Xeli v2mHXzS883hpHDSjWhE7zNs= X-Google-Smtp-Source: ACcGV62xPe1exZf8YDLILgeirznggUwiTOqXepbuRfOKM0rG0usw9wPSajfT6h+D4z2HGOy17TZT6g== X-Received: by 2002:adf:e0c4:: with SMTP id e4-v6mr3301233wri.199.1537937917500; Tue, 25 Sep 2018 21:58:37 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id k34-v6sm5528710wre.18.2018.09.25.21.58.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 21:58:36 -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] scsi: bfa: Avoid implicit enum conversion in bfad_im_post_vendor_event Date: Tue, 25 Sep 2018 21:54:37 -0700 Message-Id: <20180926045435.9213-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 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. Link: https://github.com/ClangBuiltLinux/linux/issues/147 Signed-off-by: Nathan Chancellor --- The alternate way of fixing these warnings is to explicitly cast the conversion when calling the function but since there are about 8-10 of these warnings, it seems logical to just change the function definiton which is cleaner in my opinion. See commits 3eb95feac113 ("mm/zsmalloc.c: change stat type parameter to int") and 04fecbf51b3c ("mm: memcontrol: use int for event/state parameter in several functions") for similar fixes. drivers/scsi/bfa/bfad_im.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;