Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755373AbdDJRYN (ORCPT ); Mon, 10 Apr 2017 13:24:13 -0400 Received: from mout.web.de ([217.72.192.78]:52813 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752276AbdDJRYJ (ORCPT ); Mon, 10 Apr 2017 13:24:09 -0400 Subject: Re: [PATCH v3] ia64: fix module loading for gcc-5.4+ To: Sergei Trofimovich , linux-ia64@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , Fenghua Yu , "H. J. Lu" , Tony Luck References: <20170408195318.18080-1-slyfox@gentoo.org> From: SF Markus Elfring Message-ID: Date: Mon, 10 Apr 2017 19:23:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170408195318.18080-1-slyfox@gentoo.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ujXzsqDEtADMQmrMkBNYhxu2GeAd3aCHr0Zgzd1leweTDU6DcXm toOEdFzsBWlC++PYCTtUxC7AhXySJlCLP+3wcnIKw2nfCjhik6BMqth7lmUUWqU4dnfHLFQ 7yu4geauU2WbH4hT77XUUNmcxpFIg12iA6rK+am0lC4GQudKq2cf+v6GD83uWqrcuWClcbK y/gk7BOm/pctjE3xVJa+A== X-UI-Out-Filterresults: notjunk:1;V01:K0:WkDH2ROmvnw=:nKmT/yD8PnBc2AqPqTVgWf L9cqfnhwhskJCKdD5fUf9dSVW9DGEfAzuEUeJV0RK5mc//RHYaqWqK0f6ILZtDN80zBnSClTH OLz3XGmK7t0rQMfj/yRR2VpcSwgF5KjKUxa+2tThoiQ0O4YqwFyaw4VGAAx0ZouVGRzkKE1Uk 5Fp+OZC88sGt9tui+FezJj5fzFgcN9CpUY4xumjYbSM+2+n0Q9YqjFGNbBoHORCajltzXguWv tqDCzFFGVvOUjwwk9Y6e5cjClczM2+RKh2dAzQ9boOxgiUB5OVwxFkwdUqg3dTr9PDjrfzlwW 5BszdtZas37ZmuRHaLniZWSRHvsL1gnHvDd3ykHGyqIJWQ6uqf+wEgd24yBRA7ahw89pWx+dL C/LKGTXkG8wBRrIFo1xrh7WY+go85SeWEZGNX1ZNVnerw2L8euvSiW+eSIrxlqVpMngsTOpz4 r+q+gWNPW6i2V0XKZEnW/FPg9eYru/OX//dJIr6art5ztOYf4np/wV/APARHMOz+AdjJbB1GF ZZGktyEVs5UTWQFiAm+eWrOWqY7Xr9Ia9O/075p/JfbKJorUcwcevm41sdnVckduKXEs9qJky Dw/+8cF782/9EjJp/xJH2JeXQy8hDAe7FEHolk25YN/R54Y+/AZoLUKgXAchwZOP+36Oxb+dr vsTW4DYatqk9YWs9UtmoT+t8inOG6IX95309gLnEk8iyfhdVrBsSQI3UZ8x9ElD/6rCpO6ad/ 2mirYyFIa58EoZQpyFLa8zU4/pfAAluBCfUNMR5WIyEiSQQMfvvhRwapZXZTD1TD3VgP2Vqy9 DOI7gUE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 693 Lines: 31 > +++ b/arch/ia64/kernel/module.c > @@ -153,7 +153,7 @@ slot (const struct insn *insn) > static int > apply_imm64 (struct module *mod, struct insn *insn, uint64_t val) > { I have got another idea (after your clarification) for the suggested change. > - if (slot(insn) != 2) { > + if (slot(insn) != 1 && slot(insn) != 2) { + int const s = slot(insn); + if (s < 1 || s > 2) { Do run time characteristics matter for such a condition check here? > printk(KERN_ERR "%s: invalid slot number %d for IMM64\n", - mod->name, slot(insn)); + mod->name, s); > return 0; How do you think about my update suggestion for this function implementation? Regards, Markus