From patchwork Wed Jul 6 16:44:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emese Revfy X-Patchwork-Id: 9216681 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 DE06E60467 for ; Wed, 6 Jul 2016 16:38:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE30E27D5E for ; Wed, 6 Jul 2016 16:38:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2BB127D64; Wed, 6 Jul 2016 16:38:28 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 0D65327D5D for ; Wed, 6 Jul 2016 16:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751853AbcGFQiY (ORCPT ); Wed, 6 Jul 2016 12:38:24 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33583 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753917AbcGFQiJ (ORCPT ); Wed, 6 Jul 2016 12:38:09 -0400 Received: by mail-wm0-f68.google.com with SMTP id r201so21493wme.0; Wed, 06 Jul 2016 09:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3qGPwcyKF1J2rGoM7dnPVQTKJLwzUAeFCfcM0XaeT48=; b=T3TV7z7X8qwsbUxs2srFZwO0hpxXiFMSu3cSMSd0Y2B/QYLShi1RJoewcNsgdUZ0By ApvwjwwCYEq+zAJ5m/LgpGpi6yZauLo8RykIula2zsMIApyTWvJOd+x//KKFiznl9SZT 72dcXPKvZkChxX45xygGoY6vkM+Z+7QGcX/IPWKzChDfRQ9hpggnTEIi+1wLeBtTrXK6 T8Z4FfB8MOnqgd5Ln+z51tZk7gFzKS/37Bwla6WmT3lbp7seEbOJuZ5hAj8ydBTEy7x4 rv/6run1OPob6X1exnx2FVkOnP2ihTQtfAS12QZLI3MbmTo8d5sMZZc+SkqQtLxCM9Gi jgOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3qGPwcyKF1J2rGoM7dnPVQTKJLwzUAeFCfcM0XaeT48=; b=WZcYqOcU7OaxoGzwMDKxvmsyIp053K+kex9UtknyjIG3eXX8gSxT5quQjc7fE1yb2U R4fS769z1hODtPIkwImaPmNPhgmdlU28HYlIZUvnJ1ftIQle1E5CGcn2fNRDFFEbfkO8 vog72BlC680peJj2xunYbvUtEQqMX5Ud37g+EIzszi0t3Gn3jX3BWbiF3xI60WkoAX4G K8tBebVb5fqsE6aukmB+soMC7Ypu/phcnqnLM/BVF1eSsUeQgkrrUThYIJawr6klIXrh NtrE5Xn6+j4eYsLS5saIAb+t9WfPYhcPbWwF1NYjvGfIfgL0F1fU+5VFM0FRStMdxVJG zCCg== X-Gm-Message-State: ALyK8tLJC86eJepftT8V3TfiZda8c7yPnoeuihEBg6fDIozrNyH97YMmQoA60XkipzQkBw== X-Received: by 10.28.187.134 with SMTP id l128mr20981976wmf.51.1467823088036; Wed, 06 Jul 2016 09:38:08 -0700 (PDT) Received: from localhost (beleg.madhouse-project.org. [128.199.36.147]) by smtp.gmail.com with ESMTPSA id t3sm6866802wmf.6.2016.07.06.09.38.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 09:38:07 -0700 (PDT) Date: Wed, 6 Jul 2016 18:44:28 +0200 From: Emese Revfy To: kernel-hardening@lists.openwall.com Cc: pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, linux-kbuild@vger.kernel.org, minipli@ld-linux.so, linux@armlinux.org.uk, catalin.marinas@arm.com, linux@rasmusvillemoes.dk, david.brown@linaro.org, benh@kernel.crashing.org, tglx@linutronix.de, akpm@linux-foundation.org, jlayton@poochiereds.net, arnd@arndb.de, sam@ravnborg.org, isdn@linux-pingi.de Subject: [PATCH v2 3/3] Constify some function parameters Message-Id: <20160706184428.ea8500af0297971892249dc6@gmail.com> In-Reply-To: <20160705014315.c44b7c41fcb6900e10d9f4a2@gmail.com> References: <20160705013928.396ce4a7cbbc40e6c09efc43@gmail.com> <20160705014315.c44b7c41fcb6900e10d9f4a2@gmail.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initify needs const pointer types, the initify plugin caught some __printf arguments that weren't const yet. Signed-off-by: Emese Revfy --- drivers/isdn/hisax/config.c | 16 ++++++++-------- drivers/isdn/hisax/hisax.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index bf04d2a..2d12c6c 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -659,7 +659,7 @@ int jiftime(char *s, long mark) static u_char tmpbuf[HISAX_STATUS_BUFSIZE]; -void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, +void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args) { /* if head == NULL the fmt contains the full info */ @@ -669,23 +669,24 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, u_char *p; isdn_ctrl ic; int len; + const u_char *data; if (!cs) { printk(KERN_WARNING "HiSax: No CardStatus for message"); return; } spin_lock_irqsave(&cs->statlock, flags); - p = tmpbuf; if (head) { + p = tmpbuf; p += jiftime(p, jiffies); p += sprintf(p, " %s", head); p += vsprintf(p, fmt, args); *p++ = '\n'; *p = 0; len = p - tmpbuf; - p = tmpbuf; + data = tmpbuf; } else { - p = fmt; + data = fmt; len = strlen(fmt); } if (len > HISAX_STATUS_BUFSIZE) { @@ -699,13 +700,12 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, if (i >= len) i = len; len -= i; - memcpy(cs->status_write, p, i); + memcpy(cs->status_write, data, i); cs->status_write += i; if (cs->status_write > cs->status_end) cs->status_write = cs->status_buf; - p += i; if (len) { - memcpy(cs->status_write, p, len); + memcpy(cs->status_write, data + i, len); cs->status_write += len; } #ifdef KERNELSTACK_DEBUG @@ -729,7 +729,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, } } -void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...) +void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...) { va_list args; diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 6ead6314..338d040 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1288,9 +1288,9 @@ int jiftime(char *s, long mark); int HiSax_command(isdn_ctrl *ic); int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); __printf(3, 4) -void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); +void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...); __printf(3, 0) -void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); +void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args); void HiSax_reportcard(int cardnr, int sel); int QuickHex(char *txt, u_char *p, int cnt); void LogFrame(struct IsdnCardState *cs, u_char *p, int size);