From patchwork Tue Jan 2 10:57:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 123118 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8822377qgn; Tue, 2 Jan 2018 02:58:34 -0800 (PST) X-Google-Smtp-Source: ACJfBotW+vl0VUZhAzC1edTQXKmvlYkqvLpTG+eJUo0rImHX/jSKRhqdEHoAedZuEvt0BEsa/Rvh X-Received: by 10.99.178.68 with SMTP id t4mr14008310pgo.330.1514890714235; Tue, 02 Jan 2018 02:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514890714; cv=none; d=google.com; s=arc-20160816; b=TEemaEbLSfxd1uDHI8XGxSLhbe88NsOdEBNacC3heb3FhwxlxJaYDCz88lUqEeogIq FHKzqNYJIXrofbnQyIqELJKDtsLHpWWz9CUWgebvRPVBLjfbvaum1lDL0KfvmM6oSgYc wwb/wArSvfZNhbeoWpYl07owpjFQZQkjz3B1N2FYM15DyjV0tlrGRDv6cVRKnZBTH8Yd 8M3JAAHnOYO1DSrfZh8Nam4lt0eC+mPPraT6Z23OvugNvVCfP5hQIQqK/xO5OSvht/yJ XDbGF92qFE+HnN51u3PxDiZt6fLxPIgjuDt2Mk0kMlC5PvPK8ngMY/9LXqrHgylZAgpi dcVQ== 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=U7JEoMCsigfvXRdxeN8PNiAw5ExnFFJvMPNX4BL/1+E=; b=xLofUmHkJ/PQ6wBcuJJGrwxhn0pJ6T5GapNeDyP6aVi4pTRpHRryhAxvnB/SkIIQF/ /67iHB8AGqmjA4i1vfg7yJcVoh4j4ALkxmVWzq3tgz2Kp1Z0Rwim+mj9+7V+NNuOk1S2 UEQyG6Os3bEU0vRvrIhsshp0TfsRzeCMiYo/VMeaNqK81Gxmjmm17rQAlzAWTZW/TVBE vhyrLSSs+WX6xqa2xsJ/xKYv+MnM8G35iS66ggQwDb+cgJLVvr17Mrv5UH8l5OyuTOyo eMPE2ZlM52kUPry0mhuJEx9zP1M6bTS/izVlyOzBsQzn96JDbdBFikMXJwVL6srmMdHb J1GQ== 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 c5si33375860plr.407.2018.01.02.02.58.33; Tue, 02 Jan 2018 02:58:34 -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 S1752170AbeABK6a (ORCPT + 28 others); Tue, 2 Jan 2018 05:58:30 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:65086 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbeABK62 (ORCPT ); Tue, 2 Jan 2018 05:58:28 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LySz0-1f1isA3Iqk-015uEa; Tue, 02 Jan 2018 11:58:08 +0100 From: Arnd Bergmann To: Yoshinori Sato , Rich Felker Cc: Arnd Bergmann , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sh: shut up gcc-8 warnings Date: Tue, 2 Jan 2018 11:57:51 +0100 Message-Id: <20180102105805.1688638-1-arnd@arndb.de> X-Mailer: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M6vWt17KwB8OYV+6os4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Many uses of strncpy() on sh causes a warning like arch/sh/include/asm/string_32.h:50:42: warning: array subscript is above array bounds [-Warray-bounds] 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/sh/include/asm/string_32.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/sh/include/asm/string_32.h b/arch/sh/include/asm/string_32.h index 55f8db6bc1d7..98ddb5bbd3b8 100644 --- a/arch/sh/include/asm/string_32.h +++ b/arch/sh/include/asm/string_32.h @@ -47,7 +47,7 @@ static inline char *strncpy(char *__dest, const char *__src, size_t __n) " add #1, %0\n" "2:" : "=r" (__dest), "=r" (__src), "=&z" (__dummy) - : "0" (__dest), "1" (__src), "r" (__src+__n) + : "0" (__dest), "1" (__src), "r" ((uintptr_t)__src+__n) : "memory", "t"); return __xdest; @@ -105,7 +105,7 @@ static inline int strncmp(const char *__cs, const char *__ct, size_t __n) "sub %3, %2\n" "3:" :"=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy) - : "0" (__cs), "1" (__ct), "r" (__cs+__n) + : "0" (__cs), "1" (__ct), "r" ((uintptr_t)__cs+__n) : "t"); return __res;