From patchwork Sat Jun 16 06:45:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Engelhardt X-Patchwork-Id: 10467913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E97426028E for ; Sat, 16 Jun 2018 06:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC70F2785D for ; Sat, 16 Jun 2018 06:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB77028E8F; Sat, 16 Jun 2018 06:53:02 +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=-6.9 required=2.0 tests=BAYES_00,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 083F02785D for ; Sat, 16 Jun 2018 06:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948AbeFPGxB (ORCPT ); Sat, 16 Jun 2018 02:53:01 -0400 Received: from a3.inai.de ([88.198.85.195]:58092 "EHLO a3.inai.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753907AbeFPGxA (ORCPT ); Sat, 16 Jun 2018 02:53:00 -0400 X-Greylist: delayed 492 seconds by postgrey-1.27 at vger.kernel.org; Sat, 16 Jun 2018 02:53:00 EDT Received: by a3.inai.de (Postfix, from userid 65534) id DF9DEE1A56B; Sat, 16 Jun 2018 08:45:20 +0200 (CEST) Received: from a4.inai.de (a4.inai.de [IPv6:2a01:4f8:222:6c9::f8]) by a3.inai.de (Postfix) with ESMTP id 746451FC7D91; Sat, 16 Jun 2018 08:45:20 +0200 (CEST) From: Jan Engelhardt To: lucas.demarchi@intel.com Cc: jengelh@inai.de, linux-modules@vger.kernel.org Subject: [PATCH] kmod: build: cure compiler warnings showing up externally Date: Sat, 16 Jun 2018 08:45:20 +0200 Message-Id: <20180616064520.6426-1-jengelh@inai.de> X-Mailer: git-send-email 2.17.1 Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP When building a C source file with gcc-7 -Wshift-overflow=2, this warning springs up: libkmod.h: warning: result of "1 << 31" requires 33 bits to represent, but "int" only has 32 bits [-Wshift-overflow=] Change the two _KMOD_* identifiers to fit into 32 bits. --- libkmod/libkmod.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h index f9e33c6..352627e 100644 --- a/libkmod/libkmod.h +++ b/libkmod/libkmod.h @@ -72,7 +72,7 @@ enum kmod_index { KMOD_INDEX_MODULES_SYMBOL, KMOD_INDEX_MODULES_BUILTIN, /* Padding to make sure enum is not mapped to char */ - _KMOD_INDEX_PAD = (1 << 31), + _KMOD_INDEX_PAD = 1U << 31, }; int kmod_dump_index(struct kmod_ctx *ctx, enum kmod_index type, int fd); @@ -211,7 +211,7 @@ enum kmod_module_initstate { KMOD_MODULE_COMING, KMOD_MODULE_GOING, /* Padding to make sure enum is not mapped to char */ - _KMOD_MODULE_PAD = (1 << 31), + _KMOD_MODULE_PAD = 1U << 31, }; const char *kmod_module_initstate_str(enum kmod_module_initstate state); int kmod_module_get_initstate(const struct kmod_module *mod);