From patchwork Tue Jan 2 11:00:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 123120 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8824205qgn; Tue, 2 Jan 2018 03:00:46 -0800 (PST) X-Google-Smtp-Source: ACJfBovksKigQg2YZ3abRVWgQBM23tFhpzBahluw7iWGci0WVh9dde0uvCPhlkzpOq/E2TBPzzKv X-Received: by 10.98.211.73 with SMTP id q70mr45625080pfg.107.1514890845969; Tue, 02 Jan 2018 03:00:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514890845; cv=none; d=google.com; s=arc-20160816; b=baKhGbdGeDhlbz0Rqok1Zvvxk7a7LQ+I7+iT+gOCgBkme+RN4Ajd8fhUumq41NLKnz mL8T3lUj5OIQ+8hpO7mFdNMU3zfe3wB44aqAi3tg/sTYEj+JFOpQKujEJUONkytcHSH9 eMGeHw6fhgd9CC0OhAqLXZsylWADb0dOLjsUiyeEA4En5foWUcFaoksprGADt8hZ0Biv woV6Z0ipduaXb6YzUn2bvtSnXSq2XJ8chJxjVJScev2nGcH63QS7QE8OBr05/4FNhmRL E1PAR6WJtmrGjM2u6StxH3++BhxbrqdAHkifxcMSbLQDko4MfZGTY2hu2oapK7XT59NV nLAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TcRCIbWWBOqoGPR6ZfCNJeOvBq+wKN4rWiYe0KSF2/c=; b=rZQmM4Lp6v+Qr66zcKC1s1WFo2QeFnPP/qkQc3kNf5CvrBsBb+ykVZlaXevdPJ6TPY JP0HWbcZtbGzWjthPEs4/tzCIhi4xzBNopU4Fu4r0/v20JEHA5oUKqo3AAk2GN+VN4u8 p2tjEdu5gscxjKuKpz5aQHiQWgTwOBlh03HuhUyqSgQIUk1qKBf9CpJZAqZLXoAnVnrA GI6lwyYbcBzkaW2WejnlzdK8cQ8FDhIvJlKZSozwcvgH4iOta0x1hS40ktKTLCJPE8v9 0t/RijBLCrH5GyxHXst6FFCNfWYM3JigxaYOqoXzO9Flsx021zNeYP9Ng9juFJ6xJRWa XLgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si33712663pfg.275.2018.01.02.03.00.45; Tue, 02 Jan 2018 03:00:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752859AbeABLAl (ORCPT + 28 others); Tue, 2 Jan 2018 06:00:41 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:55181 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbeABLAj (ORCPT ); Tue, 2 Jan 2018 06:00:39 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MWjXP-1eOp7H2WCZ-00XvgF; Tue, 02 Jan 2018 12:00:36 +0100 From: Arnd Bergmann To: Andrew Morton , Chris Zankel , Max Filippov Cc: linux-arch@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] xtensa: shut up gcc-8 warnings Date: Tue, 2 Jan 2018 12:00:22 +0100 Message-Id: <20180102110035.1806925-1-arnd@arndb.de> X-Mailer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eC9e10g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Many uses of strncpy() on xtensa causes a warning like arch/xtensa/include/asm/string.h:56:42: warning: array subscript is above array bounds [-Warray-bounds] : "0" (__dest), "1" (__src), "r" (__src+__n) This avoids the warning by turning the pointer arithmetic into an integer operation that does not get checked the same way. Signed-off-by: Arnd Bergmann --- arch/xtensa/include/asm/string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/xtensa/include/asm/string.h b/arch/xtensa/include/asm/string.h index 586bad9fe187..89b51a0c752f 100644 --- a/arch/xtensa/include/asm/string.h +++ b/arch/xtensa/include/asm/string.h @@ -53,7 +53,7 @@ static inline char *strncpy(char *__dest, const char *__src, size_t __n) "bne %1, %5, 1b\n" "2:" : "=r" (__dest), "=r" (__src), "=&r" (__dummy) - : "0" (__dest), "1" (__src), "r" (__src+__n) + : "0" (__dest), "1" (__src), "r" ((uintptr_t)__src+__n) : "memory"); return __xdest; @@ -101,7 +101,7 @@ static inline int strncmp(const char *__cs, const char *__ct, size_t __n) "2:\n\t" "sub %2, %2, %3" : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy) - : "0" (__cs), "1" (__ct), "r" (__cs+__n)); + : "0" (__cs), "1" (__ct), "r" ((uintptr_t)__cs+__n)); return __res; }