From nobody Tue Apr 30 01:46:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1591440789; cv=none; d=zohomail.com; s=zohoarc; b=B49mueREg4QWCbeB+2drQ+28wch8wcmqYL/NEQ04MvB7WbZ7/LfuOUZk4QdpbRqusmCIdIXqB+JrNyakgOw50lT03M5R2MQeL+eZB4H3XyLmz5o//zHMxmRXvwHrgwiJh+C2P+Cw3xSG0/45gplPgPNpvMdVd/zzsYoY7iJm6AM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591440789; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oARH37H4hi0KWv6uy9rBOM32C8s/g27XayK0dj4L53A=; b=SE5YbWJETo0h0bGUG5g/6WlOdmR1v1PNCuXk7LxVHQh/0rzinmYWJT0j1M2JB8wzkfnk83tDifcgs6AAgQZNwDe0Ib/JG7CKW2DDNYg2Nnd7as0LqLWDiV6f4ktPwU5aGwF3K9j5qatvVGqiQ733G1Op4+ArAlnIxW8jQ7KwXiw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1591440789216511.49160689537837; Sat, 6 Jun 2020 03:53:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-QpYzAlHhNYybhQ19jCNbXg-1; Sat, 06 Jun 2020 06:53:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45E3B800685; Sat, 6 Jun 2020 10:53:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AEED47F0A9; Sat, 6 Jun 2020 10:52:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D69351809542; Sat, 6 Jun 2020 10:52:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 056AqtxR016462 for ; Sat, 6 Jun 2020 06:52:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6CC8D2026D69; Sat, 6 Jun 2020 10:52:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68CBF2026D67 for ; Sat, 6 Jun 2020 10:52:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 436328007B1 for ; Sat, 6 Jun 2020 10:52:52 +0000 (UTC) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-odjCtZBFOyS812CQDHSrSg-1; Sat, 06 Jun 2020 06:52:49 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 43B4DBEDDE900885BD27 for ; Sat, 6 Jun 2020 18:52:44 +0800 (CST) Received: from [10.173.222.155] (10.173.222.155) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Sat, 6 Jun 2020 18:52:35 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591440787; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oARH37H4hi0KWv6uy9rBOM32C8s/g27XayK0dj4L53A=; b=ED7s1HDz9lxbY2QZmHJECKy+Zl5ln17V5RY00owooVm3qSTTSW2bxCNQD+DKGmRvtBP2B5 JtlAs+KqkDnTkzIaX2BEGWPRBPbPghOuGb2D7qPBrJiU8QlbE1m1ujAMjLwdfdFIXVz3cS UvX5SWjbjsdzZwYAi665a87gWdHVcfc= X-MC-Unique: QpYzAlHhNYybhQ19jCNbXg-1 X-MC-Unique: odjCtZBFOyS812CQDHSrSg-1 Subject: [libvirt PATCH v2] Fix some wrong usage of ATTRIBUTE_NONNULL From: Bihong Yu To: , , , References: Message-ID: <713ea347-932b-2ba4-47db-2aedcc5763a9@huawei.com> Date: Sat, 6 Jun 2020 18:52:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.173.222.155] X-CFilter-Loop: Reflected X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) There are some wrong usage of ATTRIBUTE_NONNULL, which may cause the compil= ation fail. The ATTRIBUTE_NONNULL is the define of __attribute__((__nonnull__(m))), which d= eclares that the input pointer parameter of funciton should not be NULL. If we declare some = input pointer parameter of the function is ATTRIBUTE_NONNULL, the function should not red= undancy check of the pointer parameter. And the ATTRIBUTE_NONNULL can only be using to point= er. >From 01a7301d50d6c1388df80dfa9af9da2582deec82 Mon Sep 17 00:00:00 2001 From: Bihong Yu Date: Sat, 6 Jun 2020 18:20:16 +0800 Subject: [PATCH] bugifx: fix some wrong usage of ATTRIBUTE_NONNULL The ATTRIBUTE_NONNULL is the define of __attribute__((__nonnull__(m))), whi= ch declares that the input pointer parameter of funciton should not be NULL. I= f we declare some input pointer parameter of the function is ATTRIBUTE_NONNULL, = the function should not redundancy check of the pointer parameter. And the ATTRIBUTE_NONNULL can only be using to pointer. Signed-off-by:Bihong Yu Reviewed-by:Chuan Zheng --- src/libvirt_internal.h | 3 +-- src/util/vircommand.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 00ef7aa..72c6127 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -33,8 +33,7 @@ int virStateInitialize(bool privileged, bool mandatory, const char *root, virStateInhibitCallback inhibit, - void *opaque) - ATTRIBUTE_NONNULL(2); + void *opaque); int virStateCleanup(void); int virStateReload(void); int virStateStop(void); diff --git a/src/util/vircommand.h b/src/util/vircommand.h index ff8a785..e12c88b 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -126,8 +126,7 @@ void virCommandAddArgFormat(virCommandPtr cmd, void virCommandAddArgPair(virCommandPtr cmd, const char *name, - const char *val) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); + const char *val); void virCommandAddArgSet(virCommandPtr cmd, const char *const*vals) ATTRIBUTE_NONNULL(2); --=20 1.8.3.1