From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pbs-devel-bounces@lists.proxmox.com>
Received: from ronja.mits.lan
	by ronja.mits.lan with LMTP
	id 0OVoJyoNfGY2GgAAxxbTJA
	(envelope-from <pbs-devel-bounces@lists.proxmox.com>); Wed, 26 Jun 2024 14:44:26 +0200
Received: from proxmox-new.maurer-it.com (unknown [192.168.2.33])
	by ronja.mits.lan (Postfix) with ESMTPS id 8CF7FF63AFC;
	Wed, 26 Jun 2024 14:44:26 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
	by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7377B48706;
	Wed, 26 Jun 2024 14:44:26 +0200 (CEST)
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by proxmox-new.maurer-it.com (Proxmox) with ESMTPS;
	Wed, 26 Jun 2024 14:44:25 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 7200DE0C;
	Wed, 26 Jun 2024 14:44:25 +0200 (CEST)
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Date: Wed, 26 Jun 2024 14:43:35 +0200
Message-Id: <20240626124346.531790-7-m.sandoval@proxmox.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240626124346.531790-1-m.sandoval@proxmox.com>
References: <20240626124346.531790-1-m.sandoval@proxmox.com>
MIME-Version: 1.0
Subject: [pbs-devel] [PATCH proxmox v2 07/18] acl: remove null pointer cast
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox Backup Server development discussion
 <pbs-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pbs-devel-bounces@lists.proxmox.com
Sender: "pbs-devel" <pbs-devel-bounces@lists.proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
	DMARC_MISSING             0.1 Missing DMARC policy
	KAM_DMARC_STATUS         0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
	KAM_LAZY_DOMAIN_SECURITY      1 Sending domain does not have any anti-forgery methods
	MAILING_LIST_MULTI         -2 Multiple indicators imply a widely-seen list manager
	RAZOR2_CF_RANGE_51_100   2.43 Razor2 gives confidence level above 50%
	RAZOR2_CHECK            1.729 Listed in Razor2 (http://razor.sf.net/)
	RCVD_IN_DNSWL_MED        -2.3 Sender listed at https://www.dnswl.org/, medium trust
	SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
	SPF_NONE                0.001 SPF: sender does not publish an SPF Record

Fixes the clippy warning:

warning: casting raw pointers to the same type and constness is unnecessary (`*mut fs::acl::libc::c_void` -> `*mut fs::acl::libc::c_void`)
   --> proxmox-sys/src/fs/acl.rs:130:23
    |
130 |         let mut ptr = ptr::null_mut() as *mut c_void;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr::null_mut()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxmox-sys/src/fs/acl.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxmox-sys/src/fs/acl.rs b/proxmox-sys/src/fs/acl.rs
index 5ac01bc3..6f256008 100644
--- a/proxmox-sys/src/fs/acl.rs
+++ b/proxmox-sys/src/fs/acl.rs
@@ -127,7 +127,7 @@ impl ACL {
     }
 
     pub fn create_entry(&mut self) -> Result<ACLEntry, nix::errno::Errno> {
-        let mut ptr = ptr::null_mut() as *mut c_void;
+        let mut ptr = ptr::null_mut();
         let res = unsafe { acl_create_entry(&mut self.ptr, &mut ptr) };
         if res < 0 {
             return Err(Errno::last());
@@ -200,7 +200,7 @@ impl<'a> ACLEntry<'a> {
 
     pub fn get_permissions(&self) -> Result<u64, nix::errno::Errno> {
         let mut permissions = 0;
-        let mut permset = ptr::null_mut() as *mut c_void;
+        let mut permset = ptr::null_mut();
         let mut res = unsafe { acl_get_permset(self.ptr, &mut permset) };
         if res < 0 {
             return Err(Errno::last());
@@ -221,7 +221,7 @@ impl<'a> ACLEntry<'a> {
     }
 
     pub fn set_permissions(&mut self, permissions: u64) -> Result<u64, nix::errno::Errno> {
-        let mut permset = ptr::null_mut() as *mut c_void;
+        let mut permset = ptr::null_mut();
         let mut res = unsafe { acl_get_permset(self.ptr, &mut permset) };
         if res < 0 {
             return Err(Errno::last());
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel