From patchwork Fri Feb 2 15:19:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126730 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp736985ljc; Fri, 2 Feb 2018 07:20:30 -0800 (PST) X-Google-Smtp-Source: AH8x2271fFypRcQnN2tOHd9YcU64QrJUpzMSLofC/sO9sokW14qVKEG/NG8iltDgp+KeOoZgzZzw X-Received: by 10.99.113.75 with SMTP id b11mr32987261pgn.271.1517584829940; Fri, 02 Feb 2018 07:20:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517584829; cv=none; d=google.com; s=arc-20160816; b=znIdg024P4aiaYhlhGyseAfukb/BJbzyB08ZL7Ze5VhxB50BmRaa3VuEpHh810847H jlYoUsgLWMVYobR/cX5yHf5x+e43lMvN8vQ9323TG8ml59OR9GT7sjd2B64olujkc7k5 emOuMPDrA4YIgtxEoy1UCe+Lcxri2LGQVfPx5q0U7Lt0tKm7fLibIoAwIQYdUIQSKnup u9pAZQr/x/ZE3ZPNNGs/Z5STA9B37Rq3VirTgTe1gIjprtS/xjoy8CxAqtNxpyGTWxE+ PvziTptrZcDhridkjlwszipsrXkSPxpJ1ZH4bp0H1RJCSg5aqCTA04gZBSsjSQDQkgYk XcEw== 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=Tab/4EQIA1+AmRIeqa+fCNEAjuGT++8pMGj4/SLwowU=; b=g7ba7RuVz0TmZqPECw5j6D9ldT6s3lGeQEMPmmFNxDGmUv8ezYsRfhoOm4S6rcELJ8 VVv9D2WfbI9toMlcfOEc8ZefdsSvj0GlBQaToQTvoyyEbvIYl8/xryvGekNiIXytJGoS cwYeOPX8l8sSenAMwKCHNK3zJ9fR1mnR6Ebji0qZNXoRwuK7fMuk+8GugLUo725tYfmS 6i3D9VSrrgg+Vzs6p/FpQX/KUK6zgZN0PSJmELdPXq/hbFZlbyrcHlfW2eRUMHw+u6Zr ZnLDAGOYaZF54wFjqwChGTNPn+V2SYH9ug+0W/orYEgqOgfQKvmy4LxckZNQ7W0+yFlT 757Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 c80si1963162pfb.182.2018.02.02.07.20.29; Fri, 02 Feb 2018 07:20:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-media-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-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbeBBPUZ (ORCPT + 4 others); Fri, 2 Feb 2018 10:20:25 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:60498 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710AbeBBPUY (ORCPT ); Fri, 2 Feb 2018 10:20:24 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MaD2e-1eSJCl3tMm-00JoHl; Fri, 02 Feb 2018 16:20:12 +0100 From: Arnd Bergmann To: Alan Cox , Sakari Ailus , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Arnd Bergmann , =?utf-8?q?J=C3=A9r=C3=A9my_Lefaure?= , Sergiy Redko , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: media: atomisp: remove pointless string copy Date: Fri, 2 Feb 2018 16:19:41 +0100 Message-Id: <20180202152009.843231-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:YwOaRFH0AilTCNdPNOQMzYA7Jmbl3dUcB6knq81TLO9t3aXQ/Mi Kcwdn00c2u2opFWSHAX92GuLY2GfsBa5OTkS4ReGB7M936bGDkyR+UweNVC6zvo313MiVp0 5c4hG1UojGhFrGvZAsTVzbnX6pT1GQhiUwHWi/y1VpE8+TZZmrBzGLUPhhRT6q6RW5zhsuG wqmlVn9KQxxAOoTcQ+d4Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:IdYRcOVakjM=:f9E+5x3G0tXpo7SSOOWGPj ZO56+7bLEoMBO5m7yI1dpYkCxlGHk9XvbmFf5z5+bfzAUuUsizgfdqKI9fbjLzzt5vCTPmDLB aXFWyN5oK3vw9Ns5uSvJ8FGiBh4wpI2YoC9I39fl4tlSnEjy/Vh3sUX+xE6o+qy8mlaP3AaUc vI3AbKnJRFsuzf3b6atfpOs3UNBYNRs1iJcVFlbqL+2lDyegxWFLOcHKXUfKWE4NlcpbUPh6j RRyIH3gPIQue5dIJZ+VaW57F7ag0mAXz6wonIcGqOl8mNT0aIpO9t75w/PZ3s+EcSe/luZW72 TE4rqnENbSeN9yPsIuGwJh92VReRi3FwvhK5/PZ5lCGAsnVeTbI+aU5HuKXgoIObVbHS0dk7X O9naRLXzokiK/4nxGbyJHAj7YNaoMf4fjIqqYYJWqLPlcfE9AImtx8bKhqCgmgLLYyUIqvjnG FYLmOAdjM502kVu7RFAFh9xv4n76fdizshOrOgo/7MuImUVQxNQsCLYfeDi3yVU3+l8BaurMT t6SIdpgyhNpkS6cFANcncUyki3JD45RK1G89Zp8OP0tibtynfBhHMyFMp924DeLiYt5Xr3BFO BiSjO2Ecn/QIy6vN7R41i2WqlDhWgKiV35AHa0nW1YeRKBvB5xZdZg9Cd/Q6YPyAfnIDwLl8D 2RtCzq0R5bWTK3wakOMGLbTaJ/pdP1bFxNijt3otvsbRavF3bzAmzisAj5L4h8KAGYxYtTDMa RJbc2C/MWAc2TygSnWDYArJ+tqB8b7dIUofNhw== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org gcc-8 points out that a string is copied to itself here: In file included from drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/platform_support.h:25, from drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h:48, from drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c:16: In function 'strncpy', inlined from 'ia_css_debug_pipe_graph_dump_stage' at drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h:158:2: include/linux/string.h:253:9: error: '__builtin_strncpy' source argument is the same as destination [-Werror=restrict] return __builtin_strncpy(p, q, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This removes the bogus code, leaving the behavior otherwise unchanged. Signed-off-by: Arnd Bergmann --- .../atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.9.0 diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c index f22d73b56bc6..60395904f89a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c @@ -2858,13 +2858,7 @@ ia_css_debug_pipe_graph_dump_stage( if (l && enable_info[l-1] == ',') enable_info[--l] = '\0'; - if (l <= ENABLE_LINE_MAX_LENGTH) { - /* It fits on one line, copy string and init */ - /* other helper strings with empty string */ - strcpy_s(enable_info, - sizeof(enable_info), - ei); - } else { + if (l > ENABLE_LINE_MAX_LENGTH) { /* Too big for one line, find last comma */ p = ENABLE_LINE_MAX_LENGTH; while (ei[p] != ',')